mirror of
https://gitee.com/Vancouver2017/luban-lite.git
synced 2025-12-29 01:06:56 +00:00
V1.0.5
This commit is contained in:
@@ -23,10 +23,13 @@ struct rt_adc_ops
|
||||
rt_err_t (*config_dma)(struct rt_adc_device *device, void *dma_info);
|
||||
rt_err_t (*get_dma_data)(struct rt_adc_device *device,
|
||||
rt_uint32_t channel);
|
||||
rt_uint32_t (*get_irq_count)(struct rt_adc_device *device,
|
||||
rt_uint32_t channel);
|
||||
rt_err_t (*get_mode)(struct rt_adc_device *device, void *chan_info);
|
||||
rt_uint32_t (*get_obtaining_data_mode)(struct rt_adc_device *device,
|
||||
rt_uint32_t channel);
|
||||
rt_uint32_t (*get_irq_count)(struct rt_adc_device *device,
|
||||
rt_uint32_t channel);
|
||||
rt_err_t (*irq_callback)(struct rt_adc_device *device, void *dma_info);
|
||||
rt_err_t (*get_ch_info)(struct rt_adc_device *device, void *chan_info);
|
||||
#endif
|
||||
#ifdef AIC_PSADC_DRV
|
||||
rt_err_t (*get_adc_values_poll)(struct rt_adc_device *device,
|
||||
@@ -57,11 +60,14 @@ typedef enum
|
||||
RT_ADC_CMD_GET_DMA_DATA = RT_DEVICE_CTRL_BASE(ADC) + 6,
|
||||
RT_ADC_CMD_CONFIG_DMA = RT_DEVICE_CTRL_BASE(ADC) + 7,
|
||||
RT_ADC_CMD_OBTAIN_DATA_MODE = RT_DEVICE_CTRL_BASE(ADC) + 8,
|
||||
RT_ADC_CMD_IRQ_CALLBACK = RT_DEVICE_CTRL_BASE(ADC) + 9,
|
||||
RT_ADC_CMD_GET_CH_INFO = RT_DEVICE_CTRL_BASE(ADC) + 10,
|
||||
RT_ADC_CMD_GET_MODE = RT_DEVICE_CTRL_BASE(ADC) + 11,
|
||||
#endif
|
||||
#ifdef AIC_PSADC_DRV
|
||||
RT_ADC_CMD_GET_VALUES_POLL = RT_DEVICE_CTRL_BASE(ADC) + 9,
|
||||
RT_ADC_CMD_GET_VALUES = RT_DEVICE_CTRL_BASE(ADC) + 10,
|
||||
RT_ADC_CMD_GET_CHAN_COUNT = RT_DEVICE_CTRL_BASE(ADC) + 11,
|
||||
RT_ADC_CMD_GET_VALUES_POLL = RT_DEVICE_CTRL_BASE(ADC) + 12,
|
||||
RT_ADC_CMD_GET_VALUES = RT_DEVICE_CTRL_BASE(ADC) + 13,
|
||||
RT_ADC_CMD_GET_CHAN_COUNT = RT_DEVICE_CTRL_BASE(ADC) + 14,
|
||||
#endif
|
||||
} rt_adc_cmd_t;
|
||||
|
||||
|
||||
@@ -47,6 +47,9 @@ struct rt_i2c_bus_device_ops
|
||||
rt_err_t (*i2c_bus_control)(struct rt_i2c_bus_device *bus,
|
||||
rt_uint32_t,
|
||||
rt_uint32_t);
|
||||
rt_err_t (*i2c_slave_control)(struct rt_i2c_bus_device *bus,
|
||||
rt_uint32_t,
|
||||
void *);
|
||||
};
|
||||
|
||||
/*for i2c bus driver*/
|
||||
@@ -76,6 +79,9 @@ rt_size_t rt_i2c_transfer(struct rt_i2c_bus_device *bus,
|
||||
rt_err_t rt_i2c_control(struct rt_i2c_bus_device *bus,
|
||||
rt_uint32_t cmd,
|
||||
rt_uint32_t arg);
|
||||
rt_err_t rt_i2c_slave_control(struct rt_i2c_bus_device *bus,
|
||||
rt_uint32_t cmd,
|
||||
void *arg);
|
||||
rt_size_t rt_i2c_master_send(struct rt_i2c_bus_device *bus,
|
||||
rt_uint16_t addr,
|
||||
rt_uint16_t flags,
|
||||
|
||||
@@ -23,6 +23,7 @@ extern "C" {
|
||||
#define RT_I2C_DEV_CTRL_TIMEOUT (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x03)
|
||||
#define RT_I2C_DEV_CTRL_RW (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x04)
|
||||
#define RT_I2C_DEV_CTRL_CLK (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x05)
|
||||
#define RT_I2C_DEV_SLAVE_CONFIG (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x06)
|
||||
|
||||
struct rt_i2c_priv_data
|
||||
{
|
||||
|
||||
@@ -126,6 +126,9 @@ extern "C" {
|
||||
#define RT_SENSOR_CTRL_SET_MODE (RT_DEVICE_CTRL_BASE(Sensor) + 4) /* Set sensor's work mode. ex. RT_SENSOR_MODE_POLLING,RT_SENSOR_MODE_INT */
|
||||
#define RT_SENSOR_CTRL_SET_POWER (RT_DEVICE_CTRL_BASE(Sensor) + 5) /* Set power mode. args type of sensor power mode. ex. RT_SENSOR_POWER_DOWN,RT_SENSOR_POWER_NORMAL */
|
||||
#define RT_SENSOR_CTRL_SELF_TEST (RT_DEVICE_CTRL_BASE(Sensor) + 6) /* Take a self test */
|
||||
#ifdef AIC_TSEN_DRV
|
||||
#define RT_SENSOR_CTRL_GET_CH_INFO (RT_DEVICE_CTRL_BASE(Sensor) + 7) /* Get sensor chan info */
|
||||
#endif
|
||||
|
||||
#define RT_SENSOR_CTRL_USER_CMD_START 0x100 /* User commands should be greater than 0x100 */
|
||||
|
||||
|
||||
@@ -65,6 +65,12 @@
|
||||
#define RT_SERIAL_EVENT_TX_DMADONE 0x04 /* Tx DMA transfer done */
|
||||
#define RT_SERIAL_EVENT_RX_TIMEOUT 0x05 /* Rx timeout */
|
||||
|
||||
#define RT_SERIAL_DMA_FCH_BUFFER 50 /* DMA mode flow control high level buffer */
|
||||
#define RT_SERIAL_DMA_FCL_BUFFER 100 /* DMA mode flow control low level buffer */
|
||||
|
||||
#define RT_SERIAL_INT_FCH_BUFFER 50 /* INT mode flow control high level buffer */
|
||||
#define RT_SERIAL_INT_FCL_BUFFER 100 /* INT mode flow control low level buffer */
|
||||
|
||||
#define RT_SERIAL_DMA_RX 0x01
|
||||
#define RT_SERIAL_DMA_TX 0x02
|
||||
|
||||
@@ -81,9 +87,26 @@
|
||||
#define RT_SERIAL_FLOWCONTROL_CTSRTS 1
|
||||
#define RT_SERIAL_FLOWCONTROL_NONE 0
|
||||
|
||||
#define RT_SERIAL_RS485_MODE 1 /* ArtInChip Uart 485 mode flag */
|
||||
#define RT_SERIAL_RS485_MODE 1 /* ArtInChip Uart 485 mode flag */
|
||||
#define RT_SERIAL_RS485_SIMULATION_MODE 7 /* ArtInChip Uart simulation 485 mode flag */
|
||||
#define RT_SERIAL_RS485_RTS_LOW 0x80 /* ArtInChip Uart 485 RTS_Pin Low level*/
|
||||
#define RT_SERIAL_RS485_RTS_HIGH 0x81 /* ArtInChip Uart 485 RTS_Pin High Level */
|
||||
#define RT_SERIAL_232_RESUME_DATA 0x83
|
||||
#define RT_SERIAL_232_SUSPEND_DATA 0x84
|
||||
#define RT_SERIAL_SW_FLOW_CTRL 0x85
|
||||
#define RT_SERIAL_SW_RECEIVE_ON_OFF 0x86
|
||||
|
||||
typedef enum
|
||||
{
|
||||
RT_SERIAL_FUNC_RS232 = 0, ///< RS232
|
||||
RT_SERIAL_FUNC_RS485 = 1, ///< RS485 normal
|
||||
RT_SERIAL_FUNC_RS485_COMACT_IO = 2, ///< RS485 compact io
|
||||
RT_SERIAL_RS232_AUTO_FLOW_CTRL = 3, ///< RS232 flow conctrol
|
||||
RT_SERIAL_RS232_UNAUTO_FLOW_CTRL = 4, ///< RS232 hardware unauto flow conctrol
|
||||
RT_SERIAL_RS232_SW_FLOW_CTRL = 5, ///< RS232 software flow conctrol
|
||||
RT_SERIAL_RS232_SW_HW_FLOW_CTRL = 6, ///< RS232 software and hardware flow conctrol
|
||||
}rt_serial_mode;
|
||||
|
||||
|
||||
/* Default config for serial_configure structure */
|
||||
#define RT_SERIAL_CONFIG_DEFAULT \
|
||||
@@ -98,8 +121,10 @@
|
||||
RT_SERIAL_FLOWCONTROL_NONE, /* Off flowcontrol */ \
|
||||
0, \
|
||||
259, \
|
||||
USART_FUNC_RS232, \
|
||||
0, \
|
||||
0, \
|
||||
0, \
|
||||
0, \
|
||||
0, \
|
||||
0x0F \
|
||||
}
|
||||
|
||||
@@ -118,6 +143,8 @@ struct serial_configure
|
||||
rt_uint32_t flag;
|
||||
rt_uint32_t function :4;
|
||||
rt_uint32_t flow_ctrl_suspend :1;
|
||||
rt_uint32_t flowctrl_cts_enable :1;
|
||||
rt_uint32_t flowctrl_rts_enable :1;
|
||||
rt_uint32_t uart_index :4;
|
||||
};
|
||||
|
||||
@@ -186,4 +213,7 @@ rt_err_t rt_hw_serial_register(struct rt_serial_device *serial,
|
||||
rt_uint32_t flag,
|
||||
void *data);
|
||||
|
||||
void rt_flowctrl_low_detect(struct rt_serial_device *serial, rt_size_t len, rt_size_t flow_ctrl_low_flag);
|
||||
void rt_flowctrl_high_detect(struct rt_serial_device *serial, rt_size_t len, rt_size_t flow_ctrl_low_flag);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user