add pcf8574 i2c

This commit is contained in:
wmano
2025-10-14 23:53:40 +08:00
parent 067f24cff0
commit 1cdc01f7cf
14 changed files with 478 additions and 220 deletions
@@ -1,6 +1,22 @@
#ifndef __CHRG_PCF8574_H__
#define __CHRG_PCF8574_H__
#include <rtthread.h>
#include <rtdevice.h>
#include "chrg_i2c.h"
// 读取所有8口IO状态
extern rt_uint8_t chrg_pcf8574_get_port (eIDX_I2C idx);
// 读取指定管脚状态值
extern rt_uint8_t chrg_pcf8574_get_pin (eIDX_I2C idx, uint8_t bit);
// 设置所有8口IO状态值
extern int chrg_pcf8574_set_port (eIDX_I2C idx, uint8_t value);
// 设置指定管脚状态值
extern int chrg_pcf8574_set_pin (eIDX_I2C idx, uint8_t bit, uint8_t value);
#endif