Added new function to the touch panel API to put it in sleep or standby, WIP and not working yet
This commit is contained in:
parent
c574644d3a
commit
7148e76115
@ -1,4 +1,7 @@
|
||||
#include "i2c.h"
|
||||
#include "wm_gpio.h"
|
||||
#include "FreeRTOS.h"
|
||||
#include "app_log.h"
|
||||
#include "CST816D.h"
|
||||
|
||||
bool CST816D_read_touch_event(CST816D_Touch_Data_t * const touch_data)
|
||||
@ -22,3 +25,20 @@ bool CST816D_read_touch_event(CST816D_Touch_Data_t * const touch_data)
|
||||
touch_data->isValid = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CST816D_set_power_mode(void)
|
||||
{
|
||||
tls_gpio_cfg(WM_IO_PA_00, WM_GPIO_DIR_OUTPUT, WM_GPIO_ATTR_FLOATING);
|
||||
|
||||
tls_gpio_write(WM_IO_PA_00, 0);
|
||||
tls_os_time_delay(pdMS_TO_TICKS(5));
|
||||
tls_gpio_write(WM_IO_PA_00, 1);
|
||||
tls_os_time_delay(pdMS_TO_TICKS(50));
|
||||
|
||||
uint8_t data;
|
||||
|
||||
i2c_read_reg(CST816D_I2C_ADDR, 0xA5, &data);
|
||||
|
||||
i2c_write_reg(CST816D_I2C_ADDR, 0xA5, 0x03);
|
||||
APP_LOG_DEBUG("CST 0xA5 : %u", data);
|
||||
}
|
||||
|
@ -56,4 +56,6 @@ typedef struct CST816D_Touch_Data
|
||||
*/
|
||||
bool CST816D_read_touch_event(CST816D_Touch_Data_t * const touch_data);
|
||||
|
||||
bool CST816D_set_power_mode(void);
|
||||
|
||||
#endif //CST816D_H
|
Loading…
Reference in New Issue
Block a user