| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

bms_hardware.h
Go to the documentation of this file.
1 /*!
2 LTC681x hardware library
3 @verbatim
4 This library contains all of the hardware dependant functions used by the bms
5 code
6 @endverbatim
7
8 Copyright 2018(c) Analog Devices, Inc.
9
10 All rights reserved.
11
12 Redistribution and use in source and binary forms, with or without
13 modification, are permitted provided that the following conditions are met:
14 - Redistributions of source code must retain the above copyright
15 notice, this list of conditions and the following disclaimer.
16 - Redistributions in binary form must reproduce the above copyright
17 notice, this list of conditions and the following disclaimer in
18 the documentation and/or other materials provided with the
19 distribution.
20 - Neither the name of Analog Devices, Inc. nor the names of its
21 contributors may be used to endorse or promote products derived
22 from this software without specific prior written permission.
23 - The use of this software may or may not infringe the patent rights
24 of one or more patent holders. This license does not release you
25 from the requirement that you obtain separate licenses from these
26 patent holders to use this software.
27 - Use of the software either in source or binary form, must be run
28 on or directly connected to an Analog Devices Inc. component.
29
30 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
31 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
32 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
33 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
34 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
36 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
37 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
38 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40
41 Copyright 2017 Linear Technology Corp. (LTC)
42 */
43 #ifndef BMSHARDWARE_H
44 #define BMSHARDWARE_H
45
46
47
48
49 #include <stdint.h>
50
51
52 void cs_low(uint8_t pin);//name conflicts with linduino
53
54 void cs_high(uint8_t pin);
55
56 void delay_u(uint16_t micro);
57
58 void delay_m(uint16_t milli);
59
60 void set_spi_freq();
61
62
63 /*
64 Writes an array of bytes out of the SPI port
65 */
66 void spi_write_array(uint8_t len, // Option: Number of bytes to be written on the SPI port
67 uint8_t data[] //Array of bytes to be written on the SPI port
68 );
69 /*
70 Writes and read a set number of bytes using the SPI port.
71
72 */
73
74 void spi_write_read(uint8_t tx_Data[],//array of data to be written on SPI port
75 uint8_t tx_len, //length of the tx data arry
76 uint8_t *rx_data,//Input: array that will store the data read by the SPI port
77 uint8_t rx_len //Option: number of bytes to be read from the SPI port
78 );
79
80 uint8_t spi_read_byte(uint8_t tx_dat);//name conflicts with linduino also needs to take a byte as a parameter
81 #endif
spi_read_byte
uint8_t spi_read_byte(uint8_t tx_dat)
Definition: bms_hardware.cpp:108
spi_write_read
void spi_write_read(uint8_t tx_Data[], uint8_t tx_len, uint8_t *rx_data, uint8_t rx_len)
Writes and read a set number of bytes using the SPI port.
Definition: LTC68031.cpp:361
cs_low
void cs_low(uint8_t pin)
LTC681x hardware library.
Definition: bms_hardware.cpp:50
delay_m
void delay_m(uint16_t milli)
Definition: bms_hardware.cpp:65
data
union LT_union_int32_4bytes data
Definition: DC2094A.ino:138
delay_u
void delay_u(uint16_t micro)
Definition: bms_hardware.cpp:60
spi_write_array
void spi_write_array(uint8_t len, uint8_t data[])
Writes an array of bytes out of the SPI port.
Definition: LTC68031.cpp:349
cs_high
void cs_high(uint8_t pin)
Definition: bms_hardware.cpp:55
set_spi_freq
void set_spi_freq()