config.h 768 B

1234567891011121314151617181920212223242526272829303132
  1. #include <stdint.h>
  2. #include <stdbool.h>
  3. #ifndef CONFIG_H_
  4. #define CONFIG_H_
  5. #define I2C_TX_MAX_PACKET_SIZE (8)
  6. #define I2C_RX_MAX_PACKET_SIZE (12)
  7. #define BATTERY_THRESHOLD (20)
  8. #define TEMPERATURE_MAX_C (60)
  9. #define MAX_CYCLES (2)
  10. #define TARGET_BASE_ADDRESS (0x48)
  11. #define MEASUREMENT_CHECK_INTERVAL 320000 //Do not know yet the exact timing
  12. #define HEALTHY_BATTERY_VALUE (3800)
  13. typedef struct{
  14. uint8_t txBuffer[I2C_TX_MAX_PACKET_SIZE];
  15. uint8_t txLen;
  16. uint8_t txCount;
  17. bool txComplete;
  18. }tx_Packet;
  19. typedef struct{
  20. uint8_t rxBuffer[I2C_RX_MAX_PACKET_SIZE];
  21. uint8_t rxLen;
  22. uint8_t rxCount;
  23. bool rxComplete;
  24. }rx_Packet;
  25. // Global variables declared in i2c_hal.c
  26. extern tx_Packet txPacket;
  27. extern rx_Packet rxPacket;
  28. #endif