RA Flexible Software Package Documentation
Release v5.6.0
|
|
Interface for key matrix functions.
The KEYMATRIX interface provides standard Key Matrix functionality including event generation on a rising or falling edge for one or more channels at the same time. The generated event indicates all channels that are active in that instant via a bit mask. This allows the interface to be used with a matrix configuration or a one-to-one hardware implementation that is triggered on either a rising or a falling edge.
Data Structures | |
struct | keymatrix_callback_args_t |
struct | keymatrix_cfg_t |
struct | keymatrix_api_t |
struct | keymatrix_instance_t |
Typedefs | |
typedef void | keymatrix_ctrl_t |
Enumerations | |
enum | keymatrix_trigger_t |
struct keymatrix_callback_args_t |
Callback function parameter data
Data Fields | ||
---|---|---|
void const * | p_context | Holder for user data. Set in keymatrix_api_t::open function in keymatrix_cfg_t. |
uint32_t | channel_mask |
Bit vector representing the physical hardware channel(s) that caused the interrupt. |
struct keymatrix_cfg_t |
User configuration structure, used in open function
Data Fields | |
uint32_t | channel_mask |
Key Input channel(s). Bit mask of channels to open. | |
keymatrix_trigger_t | trigger |
Key Input trigger setting. | |
uint8_t | ipl |
Interrupt priority level. | |
IRQn_Type | irq |
NVIC IRQ number. | |
void(* | p_callback )(keymatrix_callback_args_t *p_args) |
Callback for key interrupt ISR. | |
void const * | p_context |
Holder for user data. Passed to callback in keymatrix_user_cb_data_t. | |
void const * | p_extend |
Extension parameter for hardware specific settings. | |
struct keymatrix_api_t |
Key Matrix driver structure. Key Matrix functions implemented at the HAL layer will use this API.
Data Fields | |
fsp_err_t(* | open )(keymatrix_ctrl_t *const p_ctrl, keymatrix_cfg_t const *const p_cfg) |
fsp_err_t(* | enable )(keymatrix_ctrl_t *const p_ctrl) |
fsp_err_t(* | disable )(keymatrix_ctrl_t *const p_ctrl) |
fsp_err_t(* | close )(keymatrix_ctrl_t *const p_ctrl) |
fsp_err_t(* keymatrix_api_t::open) (keymatrix_ctrl_t *const p_ctrl, keymatrix_cfg_t const *const p_cfg) |
Initial configuration.
[out] | p_ctrl | Pointer to control block. Must be declared by user. Value set in this function. |
[in] | p_cfg | Pointer to configuration structure. All elements of the structure must be set by user. |
fsp_err_t(* keymatrix_api_t::enable) (keymatrix_ctrl_t *const p_ctrl) |
Enable Key interrupt
[in] | p_ctrl | Control block pointer set in Open call for this Key interrupt. |
fsp_err_t(* keymatrix_api_t::disable) (keymatrix_ctrl_t *const p_ctrl) |
Disable Key interrupt.
[in] | p_ctrl | Control block pointer set in Open call for this Key interrupt. |
fsp_err_t(* keymatrix_api_t::close) (keymatrix_ctrl_t *const p_ctrl) |
Allow driver to be reconfigured. May reduce power consumption.
[in] | p_ctrl | Control block pointer set in Open call for this Key interrupt. |
struct keymatrix_instance_t |
This structure encompasses everything that is needed to use an instance of this interface.
Data Fields | ||
---|---|---|
keymatrix_ctrl_t * | p_ctrl | Pointer to the control structure for this instance. |
keymatrix_cfg_t const * | p_cfg | Pointer to the configuration structure for this instance. |
keymatrix_api_t const * | p_api | Pointer to the API structure for this instance. |
typedef void keymatrix_ctrl_t |
Key matrix control block. Allocate an instance specific control block to pass into the key matrix API calls.
enum keymatrix_trigger_t |