Skip to content

Commit 57f813c

Browse files
authored
Merge pull request #86 from yingtao450/refactor/tuyaos-adapter-sync
refactor(tuyaos-adapter): sync tuyaos adapter interfaces and drivers
2 parents 7321a15 + fec124c commit 57f813c

179 files changed

Lines changed: 5758 additions & 5772 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tuyaos/tuyaos_adapter/include/adc/tkl_adc.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ typedef enum {
2525
// ADC_DIV_RESIS struct define, ref
2626
typedef struct {
2727
TUYA_ADC_NUM_E port;
28-
UINT8_T channel;
29-
UINT8_T data;
28+
uint8_t channel;
29+
uint8_t data;
3030
} ADC_IOCTL_DIV_RESIS_T;
3131

3232
/**
@@ -58,7 +58,7 @@ OPERATE_RET tkl_adc_deinit(TUYA_ADC_NUM_E port_num);
5858
*
5959
* @return adc width
6060
*/
61-
UINT8_T tkl_adc_width_get(TUYA_ADC_NUM_E port_num);
61+
uint8_t tkl_adc_width_get(TUYA_ADC_NUM_E port_num);
6262

6363
/**
6464
* @brief get adc reference voltage
@@ -68,14 +68,14 @@ UINT8_T tkl_adc_width_get(TUYA_ADC_NUM_E port_num);
6868
*
6969
* @return adc reference voltage(bat: mv)
7070
*/
71-
UINT32_T tkl_adc_ref_voltage_get(TUYA_ADC_NUM_E port_num);
71+
uint32_t tkl_adc_ref_voltage_get(TUYA_ADC_NUM_E port_num);
7272

7373
/**
7474
* @brief adc get temperature
7575
*
7676
* @return temperature(bat: 'C)
7777
*/
78-
INT32_T tkl_adc_temperature_get(VOID_T);
78+
int32_t tkl_adc_temperature_get(void);
7979

8080
/**
8181
* @brief adc read
@@ -86,7 +86,7 @@ INT32_T tkl_adc_temperature_get(VOID_T);
8686
*
8787
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
8888
*/
89-
OPERATE_RET tkl_adc_read_data(TUYA_ADC_NUM_E port_num, INT32_T *buff, UINT16_T len);
89+
OPERATE_RET tkl_adc_read_data(TUYA_ADC_NUM_E port_num, int32_t *buff, uint16_t len);
9090

9191
/**
9292
* @brief read single channel
@@ -98,7 +98,7 @@ OPERATE_RET tkl_adc_read_data(TUYA_ADC_NUM_E port_num, INT32_T *buff, UINT16_T l
9898
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
9999
*
100100
*/
101-
OPERATE_RET tkl_adc_read_single_channel(TUYA_ADC_NUM_E port_num, UINT8_T ch_id, INT32_T *data);
101+
OPERATE_RET tkl_adc_read_single_channel(TUYA_ADC_NUM_E port_num, uint8_t ch_id, int32_t *data);
102102

103103
/**
104104
* @brief read voltage
@@ -110,7 +110,7 @@ OPERATE_RET tkl_adc_read_single_channel(TUYA_ADC_NUM_E port_num, UINT8_T ch_id,
110110
*
111111
*/
112112

113-
OPERATE_RET tkl_adc_read_voltage(TUYA_ADC_NUM_E port_num, INT32_T *buff, UINT16_T len);
113+
OPERATE_RET tkl_adc_read_voltage(TUYA_ADC_NUM_E port_num, int32_t *buff, uint16_t len);
114114

115115
#ifdef __cplusplus
116116
}

