![]() |
Synergy Software Package User's Manual
|
Driver for the Key Interrupt Function. More...
Data Structures | |
| struct | kint_instance_ctrl_t |
Functions | |
| ssp_err_t | R_KINT_KEYMATRIX_Open (keymatrix_ctrl_t *const p_api_ctrl, keymatrix_cfg_t const *const p_cfg) |
| Power on KINT, handle required initialization described in hardware manual. Implements keymatrix_api_t::open. More... | |
| ssp_err_t | R_KINT_KEYMATRIX_Close (keymatrix_ctrl_t *const p_api_ctrl) |
| Disable KINT. Implements keymatrix_api_t::close. More... | |
| ssp_err_t | R_KINT_KEYMATRIX_Enable (keymatrix_ctrl_t *const p_api_ctrl) |
| Enable external irq for all the specified channel by R_KINT_KEYMATRIX_Open. Implements keymatrix_api_t::enable. More... | |
| ssp_err_t | R_KINT_KEYMATRIX_Disable (keymatrix_ctrl_t *const p_api_ctrl) |
| Disable external irq for all the specified channel by R_KINT_KEYMATRIX_Open. Implements keymatrix_api_t::disable. More... | |
| ssp_err_t | R_KINT_KEYMATRIX_TriggerSet (keymatrix_ctrl_t *const p_api_ctrl, keymatrix_trigger_t hw_trigger) |
| Set trigger edge (falling or rising) provided. Implements keymatrix_api_t::triggerSet. More... | |
| ssp_err_t | R_KINT_VersionGet (ssp_version_t *const p_version) |
| Set driver version based on compile time macros. More... | |
Driver for the Key Interrupt Function.
The Key input driver can be used for one to eight channels or in a matrix format. This module implements the following interface: Key Matrix Interface.
| ssp_err_t R_KINT_KEYMATRIX_Close | ( | keymatrix_ctrl_t *const | p_api_ctrl | ) |
Disable KINT. Implements keymatrix_api_t::close.
End of function R_KINT_KEYMATRIX_Open The Close function disables the interrupts in the peripheral and the NVIC and clears any pending interrupt requests. It also releases the hardware lock on the API.
| SSP_SUCCESS | Successful close. |
| SSP_ERR_ASSERTION | The parameter p_ctrl is NULL. |
| SSP_ERR_NOT_OPEN | The channel is not opened. |
Disable interrupt in ICU
Disable interrupts in the KINT peripheral
Clear any pending interrupt requests in the KINT peripheral
Clear the Interrupt Request bit
Clear stored internal driver data
Release the lock
| ssp_err_t R_KINT_KEYMATRIX_Disable | ( | keymatrix_ctrl_t *const | p_api_ctrl | ) |
Disable external irq for all the specified channel by R_KINT_KEYMATRIX_Open. Implements keymatrix_api_t::disable.
This function disables interrupts for the KINT peripheral both at the interrupt level and in the NVIC. All the channels specified by R_KINT_KEYMATRIX_Open are disabled.
| SSP_SUCCESS | Interrupt disabled successfully. |
| SSP_ERR_ASSERTION | The p_ctrl parameter was null. |
| SSP_ERR_NOT_OPEN | The channel is not opened. |
Disable interrupts in the KINT peripheral
Clear any pending interrupt requests in the KINT peripheral
Disable interrupt in the ICU
| ssp_err_t R_KINT_KEYMATRIX_Enable | ( | keymatrix_ctrl_t *const | p_api_ctrl | ) |
Enable external irq for all the specified channel by R_KINT_KEYMATRIX_Open. Implements keymatrix_api_t::enable.
This function enables interrupts for the KINT peripheral both at the interrupt level and in the NVIC after clearing any pending requests in the KINT and ICU peripheral. All the channels specified by R_KINT_KEYMATRIX_Open are enabled.
| SSP_SUCCESS | Interrupt enabled successfully. |
| SSP_ERR_ASSERTION | The p_ctrl parameter was null. |
| SSP_ERR_NOT_OPEN | The peripheral is not opened. |
Clear any pending interrupt requests in the KINT peripheral
Clear the Interrupt Request Flag in the ICU
Enable interrupt for the selected channels after casting since KRM is an 8 bit register
Enable interrupt
| ssp_err_t R_KINT_KEYMATRIX_Open | ( | keymatrix_ctrl_t *const | p_api_ctrl, |
| keymatrix_cfg_t const *const | p_cfg | ||
| ) |
Power on KINT, handle required initialization described in hardware manual. Implements keymatrix_api_t::open.
The Open function configures all the Key Input (KINT) channels and provides a handle for use with the rest of the KINT API functions. This function must be called at least once prior to calling any other KINT API functions. After the peripheral is initialized, the Open function should not be called again without first calling the Close function.
| SSP_SUCCESS | Initialization was successful. |
| SSP_ERR_ASSERTION | One of the following parameters may be NULL: p_cfg, or p_ctrl or the callback. |
| SSP_ERR_INVALID_ARGUMENT | One of the following may be invalid:
|
| SSP_ERR_HW_LOCKED | The API has already been opened. It must be closed before it can be opened again. |
Check to see that the arguments passed are not null pointers
Grab the hardware lock. If successful this indicates that the open was not previously called.
Disable interrupts in the KINT peripheral
Clear any pending interrupt requests in the KINT peripheral
Clear the Interrupt Request in the ICU
Configure the trigger edge. The trigger edge can be modified in the TriggerSet function later if desired
KEYMATRIX_TRIG_RISING condition
Configure the usage of key interrupt flags
Store the callback and context information
If interrupts are to be enabled now, set it up for the selected channels. The channels can be changed later in the enable function but to modify the callback and context, the API has to be closed and reopened with the new callback and context.
Enable interrupt for the selected channels after casting since KRM is an 8 bit register
Enable interrupt
Store number of channels for use to the control block to use it later
Mark driver as open by initializing it to "KINT" in its ASCII equivalent.
| ssp_err_t R_KINT_KEYMATRIX_TriggerSet | ( | keymatrix_ctrl_t *const | p_api_ctrl, |
| keymatrix_trigger_t | hw_trigger | ||
| ) |
Set trigger edge (falling or rising) provided. Implements keymatrix_api_t::triggerSet.
This function changes trigger sense at run-time. The change is applied to all the channels specified by R_KINT_KEYMATRIX_Open.
| SSP_SUCCESS | Trigger value written successfully. |
| SSP_ERR_ASSERTION | The p_ctrl parameter was null. |
| SSP_ERR_INVALID_ARGUMENT | Trigger input invalid. hw_trigger must be one of the options from button_trigger_t. |
| SSP_ERR_NOT_OPEN | The channel is not opened. |
Configure the trigger edge
KEYMATRIX_TRIG_RISING condition
Configure the usage of key interrupt flags
| ssp_err_t R_KINT_VersionGet | ( | ssp_version_t *const | p_version | ) |
Set driver version based on compile time macros.
| SSP_SUCCESS | Successful return. |
| SSP_ERR_ASSERTION | The parameter p_version is NULL. |