| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #include <stdint.h>
- #include <stdbool.h>
- #ifndef CONFIG_H_
- #define CONFIG_H_
- #define I2C_TX_MAX_PACKET_SIZE (8)
- #define I2C_RX_MAX_PACKET_SIZE (12)
- #define BATTERY_THRESHOLD (50)
- #define TEMPERATURE_MAX_C (60)
- #define MAX_CYCLES (2)
- #define TARGET_BASE_ADDRESS (0x49)
- #define MEASUREMENT_CHECK_INTERVAL 3200000 //Do not know yet the exact timing
- typedef struct{
- uint8_t txBuffer[I2C_TX_MAX_PACKET_SIZE];
- uint8_t txLen;
- uint8_t txCount;
- bool txComplete;
- }tx_Packet;
- typedef struct{
- uint8_t rxBuffer[I2C_RX_MAX_PACKET_SIZE];
- uint8_t rxLen;
- uint8_t rxCount;
- bool rxComplete;
- }rx_Packet;
- /* Indicates status of I2C */
- enum I2cControllerStatus {
- I2C_STATUS_IDLE = 0,
- I2C_STATUS_TX_STARTED,
- I2C_STATUS_TX_INPROGRESS,
- I2C_STATUS_TX_COMPLETE,
- I2C_STATUS_RX_STARTED,
- I2C_STATUS_RX_INPROGRESS,
- I2C_STATUS_RX_COMPLETE,
- I2C_STATUS_ERROR,
- } gI2cControllerStatus;
- // Global variables declared in i2c_hal.c
- extern tx_Packet txPacket;
- extern rx_Packet rxPacket;
- #endif
|