RA Flexible Software Package Documentation  Release v5.6.0

 
Touch Middleware Interface

Detailed Description

Interface for Touch Middleware functions.

Summary

The TOUCH interface provides TOUCH functionality.

Data Structures

struct  touch_button_cfg_t
 
struct  touch_slider_cfg_t
 
struct  touch_wheel_cfg_t
 
struct  touch_pad_cfg_t
 
struct  touch_cfg_t
 
struct  touch_sensitivity_info_t
 
struct  touch_api_t
 
struct  touch_instance_t
 

Macros

#define TOUCH_COUNT_MAX
 Value of Maximum count.
 
#define TOUCH_OFF_VALUE
 Value of Non-touch.
 

Typedefs

typedef void touch_ctrl_t
 
typedef struct st_ctsu_callback_args touch_callback_args_t
 

Data Structure Documentation

◆ touch_button_cfg_t

struct touch_button_cfg_t

Configuration of each button

Data Fields
uint8_t elem_index Element number used by this button.
uint16_t threshold Touch/non-touch judgment threshold.
uint16_t hysteresis Threshold hysteresis for chattering prevention.

◆ touch_slider_cfg_t

struct touch_slider_cfg_t

Configuration of each slider

Data Fields
uint8_t const * p_elem_index Element number array used by this slider.
uint8_t num_elements Number of elements used by this slider.
uint16_t threshold Position calculation start threshold value.

◆ touch_wheel_cfg_t

struct touch_wheel_cfg_t

Configuration of each wheel

Data Fields
uint8_t const * p_elem_index Element number array used by this wheel.
uint8_t num_elements Number of elements used by this wheel.
uint16_t threshold Position calculation start threshold value.

◆ touch_pad_cfg_t

struct touch_pad_cfg_t

Configuration of each pads

Data Fields
uint8_t const * p_elem_index_rx RX of element number arrays used by this pad.
uint8_t const * p_elem_index_tx TX of element number arrays used by this pad.
uint8_t num_elements Number of elements used by this pad.
uint16_t threshold Coordinate calculation threshold value.
uint16_t rx_pixel rx coordinate resolution
uint16_t tx_pixel tx coordinate resolution
uint8_t max_touch Maximum number of touch judgments used by the pad.
uint8_t num_drift Number of pad drift.

◆ touch_cfg_t

struct touch_cfg_t

User configuration structure, used in open function

Data Fields
touch_button_cfg_t const * p_buttons Pointer to array of button configuration.
touch_slider_cfg_t const * p_sliders Pointer to array of slider configuration.
touch_wheel_cfg_t const * p_wheels Pointer to array of wheel configuration.
touch_pad_cfg_t const * p_pad Pointer of pad configuration.
uint8_t num_buttons Number of buttons.
uint8_t num_sliders Number of sliders.
uint8_t num_wheels Number of wheels.
uint8_t on_freq The cumulative number of determinations of ON.
uint8_t off_freq The cumulative number of determinations of OFF.
uint16_t drift_freq Base value drift frequency. [0 : no use].
uint16_t cancel_freq Maximum continuous ON. [0 : no use].
uint8_t number Configuration number for QE monitor.
ctsu_instance_t const * p_ctsu_instance Pointer to CTSU instance.
uart_instance_t const * p_uart_instance Pointer to UART instance.
void const * p_context User defined context passed into callback function.
void const * p_extend Pointer to extended configuration by instance of interface.

◆ touch_sensitivity_info_t

struct touch_sensitivity_info_t

Configuration of each touch sensitivity information

Data Fields
uint16_t * p_touch_sensitivity_ratio Pointer to sensitivity ratio array.
uint16_t old_threshold_ratio Old threshold ratio.
uint16_t new_threshold_ratio New threshold ratio.
uint8_t new_hysteresis_ratio New hysteresis ratio.

◆ touch_api_t

struct touch_api_t

Functions implemented at the HAL layer will follow this API.

Data Fields

fsp_err_t(* open )(touch_ctrl_t *const p_ctrl, touch_cfg_t const *const p_cfg)
 
fsp_err_t(* scanStart )(touch_ctrl_t *const p_ctrl)
 
fsp_err_t(* dataGet )(touch_ctrl_t *const p_ctrl, uint64_t *p_button_status, uint16_t *p_slider_position, uint16_t *p_wheel_position)
 
fsp_err_t(* scanStop )(ctsu_ctrl_t *const p_ctrl)
 
fsp_err_t(* padDataGet )(touch_ctrl_t *const p_ctrl, uint16_t *p_pad_rx_coordinate, uint16_t *p_pad_tx_coordinate, uint8_t *p_pad_num_touch)
 
