Functions | |
cy_en_ks_status_t | Cy_Keyscan_Register_Callback (cy_cb_keyscan_handle_events_t cbEvents, cy_stc_keyscan_context_t *context) |
Registers for callback Application has to register for callback for receiving the key press events. More... | |
cy_en_ks_status_t | Cy_Keyscan_Init (MXKEYSCAN_Type *base, const cy_stc_ks_config_t *config, cy_stc_keyscan_context_t *context) |
Register Context with the driver This Function registers for the event callback and FW FIFO buffer. More... | |
cy_en_ks_status_t | Cy_Keyscan_DeInit (MXKEYSCAN_Type *base, cy_stc_keyscan_context_t *context) |
Deinit Keyscan. More... | |
cy_en_ks_status_t | Cy_Keyscan_Enable (MXKEYSCAN_Type *base, cy_stc_keyscan_context_t *context) |
Enable Keyscan. More... | |
cy_en_ks_status_t | Cy_Keyscan_Disable (MXKEYSCAN_Type *base, cy_stc_keyscan_context_t *context) |
Disable keyscan Reset's the Keyscan hardware and disables the keyscan hardware. More... | |
cy_en_ks_status_t | Cy_Keyscan_EventsPending (MXKEYSCAN_Type *base, bool *eventsPending, cy_stc_keyscan_context_t *context) |
Events pending Return whether any events are in the FW FIFO or not. More... | |
cy_en_ks_status_t | Cy_Keyscan_GetNextEvent (MXKEYSCAN_Type *base, cy_stc_key_event *event, cy_stc_keyscan_context_t *context) |
Get next event from FW FIFO. More... | |
cy_en_ks_status_t | Cy_Keyscan_SetInterruptMask (MXKEYSCAN_Type *base, uint32_t mask) |
Setup interrupt source to be accepted. More... | |
cy_en_ks_status_t | Cy_Keyscan_GetInterruptMask (MXKEYSCAN_Type *base, uint32_t *mask) |
Return interrupt mask setting. More... | |
cy_en_ks_status_t | Cy_Keyscan_GetInterruptMaskedStatus (MXKEYSCAN_Type *base, uint32_t *status) |
Return interrupt masked status. More... | |
cy_en_ks_status_t | Cy_Keyscan_GetInterruptStatus (MXKEYSCAN_Type *base, uint32_t *status) |
Return interrupt raw status. More... | |
cy_en_ks_status_t | Cy_Keyscan_ClearInterrupt (MXKEYSCAN_Type *base, uint32_t mask) |
Clear interrupt status. More... | |
cy_en_ks_status_t | Cy_Keyscan_Interrupt_Handler (MXKEYSCAN_Type *base, cy_stc_keyscan_context_t *context) |
Handler for keyscan interrupts. More... | |
cy_en_ks_status_t | Cy_Keyscan_FlushEvents (MXKEYSCAN_Type *base, cy_stc_keyscan_context_t *context) |
Flush events from HW FIFO. More... | |
cy_en_ks_status_t | Cy_Keyscan_EnableGhostDetection (MXKEYSCAN_Type *base) |
Enables Ghost detection. More... | |
cy_en_ks_status_t | Cy_Keyscan_DisableGhostDetection (MXKEYSCAN_Type *base) |
Disables Ghost detection. More... | |
cy_en_ks_status_t | Cy_Keyscan_EnableClockStayOn (MXKEYSCAN_Type *base) |
Enables Clock Stay On Clock to the IP is always enabled. More... | |
cy_en_ks_status_t | Cy_Keyscan_DisableClockStayOn (MXKEYSCAN_Type *base) |
Disables Clock Stay On When there is no activity detected the clock to the Keyscan is gated off. More... | |
cy_en_ks_status_t Cy_Keyscan_Register_Callback | ( | cy_cb_keyscan_handle_events_t | cbEvents, |
cy_stc_keyscan_context_t * | context | ||
) |
Registers for callback Application has to register for callback for receiving the key press events.
In the interrupt handler data from HW FIFO is copied to FW FIFO and application is notified to get the data using this callback function.
[in] | cbEvents | Pointer to the callback function. |
[in] | context | Pointer to the context. |
Refer | cy_en_ks_status_t |
[in] cbEvents Pointer to the callback function.
[in] context Pointer to the context.
cy_en_ks_status_t Cy_Keyscan_Init | ( | MXKEYSCAN_Type * | base, |
const cy_stc_ks_config_t * | config, | ||
cy_stc_keyscan_context_t * | context | ||
) |
Register Context with the driver This Function registers for the event callback and FW FIFO buffer.
[in] | base | Pointer to KeyScan instance register area |
[in] | config | KeyScan module configuration. See cy_stc_ks_config_t. |
[in] | context | Pointer to the context. |
Refer | cy_en_ks_status_t |
[in] base Pointer to KeyScan instance register area [in] config KeyScan module configuration. See cy_stc_ks_config_t. [out] context Pointer to the context.
cy_en_ks_status_t Cy_Keyscan_DeInit | ( | MXKEYSCAN_Type * | base, |
cy_stc_keyscan_context_t * | context | ||
) |
Deinit Keyscan.
Deinits the Keyscan HW Clear FW FIFO after a HW reset. Restores the control data and enables scans if they were enabled before this function was called.
base | [in] Pointer to Keyscan instance register area. |
context | [in] Pointer to the context. |
Refer | cy_en_ks_status_t |
base [in] Pointer to KEYSCAN instance register area.
cy_en_ks_status_t Cy_Keyscan_Enable | ( | MXKEYSCAN_Type * | base, |
cy_stc_keyscan_context_t * | context | ||
) |
Enable Keyscan.
Enables the keyscan hardware.
base | [in] Pointer to KeyScan instance register area. |
context | [in] Pointer to the context. |
Refer | cy_en_ks_status_t |
cy_en_ks_status_t Cy_Keyscan_Disable | ( | MXKEYSCAN_Type * | base, |
cy_stc_keyscan_context_t * | context | ||
) |
Disable keyscan Reset's the Keyscan hardware and disables the keyscan hardware.
When disabled, clock to the keyscan IP is gated.
base | [in] Pointer to KeyScan instance register area. |
context | [in] Pointer to the context. |
Refer | cy_en_ks_status_t |
base [in] Pointer to KeyScan instance register area. context [in] Pointer to the context.
cy_en_ks_status_t Cy_Keyscan_EventsPending | ( | MXKEYSCAN_Type * | base, |
bool * | eventsPending, | ||
cy_stc_keyscan_context_t * | context | ||
) |
Events pending Return whether any events are in the FW FIFO or not.
base | [in] Pointer to KeyScan instance register area. |
context | [in] Pointer to the context. |
eventsPending | [out] Pointer to the eventsPending, True if events pending and otherwise False. |
Refer | cy_en_ks_status_t |
base [in] Pointer to KeyScan instance register area. context [in] Pointer to the context. eventsPending [out] Pointer to the eventsPending.
cy_en_ks_status_t Cy_Keyscan_GetNextEvent | ( | MXKEYSCAN_Type * | base, |
cy_stc_key_event * | event, | ||
cy_stc_keyscan_context_t * | context | ||
) |
Get next event from FW FIFO.
Applications have to call Cy_Keyscan_Interrupt_Handler from keyscan interrupt handler. After successfully reading from HW FIFO and writing to FW FIFO applications will be notified through the registered callback. Applications to read from the FW FIFO has to call this function in a loop till the return value is CY_KEYSCAN_EVENT_NONE
base | [in] Pointer to KeyScan instance register area. |
context | [in] Pointer to the context. |
event | [out] Pointer to the next event. |
Refer | cy_en_ks_status_t |
base [in] Pointer to KeyScan instance register area. context [in] Pointer to the context. event [out] Pointer to the next event.
cy_en_ks_status_t Cy_Keyscan_SetInterruptMask | ( | MXKEYSCAN_Type * | base, |
uint32_t | mask | ||
) |
Setup interrupt source to be accepted.
base | [in] Pointer to KeyScan instance register area. |
mask | [in] The mask with the OR of the interrupt source to be accepted. See KeyScan ALL interrupt mask definition for the set of constants. |
Refer | cy_en_ks_status_t |
cy_en_ks_status_t Cy_Keyscan_GetInterruptMask | ( | MXKEYSCAN_Type * | base, |
uint32_t * | mask | ||
) |
Return interrupt mask setting.
base | [in] Pointer to KeyScan instance register area. |
mask | [out] The mask with the OR of the interrupt source which is masked. See KeyScan ALL interrupt mask definition for the set of constants. |
Refer | cy_en_ks_status_t |
cy_en_ks_status_t Cy_Keyscan_GetInterruptMaskedStatus | ( | MXKEYSCAN_Type * | base, |
uint32_t * | status | ||
) |
Return interrupt masked status.
base | [in] Pointer to KeyScan instance register area. |
status | [out] The mask with the OR of the interrupt source which occurs. See KeyScan ALL interrupt mask definition for the set of constants. |
Refer | cy_en_ks_status_t |
cy_en_ks_status_t Cy_Keyscan_GetInterruptStatus | ( | MXKEYSCAN_Type * | base, |
uint32_t * | status | ||
) |
Return interrupt raw status.
base | [in] Pointer to Keyscan instance register area. |
status | [out] The mask with the OR of the interrupt source which occurs. See KeyScan ALL interrupt mask definition for the set of constants. |
Refer | cy_en_ks_status_t |
cy_en_ks_status_t Cy_Keyscan_ClearInterrupt | ( | MXKEYSCAN_Type * | base, |
uint32_t | mask | ||
) |
Clear interrupt status.
base | [in] Pointer to Keyscan instance register area. |
mask | [in] The mask with the OR of the interrupt source to be cleared. See KeyScan ALL interrupt mask definition for the set of constants. |
Refer | cy_en_ks_status_t |
cy_en_ks_status_t Cy_Keyscan_Interrupt_Handler | ( | MXKEYSCAN_Type * | base, |
cy_stc_keyscan_context_t * | context | ||
) |
Handler for keyscan interrupts.
Applications have to call this function from keyscan interrupt handler. After successfully reading from HW FIFO and writing to FW FIFO this function will notify application to read from the FW FIFO. Application has to call Cy_Keyscan_getNextEvent() in a loop till the return value is CY_KEYSCAN_EVENT_NONE
base | [in] Pointer to Keyscan instance register area. |
context | [in] Pointer to the context. |
Refer | cy_en_ks_status_t |
base [in] Pointer to Keyscan instance register area. context [in] Pointer to the context.
cy_en_ks_status_t Cy_Keyscan_FlushEvents | ( | MXKEYSCAN_Type * | base, |
cy_stc_keyscan_context_t * | context | ||
) |
Flush events from HW FIFO.
Flush the Fw FIFO also and it is equivalent to no key press events.
base | [in] Pointer to Keyscan instance register area. |
context | [in] Pointer to the context. |
Refer | cy_en_ks_status_t |
Flush events from HW FIFO.
[in] context Pointer to the context. [in] base Pointer to KeyScan instance register area
cy_en_ks_status_t Cy_Keyscan_EnableGhostDetection | ( | MXKEYSCAN_Type * | base | ) |
Enables Ghost detection.
base | [in] Pointer to Keyscan instance register area. |
Refer | cy_en_ks_status_t |
cy_en_ks_status_t Cy_Keyscan_DisableGhostDetection | ( | MXKEYSCAN_Type * | base | ) |
Disables Ghost detection.
base | [in] Pointer to Keyscan instance register area. |
Refer | cy_en_ks_status_t |
cy_en_ks_status_t Cy_Keyscan_EnableClockStayOn | ( | MXKEYSCAN_Type * | base | ) |
Enables Clock Stay On Clock to the IP is always enabled.
base | [in] Pointer to Keyscan instance register area. |
Refer | cy_en_ks_status_t |
cy_en_ks_status_t Cy_Keyscan_DisableClockStayOn | ( | MXKEYSCAN_Type * | base | ) |
Disables Clock Stay On When there is no activity detected the clock to the Keyscan is gated off.
base | [in] Pointer to Keyscan instance register area. |
Refer | cy_en_ks_status_t |
base [in] Pointer to Keyscan instance register area.