KIT Solar Car Project / Mbed 2 deprecated BMS_v1

Dependencies:   mbed INA226

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers bms.h Source File

bms.h

00001 void cs_low(void);
00002 void cs_high(void);
00003 
00004 void delay_u(uint16_t micro);
00005 
00006 void delay_m(uint16_t milli);
00007 
00008 void set_spi_freq();
00009 
00010 void spi_enable(void);
00011 
00012 /*
00013 Writes an array of bytes out of the SPI port
00014 */
00015 
00016 void spi_write_array(uint8_t len, // Option: Number of bytes to be written on the SPI port
00017                      uint8_t data[] //Array of bytes to be written on the SPI port
00018                     );
00019                     
00020 /*
00021  Writes and read a set number of bytes using the SPI port.
00022 
00023 */
00024 
00025 void spi_write_read(uint8_t tx_Data[],//array of data to be written on SPI port
00026                     uint8_t tx_len, //length of the tx data arry
00027                     uint8_t *rx_data,//Input: array that will store the data read by the SPI port
00028                     uint8_t rx_len //Option: number of bytes to be read from the SPI port
00029                    );
00030 
00031 uint8_t spi_read_byte(uint8_t tx_dat);//name conflicts with linduino also needs to take a byte as a parameter