![]() |
mikroSDK Reference Manual
|
Touch Panel library API reference. More...
Functions list | |
| void | tp_cfg_setup (tp_cfg_t *cfg) |
| Touch Panel Configuration Function. More... | |
| tp_err_t | tp_init (tp_t *ctx, tp_cfg_t *cfg, tp_drv_t *drv, void *drv_ctx) |
| Touch Panel Initialization Function. More... | |
| void | tp_press_callback_setup (tp_t *ctx, tp_press_callback_t cb) |
| Touch Panel Callback Setup Function. More... | |
| void | tp_gesture_callback_setup (tp_t *ctx, tp_gesture_callback_t cb) |
| Touch Panel Callback Setup Function. More... | |
| void | tp_rotate (tp_t *ctx, tp_rotate_t rotate) |
| Touch Panel Rotate Function. More... | |
| tp_rotate_t | tp_get_orientation (tp_t *ctx) |
| Touch Panel Orientation Check Function. More... | |
| void | tp_get_size (tp_t *ctx, uint16_t *width, uint16_t *height) |
| Touch Panel Size Check Function. More... | |
| tp_event_t | tp_press_detect (tp_t *ctx) |
| Touch Panel Pressure Detector Function. More... | |
| tp_err_t | tp_press_coordinates (tp_t *ctx, tp_touch_item_t *touch_item) |
| Touch Panel Pressure Coordinates Check Function. More... | |
| void | tp_gesture (tp_t *ctx, tp_event_t *event) |
| Touch Panel Gesture Check Function. More... | |
| tp_err_t | tp_process (tp_t *ctx) |
| Touch Panel Process Function. More... | |
API for configuring and manipulating Touch Panel library.
| void tp_cfg_setup | ( | tp_cfg_t * | cfg | ) |
Configures Touch Panel configuration structure to default initialization values.
| [out] | cfg | : Touch Panel configuration object. See tp_cfg_t structure definition for detailed explanation. |
Example
This function initializes Touch Panel context object to default initialization values and executes a linking procedure between Touch Panel API and touch controller driver.
| [out] | ctx | : Touch Panel context object. See tp_t structure definition for detailed explanation. |
| [in] | cfg | : Touch Panel configuration object. See tp_cfg_t structure definition for detailed explanation. |
| [in] | drv | : Touch Panel driver interface object. See tp_drv_t structure definition for detailed explanation. |
| [in] | drv_ctx | : Touch Panel driver context object. See ft5xx6_t structure definition for detailed explanation. |
0 - OK, 3 - Size error.Example
| void tp_press_callback_setup | ( | tp_t * | ctx, |
| tp_press_callback_t | cb | ||
| ) |
This function sets callback handler for touch pressure detection.
| [out] | ctx | : Touch Panel context object. See tp_t structure definition for detailed explanation. |
| [in] | cb | : Callback function (handler). See tp_press_callback_t structure definition for detailed explanation. |
Example
| void tp_gesture_callback_setup | ( | tp_t * | ctx, |
| tp_gesture_callback_t | cb | ||
| ) |
This function sets callback handler for gesture event.
| [out] | ctx | : Touch Panel context object. See tp_t structure definition for detailed explanation. |
| [in] | cb | : Callback function (handler). See tp_gesture_callback_t structure definition for detailed explanation. |
Example
| void tp_rotate | ( | tp_t * | ctx, |
| tp_rotate_t | rotate | ||
| ) |
This function sets the Touch Panel orientation.
| [out] | ctx | : Touch Panel context object. See tp_t structure definition for detailed explanation. |
| [in] | rotate | : Selects the orientation angle. See tp_rotate_t for valid values. |
Example
| tp_rotate_t tp_get_orientation | ( | tp_t * | ctx | ) |
This function checks the Touch Panel orientation state.
| [in] | ctx | : Touch Panel context object. See tp_t structure definition for detailed explanation. |
Example
| void tp_get_size | ( | tp_t * | ctx, |
| uint16_t * | width, | ||
| uint16_t * | height | ||
| ) |
This function checks the Touch Panel size.
| [in] | ctx | : Touch Panel context object. See tp_t structure definition for detailed explanation. |
| [out] | width | : Touch Panel width size. |
| [out] | height | : Touch Panel height size. |
Example
| tp_event_t tp_press_detect | ( | tp_t * | ctx | ) |
This function checks the touch pressure detection.
| [in] | ctx | : Touch Panel context object. See tp_t structure definition for detailed explanation. |
3 - Touch is not detected, 4 - Touch is detected. See tp_event_t structure definition for detailed explanation. Example
| tp_err_t tp_press_coordinates | ( | tp_t * | ctx, |
| tp_touch_item_t * | touch_item | ||
| ) |
This function allows user to get the informations about the number of pressed touch points, coordinates and touch event for each pressed touch point.
| [in] | ctx | : Touch Panel context object. See tp_t structure definition for detailed explanation. |
| [out] | touch_item | : Touch item data. See tp_touch_item_t structure definition for detailed explanation. |
0 - OK, 4 - Touch coordinates are out of range. See tp_err_t structure definition for detailed explanation. Example
| void tp_gesture | ( | tp_t * | ctx, |
| tp_event_t * | event | ||
| ) |
This function allows user to get the informations about the gesture (slide direction).
| [in] | ctx | : Touch Panel context object. See tp_t structure definition for detailed explanation. |
| [out] | event | : Touch Panel gesture event. See tp_event_t structure definition for detailed explanation. |
Example
This function detects a touch pressure, and if any touch pressure was detected, then collects all data information and events about the pressed touch and slide direction (gesture), and calls a callback handlers, if they are set.
| [in] | ctx | : Touch Panel context object. See tp_t structure definition for detailed explanation. |
0 - OK, 4 - Touch coordinates are out of range, 5 - Number of pressed touches is out of range. See tp_err_t structure definition for detailed explanation. Example