@@ -20,7 +20,7 @@ extern "C" {
2020/***********************************************************
2121*************************micro define***********************
2222***********************************************************/
23- typedef void * TDL_JOYSTICK_HANDLE ;
23+ typedef void * TDL_JOYSTICK_HANDLE ;
2424
2525/***********************************************************
2626***********************typedef define***********************
@@ -35,30 +35,28 @@ typedef enum {
3535 TDL_JOYSTICK_BUTTON_LONG_PRESS_HOLD , /* long press hold */
3636 TDL_JOYSTICK_BUTTON_RECOVER_PRESS_UP , /* recover press up */
3737
38- TDL_JOYSTICK_UP , /* joystick up */
39- TDL_JOYSTICK_DOWN , /* joystick down */
40- TDL_JOYSTICK_LEFT , /* joystick left */
41- TDL_JOYSTICK_RIGHT , /* joystick right */
42- TDL_JOYSTICK_LONG_UP , /* joystick long up */
43- TDL_JOYSTICK_LONG_DOWN , /* joystick long down */
44- TDL_JOYSTICK_LONG_LEFT , /* joystick long left */
45- TDL_JOYSTICK_LONG_RIGHT , /* joystick long right */
46- TDL_JOYSTICK_TOUCH_EVENT_MAX , /* joystick touch event max */
47- TDL_JOYSTICK_TOUCH_EVENT_NONE , /* joystick touch event none */
48- } TDL_JOYSTICK_TOUCH_EVENT_E ; /* joystick touch event enum */
38+ TDL_JOYSTICK_UP , /* joystick up */
39+ TDL_JOYSTICK_DOWN , /* joystick down */
40+ TDL_JOYSTICK_LEFT , /* joystick left */
41+ TDL_JOYSTICK_RIGHT , /* joystick right */
42+ TDL_JOYSTICK_LONG_UP , /* joystick long up */
43+ TDL_JOYSTICK_LONG_DOWN , /* joystick long down */
44+ TDL_JOYSTICK_LONG_LEFT , /* joystick long left */
45+ TDL_JOYSTICK_LONG_RIGHT , /* joystick long right */
46+ TDL_JOYSTICK_TOUCH_EVENT_MAX , /* joystick touch event max */
47+ TDL_JOYSTICK_TOUCH_EVENT_NONE , /* joystick touch event none */
48+ } TDL_JOYSTICK_TOUCH_EVENT_E ; /* joystick touch event enum */
4949
5050typedef struct {
51- uint16_t adc_max_val ; /* adc max value */
52- uint16_t adc_min_val ; /* adc min value */
53- uint16_t normalized_range ; /* adc normalized range */
54- uint8_t sensitivity ; /* joystick sensitivity */
55- uint8_t channel_x ; /* adc channel x */
56- uint8_t channel_y ; /* adc channel y */
51+ uint16_t adc_max_val ; /* adc max value */
52+ uint16_t adc_min_val ; /* adc min value */
53+ uint16_t normalized_range ; /* adc normalized range */
54+ uint8_t sensitivity ; /* joystick sensitivity */
5755} TDL_ADC_CFG_T ;
5856
5957typedef struct {
60- TDL_BUTTON_CFG_T button_cfg ; /* joystick button configuration */
61- TDL_ADC_CFG_T adc_cfg ; /* joystick adc configuration */
58+ TDL_BUTTON_CFG_T button_cfg ; /* joystick button configuration */
59+ TDL_ADC_CFG_T adc_cfg ; /* joystick adc configuration */
6260} TDL_JOYSTICK_CFG_T ;
6361
6462/***********************************************************
@@ -107,7 +105,8 @@ OPERATE_RET tdl_joystick_delete_without_hardware(TDL_JOYSTICK_HANDLE handle);
107105 * @param[in] cb The function corresponding to the joystick event
108106 * @return none
109107 */
110- void tdl_joystick_event_register (TDL_JOYSTICK_HANDLE handle , TDL_JOYSTICK_TOUCH_EVENT_E event , TDL_JOYSTICK_EVENT_CB cb );
108+ void tdl_joystick_event_register (TDL_JOYSTICK_HANDLE handle , TDL_JOYSTICK_TOUCH_EVENT_E event ,
109+ TDL_JOYSTICK_EVENT_CB cb );
111110
112111/**
113112 * @brief Turn joystick function off or on
@@ -160,27 +159,23 @@ OPERATE_RET tdl_joystick_set_level(TDL_JOYSTICK_HANDLE handle, TUYA_GPIO_LEVEL_E
160159 */
161160OPERATE_RET tdl_joystick_set_scan_time (uint8_t time_ms );
162161
163- /**
162+ /**
164163 * @brief get joystick raw data
165164 * @param[in] handle joystick handle
166- * @param[in] channel_x x axis adc channel
167- * @param[in] channel_y y axis adc channel
168165 * @param[out] x x axis data
169166 * @param[out] y y axis data
170167 */
171- void tdl_joystick_get_raw_xy (TDL_JOYSTICK_HANDLE handle , int channel_x , int channel_y , int * x , int * y );
168+ OPERATE_RET tdl_joystick_get_raw_xy (TDL_JOYSTICK_HANDLE handle , int * x , int * y );
172169
173170/**
174171 * @brief get joystick normalized data
175172 * @param[in] handle joystick handle
176- * @param[in] channel_x x axis adc channel
177- * @param[in] channel_y y axis adc channel
178173 * @param[out] x x axis data
179174 * @param[out] y y axis data
180- *
175+ *
181176 * @return OPRT_OK if successful
182177 */
183- void tdl_joystick_calibrated_xy (TDL_JOYSTICK_HANDLE handle , int channel_x , int channel_y , int * x , int * y );
178+ OPERATE_RET tdl_joystick_calibrated_xy (TDL_JOYSTICK_HANDLE handle , int * x , int * y );
184179
185180#ifdef __cplusplus
186181}
0 commit comments