bossay_release_out/app/A19_MXL90614/include/smbus.h

27 lines
726 B
C
Raw Permalink Normal View History

2025-09-24 11:16:14 +08:00
#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