This commit is contained in:
刘可亮
2024-09-30 17:06:01 +08:00
parent 2ce4d6bb89
commit 0ef85b55da
9363 changed files with 843557 additions and 428518 deletions

View File

@@ -26,6 +26,8 @@ extern "C" {
#define RT_I2C_NO_READ_ACK (1u << 6) /* when I2C reading, we do not ACK */
#define RT_I2C_NO_STOP (1u << 7)
#define AIC_I2C_CMD_BUF_LEN 8
struct rt_i2c_msg
{
rt_uint16_t addr;
@@ -93,6 +95,29 @@ rt_size_t rt_i2c_master_recv(struct rt_i2c_bus_device *bus,
rt_uint8_t *buf,
rt_uint32_t count);
#ifdef AIC_I2C_DRV
rt_size_t rt_i2c_write_reg(struct rt_i2c_bus_device *bus,
rt_uint16_t addr,
rt_uint8_t reg,
rt_uint8_t *buf,
rt_uint32_t count);
rt_size_t rt_i2c_write_reg16(struct rt_i2c_bus_device *bus,
rt_uint16_t addr,
rt_uint16_t reg,
rt_uint8_t *buf,
rt_uint32_t count);
rt_size_t rt_i2c_read_reg(struct rt_i2c_bus_device *bus,
rt_uint16_t addr,
rt_uint8_t reg,
rt_uint8_t *buf,
rt_uint32_t count);
rt_size_t rt_i2c_read_reg16(struct rt_i2c_bus_device *bus,
rt_uint16_t addr,
rt_uint16_t reg,
rt_uint8_t *buf,
rt_uint32_t count);
#endif
rt_inline rt_err_t rt_i2c_bus_lock(struct rt_i2c_bus_device *bus, rt_tick_t timeout)
{
return rt_mutex_take(&bus->lock, timeout);

View File

@@ -26,6 +26,7 @@
#define PWM_CMD_GET_FIFO (RT_DEVICE_CTRL_BASE(PWM) + 10)
#define PWM_CMD_SET_PUL (RT_DEVICE_CTRL_BASE(PWM) + 11)
#define PWM_CMD_SET_OUTPUT (RT_DEVICE_CTRL_BASE(PWM) + 12)
#define PWM_CMD_DMA_SET_FIFO (RT_DEVICE_CTRL_BASE(PWM) + 13)
struct rt_pwm_configuration
{
@@ -52,11 +53,9 @@ struct rt_pwm_configuration
rt_uint32_t pul_num;
rt_uint32_t pul_prd;
rt_uint32_t pul_cmp;
#ifdef AIC_DMA_DRV
rt_uint32_t *buf;
rt_uint32_t buf_len;
#endif
#endif
};
struct rt_device_pwm;