1
0

smbus.h 752 B

1234567891011121314151617181920212223242526
  1. #ifndef __SMBUS_H
  2. #define __SMBUS_H
  3. #include "iot_gpio.h"
  4. #include "iot_gpio_ex.h"
  5. #define ACK 0
  6. #define NACK 1
  7. #define WIFI_IOT_IO_NAME_GPIO_10 10
  8. #define WIFI_IOT_IO_NAME_GPIO_12 12
  9. #define SMBUS_SCL_H() IoTGpioSetOutputVal(WIFI_IOT_IO_NAME_GPIO_10, 1);
  10. #define SMBUS_SCL_L() IoTGpioSetOutputVal(WIFI_IOT_IO_NAME_GPIO_10, 0);
  11. #define SMBUS_SDA_H() IoTGpioSetOutputVal(WIFI_IOT_IO_NAME_GPIO_12, 1);
  12. #define SMBUS_SDA_L() IoTGpioSetOutputVal(WIFI_IOT_IO_NAME_GPIO_12, 0);
  13. void SMBus_Start(void);
  14. void SMBus_Stop(void);
  15. void SMBus_SendBit(uint8_t bit_out);
  16. uint8_t SMBus_ReceiveBit(void);
  17. uint8_t SMBus_SendByte(uint8_t Tx_buffer);
  18. uint8_t SMBus_ReceiveByte(uint8_t ack_nack);
  19. #endif