1234567891011121314151617181920212223242526 |
- #ifndef __SMBUS_H
- #define __SMBUS_H
- #include "iot_gpio.h"
- #include "iot_gpio_ex.h"
- #define ACK 0
- #define NACK 1
- #define WIFI_IOT_IO_NAME_GPIO_10 10
- #define WIFI_IOT_IO_NAME_GPIO_12 12
- #define SMBUS_SCL_H() IoTGpioSetOutputVal(WIFI_IOT_IO_NAME_GPIO_10, 1);
- #define SMBUS_SCL_L() IoTGpioSetOutputVal(WIFI_IOT_IO_NAME_GPIO_10, 0);
- #define SMBUS_SDA_H() IoTGpioSetOutputVal(WIFI_IOT_IO_NAME_GPIO_12, 1);
- #define SMBUS_SDA_L() IoTGpioSetOutputVal(WIFI_IOT_IO_NAME_GPIO_12, 0);
- void SMBus_Start(void);
- void SMBus_Stop(void);
- void SMBus_SendBit(uint8_t bit_out);
- uint8_t SMBus_ReceiveBit(void);
- uint8_t SMBus_SendByte(uint8_t Tx_buffer);
- uint8_t SMBus_ReceiveByte(uint8_t ack_nack);
- #endif
|