tuyaos/tuyaos_adapter/include/atomic/tkl_atomic.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extern "C" {
2323
* loaded and written back to
2424
* @return value before increment
2525
*/
26-
UINT_T tkl_system_atomic_inc(UINT_T volatile *val);
26+
uint32_t tkl_system_atomic_inc(uint32_t volatile *val);
2727

2828
/**
2929
* @brief decrement one from value
@@ -32,7 +32,7 @@ UINT_T tkl_system_atomic_inc(UINT_T volatile *val);
3232
* loaded and written back to
3333
* @return value before decrement
3434
*/
35-
UINT_T tkl_system_atomic_dec(UINT_T volatile *val);
35+
uint32_t tkl_system_atomic_dec(uint32_t volatile *val);
3636

3737
/**
3838
* @brief add count to value
@@ -42,7 +42,7 @@ UINT_T tkl_system_atomic_dec(UINT_T volatile *val);
4242
* @param[in] count: Value to be add to val
4343
* @return previous *val value.
4444
*/
45-
UINT_T tkl_system_atomic_add(UINT_T volatile *val, UINT_T count);
45+
uint32_t tkl_system_atomic_add(uint32_t volatile *val, uint32_t count);
4646

4747
/**
4848
* @brief subtract count from value
@@ -52,7 +52,7 @@ UINT_T tkl_system_atomic_add(UINT_T volatile *val, UINT_T count);
5252
* @param[in] count: Value to be subtract from val
5353
* @return previous *val value.
5454
*/
55-
UINT_T tkl_system_atomic_sub(UINT_T volatile *val, UINT_T count);
55+
uint32_t tkl_system_atomic_sub(uint32_t volatile *val, uint32_t count);
5656

5757
/**
5858
* @brief atomic exchange
@@ -61,7 +61,7 @@ UINT_T tkl_system_atomic_sub(UINT_T volatile *val, UINT_T count);
6161
* @param[in] psrc: source memory
6262
* @return dest original value
6363
*/
64-
VOID_T *tkl_system_atomic_swap(VOID_T * volatile *pdst, VOID_T * psrc);
64+
void *tkl_system_atomic_swap(void * volatile *pdst, void * psrc);
6565

6666

6767
/**
@@ -72,7 +72,7 @@ VOID_T *tkl_system_atomic_swap(VOID_T * volatile *pdst, VOID_T * psrc);
7272
* @param[in] compare: value of be compared
7373
* @return Unsigned integer of value 1 or 0. 1 for swapped, 0 for not swapped.
7474
*/
75-
BOOL_T tkl_system_atomic_cmp_and_set(UINT_T volatile *pdst, UINT_T val, UINT_T compare);
75+
BOOL_T tkl_system_atomic_cmp_and_set(uint32_t volatile *pdst, uint32_t val, uint32_t compare);
7676

7777
/**
7878
* @brief atomic compare and exchange
@@ -82,7 +82,7 @@ BOOL_T tkl_system_atomic_cmp_and_set(UINT_T volatile *pdst, UINT_T val, UINT_T c
8282
* @param[in] compare: value of be compared
8383
* @return Unsigned integer of value 1 or 0. 1 for swapped, 0 for not swapped.
8484
*/
85-
BOOL_T tkl_system_atomic_cmp_and_swap(VOID_T * volatile *pdst, VOID_T * psrc, VOID_T * pcmp);
85+
BOOL_T tkl_system_atomic_cmp_and_swap(void * volatile *pdst, void * psrc, void * pcmp);
8686

8787
/**
8888
* @brief atomic AND
@@ -91,7 +91,7 @@ BOOL_T tkl_system_atomic_cmp_and_swap(VOID_T * volatile *pdst, VOID_T * psrc, VO
9191
* @param[in] val: set value
9292
* @return dest original value.
9393
*/
94-
UINT_T tkl_system_atomic_and(UINT_T volatile *pdst, UINT_T val);
94+
uint32_t tkl_system_atomic_and(uint32_t volatile *pdst, uint32_t val);
9595

9696
/**
9797
* @brief atomic OR
@@ -100,7 +100,7 @@ UINT_T tkl_system_atomic_and(UINT_T volatile *pdst, UINT_T val);
100100
* @param[in] val: set value
101101
* @return dest original value.
102102
*/
103-
UINT_T tkl_system_atomic_or(UINT_T volatile *pdst, UINT_T val);
103+
uint32_t tkl_system_atomic_or(uint32_t volatile *pdst, uint32_t val);
104104

105105
/**
106106
* @brief atomic NAND
@@ -109,7 +109,7 @@ UINT_T tkl_system_atomic_or(UINT_T volatile *pdst, UINT_T val);
109109
* @param[in] val: set value
110110
* @return dest original value.
111111
*/
112-
UINT_T tkl_system_atomic_nand(UINT_T volatile *pdst, UINT_T val);
112+
uint32_t tkl_system_atomic_nand(uint32_t volatile *pdst, uint32_t val);
113113

114114
/**
115115
* @brief atomic XOR
@@ -118,7 +118,7 @@ UINT_T tkl_system_atomic_nand(UINT_T volatile *pdst, UINT_T val);
118118
* @param[in] val: set value
119119
* @return dest original value.
120120
*/
121-
UINT_T tkl_system_atomic_xor(UINT_T volatile *pdst, UINT_T val);
121+
uint32_t tkl_system_atomic_xor(uint32_t volatile *pdst, uint32_t val);
122122

123123
#ifdef __cplusplus
124124
}

0 commit comments

Comments
 (0)