PAN1080 Peripheral API
Modules | Functions
Kscan Interface

Kscan Interface. More...

Collaboration diagram for Kscan Interface:

Modules

 Kscan enable bit
 Kscan enable bit definitions.
 
 Kscan interval clk cycle
 Kscan interval clk cycle definitions.
 

Functions

__STATIC_INLINE void KS_Enable (KSCAN_T *ks, FunctionalState NewState, uint32_t func)
 This function is set keyscan enable bit. More...
 
__STATIC_INLINE void KS_InputEnable (KSCAN_T *ks, FunctionalState NewState, uint32_t func)
 This function is set keyscan input enable function. More...
 
__STATIC_INLINE void KS_OutputEnable (KSCAN_T *ks, FunctionalState NewState, uint32_t func)
 This function is set keyscan output enable function. More...
 
__STATIC_INLINE void KS_IntEnable (KSCAN_T *ks, FunctionalState NewState)
 This function is used to check keyscan status. More...
 
__STATIC_INLINE bool KS_StatusCheck (KSCAN_T *ks, uint32_t func)
 This function is used to check keyscan status. More...
 
__STATIC_INLINE void KS_ClearFlag (KSCAN_T *ks, uint32_t func)
 This function is used to clear keyscan status. More...
 
__STATIC_INLINE void KS_SetKeyscanPolarity (KSCAN_T *ks, FunctionalState NewState)
 This function is used to set keyscan polarity as high. More...
 
__STATIC_INLINE void KS_ClearKeyscanStatus (KSCAN_T *ks, FunctionalState NewState)
 This function is used to clear all key status enable. More...
 
__STATIC_INLINE void KS_SetFrameInterval (KSCAN_T *ks, uint32_t func)
 This function is used to set keyscan interval time between current frame to next. More...
 
__STATIC_INLINE uint32_t KS_GetFrameInterval (KSCAN_T *ks)
 This function is used to get keyscan interval time between current frame to next. More...
 
__STATIC_INLINE void KS_SetRowInterval (KSCAN_T *ks, uint32_t func)
 This function is used to set keyscan interval time between current row to next. More...
 
__STATIC_INLINE uint32_t KS_GetRowInterval (KSCAN_T *ks)
 This function is used to get keyscan interval time between current row to next. More...
 
__STATIC_INLINE void KS_SetDebounceTime (KSCAN_T *ks, uint32_t func)
 This function is used to set keyscan debounce time. More...
 
__STATIC_INLINE uint32_t KS_GetDebounceTime (KSCAN_T *ks)
 This function is used to get keyscan debounce time. More...
 
__STATIC_INLINE void KS_WaitScanFinish (KSCAN_T *ks, bool enable)
 This function is used to enable keyscan delay function,if enabled isr will reported after scan finish. More...
 
uint32_t KS_ReadKeyRowInfo (KSCAN_T *ks, uint8_t rowIdx)
 This function is used to read key info. More...
 
bool KS_IsKeyPressed (KSCAN_T *ks, uint8_t rowIdx, uint8_t colIdx)
 This function is used to read key info. More...
 

Detailed Description

Kscan Interface.

Function Documentation

◆ KS_ClearFlag()

__STATIC_INLINE void KS_ClearFlag ( KSCAN_T *  ks,
uint32_t  func 
)

This function is used to clear keyscan status.

Parameters
kswhere ks is a keyscan peripheral base address
funcstatus select KS_INT_FLAG_Msk KS_FLAG_Msk
Returns
none

◆ KS_ClearKeyscanStatus()

__STATIC_INLINE void KS_ClearKeyscanStatus ( KSCAN_T *  ks,
FunctionalState  NewState 
)

This function is used to clear all key status enable.

Parameters
kswhere ks is a keyscan peripheral base address
NewStatenew state of all status clear
Returns
none

◆ KS_Enable()

__STATIC_INLINE void KS_Enable ( KSCAN_T *  ks,
FunctionalState  NewState,
uint32_t  func 
)

This function is set keyscan enable bit.

Parameters
kswhere ks is a keyscan peripheral base address
NewStatenew state of the keyscan peripheral
funcfunction select KS_PERIPHRAL_ENABLE
KS_WAKEUP_ENABLE
KS_WAKEUP_AND_PERIPH_ENABLE
Returns
none

◆ KS_GetDebounceTime()

__STATIC_INLINE uint32_t KS_GetDebounceTime ( KSCAN_T *  ks)

