| 1234567891011121314151617181920212223242526272829303132333435 |
- #include "i2c_target.h"
- #include "adc.h"
- #include "battery.h"
- #include "ti/driverlib/dl_i2c.h"
- #include "ti_msp_dl_config.h"
- #include <stdint.h>
- #include <stdio.h>
- // Global buffer for I2C
- BatteryData battery_data;
- BatteryLimitMsg battery_limits;
- // Flag for Pi INTERRUPTS:
- volatile bool piRxComplete;
- volatile bool piTxComplete;
- uint8_t piTxPacket[I2C_TX_MAX_PACKET_SIZE_PI];
- uint8_t piRxPacket[I2C_RX_MAX_PACKET_SIZE_PI];
- uint32_t piTxLen, piTxCount;
- uint32_t piRxLen, piRxCount;
- /*
- - command: as defined in the Wiki for Pi 0x01, 0x02, 0x03, refer to i2c_target.h
- file
- - slot_id: battery slot numner from 0 to NUM_SLOTS-1
- - data: pointer to SET battery limits
- - len: length of the data
- */
|