fsp_err_t(* callbackSet )(touch_ctrl_t *const p_ctrl, void(*p_callback)(touch_callback_args_t *), void const *const p_context, touch_callback_args_t *const p_callback_memory)
 
fsp_err_t(* close )(touch_ctrl_t *const p_ctrl)
 
fsp_err_t(* sensitivityRatioGet )(touch_ctrl_t *const p_ctrl, touch_sensitivity_info_t *p_touch_sensitivity_info)
 
fsp_err_t(* thresholdAdjust )(touch_ctrl_t *const p_ctrl, touch_sensitivity_info_t *p_touch_sensitivity_info)
 
fsp_err_t(* driftControl )(touch_ctrl_t *const p_ctrl, uint16_t input_drift_freq)
 

Field Documentation

◆ open

fsp_err_t(* touch_api_t::open) (touch_ctrl_t *const p_ctrl, touch_cfg_t const *const p_cfg)

Open driver.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_cfgPointer to pin configuration structure.

◆ scanStart

fsp_err_t(* touch_api_t::scanStart) (touch_ctrl_t *const p_ctrl)

Scan start.

Parameters
[in]p_ctrlPointer to control structure.

◆ dataGet

fsp_err_t(* touch_api_t::dataGet) (touch_ctrl_t *const p_ctrl, uint64_t *p_button_status, uint16_t *p_slider_position, uint16_t *p_wheel_position)

Data get.

Parameters
[in]p_ctrlPointer to control structure.
[out]p_button_statusPointer to get data bitmap.
[out]p_slider_positionPointer to get data array.
[out]p_wheel_positionPointer to get data array.

◆ scanStop

fsp_err_t(* touch_api_t::scanStop) (ctsu_ctrl_t *const p_ctrl)

ScanStop.

Parameters
[in]p_ctrlPointer to control structure.

◆ padDataGet

fsp_err_t(* touch_api_t::padDataGet) (touch_ctrl_t *const p_ctrl, uint16_t *p_pad_rx_coordinate, uint16_t *p_pad_tx_coordinate, uint8_t *p_pad_num_touch)

pad data get.

Parameters
[in]p_ctrlPointer to control structure.
[out]p_pad_rx_coordinatePointer to get coordinate of receiver side.
[out]p_pad_tx_coordinatePointer to get coordinate of transmitter side.
[out]p_pad_num_touchPointer to get touch count.

◆ callbackSet

fsp_err_t(* touch_api_t::callbackSet) (touch_ctrl_t *const p_ctrl, void(*p_callback)(touch_callback_args_t *), void const *const p_context, touch_callback_args_t *const p_callback_memory)

Specify callback function and optional context pointer and working memory pointer.

Parameters
[in]p_ctrlPointer to the CTSU control block.
[in]p_callbackCallback function
[in]p_contextPointer to send to callback function
[in]p_working_memoryPointer to volatile memory where callback structure can be allocated. Callback arguments allocated here are only valid during the callback.

◆ close

fsp_err_t(* touch_api_t::close) (touch_ctrl_t *const p_ctrl)

Close driver.

Parameters
[in]p_ctrlPointer to control structure.

◆ sensitivityRatioGet

fsp_err_t(* touch_api_t::sensitivityRatioGet) (touch_ctrl_t *const p_ctrl, touch_sensitivity_info_t *p_touch_sensitivity_info)

Sensitivity ratio get.

Parameters
[in]p_ctrlPointer to control structure.
[in,out]p_touch_sensitivity_infoPointer to touch sensitivity structure.

◆ thresholdAdjust

fsp_err_t(* touch_api_t::thresholdAdjust) (touch_ctrl_t *const p_ctrl, touch_sensitivity_info_t *p_touch_sensitivity_info)

Threshold adjust.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_touch_sensitivity_infoPointer to touch sensitivity structure.

◆ driftControl

fsp_err_t(* touch_api_t::driftControl) (touch_ctrl_t *const p_ctrl, uint16_t input_drift_freq)

Drift control.

Parameters
[in]p_ctrlPointer to control structure.
[in]input_drift_freqDrift frequency value.

◆ touch_instance_t

struct touch_instance_t

This structure encompasses everything that is needed to use an instance of this interface.

Data Fields
touch_ctrl_t * p_ctrl Pointer to the control structure for this instance.
touch_cfg_t const * p_cfg Pointer to the configuration structure for this instance.
touch_api_t const * p_api Pointer to the API structure for this instance.

Typedef Documentation

◆ touch_ctrl_t

typedef void touch_ctrl_t

Control block. Allocate an instance specific control block to pass into the API calls.

◆ touch_callback_args_t

typedef struct st_ctsu_callback_args touch_callback_args_t

Callback function parameter data