This function is used to get keyscan debounce time.

Parameters
kswhere ks is a keyscan peripheral base address
Returns
none

◆ KS_GetFrameInterval()

__STATIC_INLINE uint32_t KS_GetFrameInterval ( KSCAN_T *  ks)

This function is used to get keyscan interval time between current frame to next.

Parameters
kswhere ks is a keyscan peripheral base address
Returns
none

◆ KS_GetRowInterval()

__STATIC_INLINE uint32_t KS_GetRowInterval ( KSCAN_T *  ks)

This function is used to get keyscan interval time between current row to next.

Parameters
kswhere ks is a keyscan peripheral base address
Returns
none

◆ KS_InputEnable()

__STATIC_INLINE void KS_InputEnable ( KSCAN_T *  ks,
FunctionalState  NewState,
uint32_t  func 
)

This function is set keyscan input enable function.

Parameters
kswhere ks is a keyscan peripheral base address
NewStatenew state of the keyscan peripheral
funcfunction select,input range[7~0]
Returns
none

◆ KS_IntEnable()

__STATIC_INLINE void KS_IntEnable ( KSCAN_T *  ks,
FunctionalState  NewState 
)

This function is used to check keyscan status.

Parameters
kswhere ks is a keyscan peripheral base address
NewStatenew state of the keyscan peripheral
Returns
none

◆ KS_IsKeyPressed()

bool KS_IsKeyPressed ( KSCAN_T *  ks,
uint8_t  rowIdx,
uint8_t  colIdx 
)

This function is used to read key info.

Parameters
kswhere ks is a keyscan peripheral base address
rowIdxrow number select (0~23)
colIdxcolumn number select (0~7)
Returns
one key state

◆ KS_OutputEnable()

__STATIC_INLINE void KS_OutputEnable ( KSCAN_T *  ks,
FunctionalState  NewState,
uint32_t  func 
)

This function is set keyscan output enable function.

Parameters
kswhere ks is a keyscan peripheral base address
NewStatenew state of the keyscan peripheral
funcfunction select,input range[7~0]
Returns
none

◆ KS_ReadKeyRowInfo()

uint32_t KS_ReadKeyRowInfo ( KSCAN_T *  ks,
uint8_t  rowIdx 
)

This function is used to read key info.

Parameters
kswhere ks is a keyscan peripheral base address
rowIdxrow number select (0~23)
Returns
row key infomation

◆ KS_SetDebounceTime()

__STATIC_INLINE void KS_SetDebounceTime ( KSCAN_T *  ks,
uint32_t  func 
)

This function is used to set keyscan debounce time.

Parameters
kswhere ks is a keyscan peripheral base address
funcinterval time select Kscan interval clk cycle
Returns
none

◆ KS_SetFrameInterval()

__STATIC_INLINE void KS_SetFrameInterval ( KSCAN_T *  ks,
uint32_t  func 
)

This function is used to set keyscan interval time between current frame to next.

Parameters
kswhere ks is a keyscan peripheral base address
funcinterval time select Kscan interval clk cycle
Returns
none

◆ KS_SetKeyscanPolarity()

__STATIC_INLINE void KS_SetKeyscanPolarity ( KSCAN_T *  ks,
FunctionalState  NewState 
)

This function is used to set keyscan polarity as high.

Parameters
kswhere ks is a keyscan peripheral base address
NewStatenew state of the keyscan polarity
Returns
none

◆ KS_SetRowInterval()

__STATIC_INLINE void KS_SetRowInterval ( KSCAN_T *  ks,
uint32_t  func 
)

This function is used to set keyscan interval time between current row to next.

Parameters
kswhere ks is a keyscan peripheral base address
funcinterval time select Kscan interval clk cycle
Returns
none

◆ KS_StatusCheck()

__STATIC_INLINE bool KS_StatusCheck ( KSCAN_T *  ks,
uint32_t  func 
)

This function is used to check keyscan status.

Parameters
kswhere ks is a keyscan peripheral base address
funcstatus select KS_INT_FLAG_Msk KS_FLAG_Msk
Returns
none

◆ KS_WaitScanFinish()

__STATIC_INLINE void KS_WaitScanFinish ( KSCAN_T *  ks,
bool  enable 
)

This function is used to enable keyscan delay function,if enabled isr will reported after scan finish.

Parameters
kswhere ks is a keyscan peripheral base address
enablenew state of the keyscan scan status
Returns
none