diff options
| author | liukangcc <[email protected]> | 2021-10-14 10:31:44 +0800 |
|---|---|---|
| committer | liukangcc <[email protected]> | 2021-10-14 10:32:22 +0800 |
| commit | 3ac36a31071f66a06217b4676fc7266ba66c906a (patch) | |
| tree | be32fc9b7abb102aa905fdba0165bf6adf4c065d /components/drivers/include | |
| parent | 0369db718cd3b1ff58ceb2fc44a48641a0fecc66 (diff) | |
| parent | 33263d7e4ec22b118d0407ec7488ccfa60a8a0a1 (diff) | |
[update] Fix compiler flags issue
Diffstat (limited to 'components/drivers/include')
| -rw-r--r-- | components/drivers/include/drivers/cputime.h | 2 | ||||
| -rw-r--r-- | components/drivers/include/drivers/pm.h | 1 | ||||
| -rw-r--r-- | components/drivers/include/drivers/rtc.h | 16 | ||||
| -rw-r--r-- | components/drivers/include/drivers/serial.h | 7 | ||||
| -rw-r--r-- | components/drivers/include/ipc/ringblk_buf.h | 5 |
5 files changed, 21 insertions, 10 deletions
diff --git a/components/drivers/include/drivers/cputime.h b/components/drivers/include/drivers/cputime.h index 0141f24805..26a1e40f8e 100644 --- a/components/drivers/include/drivers/cputime.h +++ b/components/drivers/include/drivers/cputime.h @@ -11,6 +11,8 @@ #ifndef CPUTIME_H__ #define CPUTIME_H__ +#include <stdint.h> + struct rt_clock_cputime_ops { float (*cputime_getres) (void); diff --git a/components/drivers/include/drivers/pm.h b/components/drivers/include/drivers/pm.h index 51bff54ebb..d38c0a4e2a 100644 --- a/components/drivers/include/drivers/pm.h +++ b/components/drivers/include/drivers/pm.h @@ -15,6 +15,7 @@ #ifndef __PM_H__ #define __PM_H__ +#include <stdint.h> #include <rtthread.h> #ifndef PM_HAS_CUSTOM_CONFIG diff --git a/components/drivers/include/drivers/rtc.h b/components/drivers/include/drivers/rtc.h index 0bafbad7ad..5b333161f8 100644 --- a/components/drivers/include/drivers/rtc.h +++ b/components/drivers/include/drivers/rtc.h @@ -15,12 +15,12 @@ #include <rtdef.h> -#define RT_DEVICE_CTRL_RTC_GET_TIME 0x10 /**< get second time */ -#define RT_DEVICE_CTRL_RTC_SET_TIME 0x11 /**< set second time */ -#define RT_DEVICE_CTRL_RTC_GET_TIME_US 0x12 /**< get microsecond time */ -#define RT_DEVICE_CTRL_RTC_SET_TIME_US 0x13 /**< set microsecond time */ -#define RT_DEVICE_CTRL_RTC_GET_ALARM 0x14 /**< get alarm */ -#define RT_DEVICE_CTRL_RTC_SET_ALARM 0x15 /**< set alarm */ +#define RT_DEVICE_CTRL_RTC_GET_TIME 0x20 /**< get second time */ +#define RT_DEVICE_CTRL_RTC_SET_TIME 0x21 /**< set second time */ +#define RT_DEVICE_CTRL_RTC_GET_TIMEVAL 0x22 /**< get timeval for gettimeofday */ +#define RT_DEVICE_CTRL_RTC_SET_TIMEVAL 0x23 /**< set timeval for gettimeofday */ +#define RT_DEVICE_CTRL_RTC_GET_ALARM 0x24 /**< get alarm */ +#define RT_DEVICE_CTRL_RTC_SET_ALARM 0x25 /**< set alarm */ struct rt_rtc_ops { @@ -29,8 +29,8 @@ struct rt_rtc_ops rt_err_t (*set_secs)(void *arg); rt_err_t (*get_alarm)(void *arg); rt_err_t (*set_alarm)(void *arg); - rt_err_t (*get_usecs)(void *arg); - rt_err_t (*set_usecs)(void *arg); + rt_err_t (*get_timeval)(void *arg); + rt_err_t (*set_timeval)(void *arg); }; typedef struct rt_rtc_device diff --git a/components/drivers/include/drivers/serial.h b/components/drivers/include/drivers/serial.h index c2e951e9b1..f0d0edbfad 100644 --- a/components/drivers/include/drivers/serial.h +++ b/components/drivers/include/drivers/serial.h @@ -77,6 +77,9 @@ #define RT_SERIAL_TX_DATAQUEUE_SIZE 2048 #define RT_SERIAL_TX_DATAQUEUE_LWM 30 +#define RT_SERIAL_FLOWCONTROL_CTSRTS 1 +#define RT_SERIAL_FLOWCONTROL_NONE 0 + /* Default config for serial_configure structure */ #define RT_SERIAL_CONFIG_DEFAULT \ { \ @@ -87,6 +90,7 @@ BIT_ORDER_LSB, /* LSB first sent */ \ NRZ_NORMAL, /* Normal mode */ \ RT_SERIAL_RB_BUFSZ, /* Buffer size */ \ + RT_SERIAL_FLOWCONTROL_NONE, /* Off flowcontrol */ \ 0 \ } @@ -100,7 +104,8 @@ struct serial_configure rt_uint32_t bit_order :1; rt_uint32_t invert :1; rt_uint32_t bufsz :16; - rt_uint32_t reserved :6; + rt_uint32_t flowcontrol :1; + rt_uint32_t reserved :5; }; /* diff --git a/components/drivers/include/ipc/ringblk_buf.h b/components/drivers/include/ipc/ringblk_buf.h index 5b2971b800..df05659f3e 100644 --- a/components/drivers/include/ipc/ringblk_buf.h +++ b/components/drivers/include/ipc/ringblk_buf.h @@ -76,9 +76,12 @@ typedef struct rt_rbb *rt_rbb_t; /* rbb (ring block buffer) API */ void rt_rbb_init(rt_rbb_t rbb, rt_uint8_t *buf, rt_size_t buf_size, rt_rbb_blk_t block_set, rt_size_t blk_max_num); +rt_size_t rt_rbb_get_buf_size(rt_rbb_t rbb); + +#ifdef RT_USING_HEAP rt_rbb_t rt_rbb_create(rt_size_t buf_size, rt_size_t blk_max_num); void rt_rbb_destroy(rt_rbb_t rbb); -rt_size_t rt_rbb_get_buf_size(rt_rbb_t rbb); +#endif /* rbb block API */ rt_rbb_blk_t rt_rbb_blk_alloc(rt_rbb_t rbb, rt_size_t blk_size); |
