![]() |
Synergy Software Package User's Manual
|
RTOS-integrated touch panel V2 Framework implementation touch chips. More...
Data Structures | |
| struct | sf_touch_panel_v2_instance_ctrl_t |
Macros | |
| #define | SF_TOUCH_PANEL_V2_STACK_SIZE (SF_TOUCH_PANEL_V2_CFG_THREAD_STACK_SIZE) |
| #define | SF_TOUCH_PANEL_V2_ERROR_RETURN(a, err) SSP_ERROR_RETURN((a), (err), &g_module_name[0], &g_version) |
| #define | SF_TOUCH_PANEL_V2_OPEN (0x54504e4cU) |
RTOS-integrated touch panel V2 Framework implementation touch chips.
This is a ThreadX touch panel framework implemented for external touch controllers with IRQ pins used to notify the application when new data is available.
| #define SF_TOUCH_PANEL_V2_ERROR_RETURN | ( | a, | |
| err | |||
| ) | SSP_ERROR_RETURN((a), (err), &g_module_name[0], &g_version) |
Macro for error logger.
| #define SF_TOUCH_PANEL_V2_OPEN (0x54504e4cU) |
"TPNL" in ASCII, used to identify touch panel handle
| #define SF_TOUCH_PANEL_V2_STACK_SIZE (SF_TOUCH_PANEL_V2_CFG_THREAD_STACK_SIZE) |
Stack size for touch panel thread.
| ssp_err_t SF_TOUCH_PANEL_V2_Calibrate | ( | sf_touch_panel_v2_ctrl_t *const | p_api_ctrl, |
| sf_touch_panel_v2_calibrate_t const *const | p_display, | ||
| sf_touch_panel_v2_calibrate_t const *const | p_touchscreen, | ||
| ULONG const | timeout | ||
| ) |
Implements sf_touch_panel_v2_api_t::calibrate.
| SSP_SUCCESS | Touch panel calibrated successfully. |
| SSP_ERR_ASSERTION | A pointer parameter was NULL. |
| SSP_ERR_CALIBRATE_FAILED | Failed to calibrate |
| SSP_ERR_NOT_OPEN | Touch panel is not configured. Call SF_TOUCH_PANEL_V2_Open. |
| SSP_ERR_INVALID_ARGUMENT | Set of display or touch screen coordinates passed are invalid. |
Timeout not used in this implementation.
| ssp_err_t SF_TOUCH_PANEL_V2_Close | ( | sf_touch_panel_v2_ctrl_t *const | p_api_ctrl | ) |
Implements sf_touch_panel_v2_api_t::close.
| SSP_SUCCESS | Touch panel instance successfully closed. |
| SSP_ERR_ASSERTION | Parameter p_api_ctrl was NULL, or a lower level driver reported this error. |
| SSP_ERR_NOT_OPEN | Touch panel is not configured. Call SF_TOUCH_PANEL_V2_Open. |
Close the lower level driver.
Suspend internal thread.
Delete RTOS services used
Mark control block close
| ssp_err_t SF_TOUCH_PANEL_V2_Open | ( | sf_touch_panel_v2_ctrl_t *const | p_api_ctrl, |
| sf_touch_panel_v2_cfg_t const *const | p_cfg | ||
| ) |
Implements sf_touch_panel_v2_api_t::open.
| SSP_SUCCESS | Touch panel thread created and lower level drivers opened successfully. |
| SSP_ERR_ASSERTION | A pointer parameter was NULL, or a lower level driver reported this error. |
| SSP_ERR_INTERNAL | The touch panel thread or event flags could not be created, or a lower level driver reported this error. |
| SSP_ERR_ALREADY_OPEN | Touch panel framework is already configured. |
Store user configurations in control block.
Create a mutex to protect access to the control structure and the lower level hardware.
Open the lower level driver.
Delete RTOS services used and log the error
Reset the touch chip.
Delete RTOS services used and log the error
Create event flags for internal communication.
Create semaphore for use with touchDataGet function
Delete RTOS services used
Create main touch panel thread.
Delete RTOS services used
Mark control block open so other tasks know it is valid
| ssp_err_t SF_TOUCH_PANEL_V2_Reset | ( | sf_touch_panel_v2_ctrl_t *const | p_api_ctrl | ) |
Implements sf_touch_panel_v2_api_t::reset.
| SSP_SUCCESS | Touch chip reset successful. |
| SSP_ERR_ASSERTION | Parameter p_api_ctrl was NULL, or a lower level driver reported this error. |
| SSP_ERR_IN_USE | Mutex was not available, or a lower level driver reported this error. |
| SSP_ERR_NOT_OPEN | Touch panel is not configured. Use Open API to configure. |
Obtain mutex since this accesses shared resources.
Call hardware specific reset function.
Release mutex.
| ssp_err_t SF_TOUCH_PANEL_V2_Start | ( | sf_touch_panel_v2_ctrl_t *const | p_api_ctrl | ) |
Implements sf_touch_panel_v2_api_t::start.
| SSP_SUCCESS | Enabled touch panel thread to scan for new touch events. |
| SSP_ERR_ASSERTION | A pointer parameter was NULL. |
| SSP_ERR_NOT_OPEN | Touch panel is not configured. Call SF_TOUCH_PANEL_V2_Open. |
Set start flag.
| ssp_err_t SF_TOUCH_PANEL_V2_Stop | ( | sf_touch_panel_v2_ctrl_t *const | p_api_ctrl | ) |
Implements sf_touch_panel_v2_api_t::stop.
| SSP_SUCCESS | Disabled touch panel thread from scanning the touch events. |
| SSP_ERR_ASSERTION | A pointer parameter was NULL. |
| SSP_ERR_NOT_OPEN | Touch panel is not configured. Call SF_TOUCH_PANEL_V2_Open. |
Set stop flag.
| ssp_err_t SF_TOUCH_PANEL_V2_TouchDataGet | ( | sf_touch_panel_v2_ctrl_t *const | p_api_ctrl, |
| sf_touch_panel_v2_payload_t * | p_payload, | ||
| ULONG const | timeout | ||
| ) |
Implements sf_touch_panel_v2_api_t::touchDataGet.
| SSP_SUCCESS | Touch panel data read successfully. |
| SSP_ERR_ASSERTION | A pointer parameter was NULL. |
| SSP_ERR_NOT_OPEN | Touch panel is not configured. Call SF_TOUCH_PANEL_V2_Open. |
| SSP_ERR_TIMEOUT | Time out occurs while waiting for semaphore. |
| SSP_ERR_WAIT_ABORTED | Suspension was aborted by another thread. |
| ssp_err_t SF_TOUCH_PANEL_V2_VersionGet | ( | ssp_version_t *const | p_version | ) |
Implements sf_touch_panel_v2_api_t::versionGet.
| SSP_SUCCESS | Version returned successfully. |
| SSP_ERR_ASSERTION | Parameter p_version was null. |