BMS_T2
Dependencies: INA226
bms.h@3:61174d4de67d, 2020-10-13 (annotated)
- Committer:
- takuma1
- Date:
- Tue Oct 13 07:20:11 2020 +0000
- Revision:
- 3:61174d4de67d
- Parent:
- 1:4dd3e328a30b
BMS_T2;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
APS_Lab | 1:4dd3e328a30b | 1 | void cs_low(void); |
APS_Lab | 1:4dd3e328a30b | 2 | void cs_high(void); |
APS_Lab | 1:4dd3e328a30b | 3 | |
APS_Lab | 0:f06ed53310a3 | 4 | void delay_u(uint16_t micro); |
APS_Lab | 0:f06ed53310a3 | 5 | |
APS_Lab | 0:f06ed53310a3 | 6 | void delay_m(uint16_t milli); |
APS_Lab | 0:f06ed53310a3 | 7 | |
APS_Lab | 0:f06ed53310a3 | 8 | void set_spi_freq(); |
APS_Lab | 0:f06ed53310a3 | 9 | |
APS_Lab | 0:f06ed53310a3 | 10 | void spi_enable(void); |
APS_Lab | 0:f06ed53310a3 | 11 | |
APS_Lab | 0:f06ed53310a3 | 12 | /* |
APS_Lab | 0:f06ed53310a3 | 13 | Writes an array of bytes out of the SPI port |
APS_Lab | 0:f06ed53310a3 | 14 | */ |
APS_Lab | 0:f06ed53310a3 | 15 | void spi_write_array(uint8_t len, // Option: Number of bytes to be written on the SPI port |
APS_Lab | 0:f06ed53310a3 | 16 | uint8_t data[] //Array of bytes to be written on the SPI port |
APS_Lab | 0:f06ed53310a3 | 17 | ); |
APS_Lab | 0:f06ed53310a3 | 18 | /* |
APS_Lab | 0:f06ed53310a3 | 19 | Writes and read a set number of bytes using the SPI port. |
APS_Lab | 0:f06ed53310a3 | 20 | |
APS_Lab | 0:f06ed53310a3 | 21 | */ |
APS_Lab | 0:f06ed53310a3 | 22 | |
APS_Lab | 0:f06ed53310a3 | 23 | void spi_write_read(uint8_t tx_Data[],//array of data to be written on SPI port |
APS_Lab | 0:f06ed53310a3 | 24 | uint8_t tx_len, //length of the tx data arry |
APS_Lab | 0:f06ed53310a3 | 25 | uint8_t *rx_data,//Input: array that will store the data read by the SPI port |
APS_Lab | 0:f06ed53310a3 | 26 | uint8_t rx_len //Option: number of bytes to be read from the SPI port |
APS_Lab | 0:f06ed53310a3 | 27 | ); |
APS_Lab | 0:f06ed53310a3 | 28 | |
APS_Lab | 0:f06ed53310a3 | 29 | uint8_t spi_read_byte(uint8_t tx_dat);//name conflicts with linduino also needs to take a byte as a parameter |