i2c_hal.h 457 B

123456789101112131415161718
  1. #ifndef I2C_HAL_H
  2. #define I2C_HAL_H
  3. #include <stdint.h>
  4. #include <stdbool.h>
  5. #include "src/config.h"
  6. /*
  7. * Since C does not allows to add functions in typedef struct, however a function pointer can be included in Structure in C. This interface provides a standard features of i2c_hal
  8. */
  9. typedef struct{
  10. bool (*write)(uint8_t const TARGET_ADDRESS);
  11. bool (*read) (uint8_t const TARGET_ADDRESS);
  12. } I2C_Interface;
  13. extern I2C_Interface i2c_hal;
  14. #endif