PAN1080 Peripheral API
Modules | Macros | Functions
Qdec Interface

Qdec Interface. More...

Collaboration diagram for Qdec Interface:

Modules

 Qdec polarity type
 Qdec polarity type definitions.
 
 Qdec polarity type
 Qdec channel counter definitions.
 
 Kscan enable bit
 Kscan enable bit definitions.
 

Macros

#define QDEC_FUNC_ALL   (0XFF)
 
#define QDEC_FUNC_ALL_EXCEPT_WK   (0XBF)
 

Functions

__STATIC_INLINE void QDEC_Enable (FunctionalState NewState, uint32_t func)
 This function is set qdec enable bit. More...
 
__STATIC_INLINE bool QDEC_IsIntOccured (uint32_t intMsk)
 This function adjust qdec interrupt occured or not. More...
 
__STATIC_INLINE void QDEC_ClearIntFlag (uint32_t intMsk)
 This function clear qdec interrupt flag. More...
 
__STATIC_INLINE bool QDEC_IsRawIntOccured (uint32_t intMsk)
 This function adjust qdec raw interrupt occured or not. More...
 
__STATIC_INLINE void QDEC_ClearRawIntFlag (uint32_t intMsk)
 This function clear qdec raw interrupt flag. More...
 
__STATIC_INLINE void QDEC_ClearIntMsk (uint32_t intMsk, FunctionalState NewState)
 This function used to set interrupt mask, if masked,qdec int flag will not be placed. More...
 
__STATIC_INLINE void QDEC_SetPolarity (uint8_t polarity)
 This function used to set index polarity. More...
 
__STATIC_INLINE uint32_t QDEC_GetEventCnt (uint8_t idx)
 This function used to get event count value. More...
 
__STATIC_INLINE uint32_t QDEC_ClearEventCnt (uint8_t idx)
 This function used to clear event count value. More...
 
void QDEC_SetCntResolution (uint8_t resolution)
 This function used to set count resolution. More...
 
void QDEC_SetFilterThreshold (uint8_t threshold)
 This function used to set filter threshold. More...
 
void QDEC_SetEventThreshold (uint16_t threshold)
 This function used to set event threshold. More...
 

Detailed Description

Qdec Interface.

Macro Definition Documentation

◆ QDEC_FUNC_ALL

#define QDEC_FUNC_ALL   (0XFF)

Enable all qdec function

◆ QDEC_FUNC_ALL_EXCEPT_WK

#define QDEC_FUNC_ALL_EXCEPT_WK   (0XBF)

Enable all qdec function except wake up function

Function Documentation

◆ QDEC_ClearEventCnt()

__STATIC_INLINE uint32_t QDEC_ClearEventCnt ( uint8_t  idx)

This function used to clear event count value.

Parameters
[in]idxx,y,z count idx select,including: QDEC_CNT_IDX_X QDEC_CNT_IDX_Y QDEC_CNT_IDX_Z
Returns
none

◆ QDEC_ClearIntFlag()

__STATIC_INLINE void QDEC_ClearIntFlag ( uint32_t  intMsk)

This function clear qdec interrupt flag.

Parameters
intMskinterrupt select QDEC_INT_INDEX_Msk
QDEC_INT_FIFO_UNDERFLOW_Msk QDEC_INT_FIFO_OVERFLOW_Msk
QDEC_INT_INVALID_Msk
QDEC_INT_CNT_UNDERFLOW_Msk QDEC_INT_CNT_OVERFLOW_Msk
Returns
none

◆ QDEC_ClearIntMsk()

__STATIC_INLINE void QDEC_ClearIntMsk ( uint32_t  intMsk,
FunctionalState  NewState 
)

This function used to set interrupt mask, if masked,qdec int flag will not be placed.

Parameters
intMskinterrupt select QDEC_INT_INDEX_Msk
QDEC_INT_FIFO_UNDERFLOW_Msk QDEC_INT_FIFO_OVERFLOW_Msk
QDEC_INT_INVALID_Msk
QDEC_INT_CNT_UNDERFLOW_Msk QDEC_INT_CNT_OVERFLOW_Msk
[in]NewStatefunction enable or not. Including: ENABLE and DISABLE
Returns
none

◆ QDEC_ClearRawIntFlag()

__STATIC_INLINE void QDEC_ClearRawIntFlag ( uint32_t  intMsk)

This function clear qdec raw interrupt flag.

Parameters
intMskinterrupt select QDEC_INT_INDEX_Msk
QDEC_INT_FIFO_UNDERFLOW_Msk QDEC_INT_FIFO_OVERFLOW_Msk
QDEC_INT_INVALID_Msk
QDEC_INT_CNT_UNDERFLOW_Msk QDEC_INT_CNT_OVERFLOW_Msk
Returns
false or true

◆ QDEC_Enable()

__STATIC_INLINE void QDEC_Enable ( FunctionalState  NewState,
uint32_t  func 
)

This function is set qdec enable bit.

Parameters
NewStatenew state of the qdec peripheral
funcfunction select QDEC_EVENT_EN_Msk QDEC_WAKEUP_EN_Msk
QDEC_INDEX_EN_Msk
QDEC_CHANNEL_Z_EN_Msk QDEC_CHANNEL_Y_EN_Msk QDEC_CHANNEL_X_EN_Msk QDEC_FILTER_EN_Msk
QDEC_EN_Msk
Returns
none

◆ QDEC_GetEventCnt()

__STATIC_INLINE uint32_t QDEC_GetEventCnt ( uint8_t  idx)

This function used to get event count value.

Parameters
[in]idxx,y,z count idx select,including: QDEC_CNT_IDX_X QDEC_CNT_IDX_Y QDEC_CNT_IDX_Z
Returns
none

◆ QDEC_IsIntOccured()

__STATIC_INLINE bool QDEC_IsIntOccured ( uint32_t  intMsk)

This function adjust qdec interrupt occured or not.

Parameters
intMskinterrupt select QDEC_INT_INDEX_Msk
QDEC_INT_FIFO_UNDERFLOW_Msk QDEC_INT_FIFO_OVERFLOW_Msk
QDEC_INT_INVALID_Msk
QDEC_INT_CNT_UNDERFLOW_Msk QDEC_INT_CNT_OVERFLOW_Msk
Returns
false or true

◆ QDEC_IsRawIntOccured()

__STATIC_INLINE bool QDEC_IsRawIntOccured ( uint32_t  intMsk)

This function adjust qdec raw interrupt occured or not.

Parameters
intMskinterrupt select QDEC_INT_INDEX_Msk
QDEC_INT_FIFO_UNDERFLOW_Msk QDEC_INT_FIFO_OVERFLOW_Msk
QDEC_INT_INVALID_Msk
QDEC_INT_CNT_UNDERFLOW_Msk QDEC_INT_CNT_OVERFLOW_Msk
Returns
false or true

◆ QDEC_SetCntResolution()

void QDEC_SetCntResolution ( uint8_t  resolution)

This function used to set count resolution.

Parameters
[in]resolutioncount resolution value,including: QDEC_CNT_RESOLUTION_1X QDEC_CNT_RESOLUTION_2X QDEC_CNT_RESOLUTION_4X
Returns
none

◆ QDEC_SetEventThreshold()

void QDEC_SetEventThreshold ( uint16_t  threshold)

This function used to set event threshold.

Parameters
[in]thresholdevent threshold value
Returns
none

◆ QDEC_SetFilterThreshold()

void QDEC_SetFilterThreshold ( uint8_t  threshold)

This function used to set filter threshold.

Parameters
[in]thresholdfilter threshold value,including: QDEC_FILTER_PERIOD_1 QDEC_FILTER_PERIOD_2 QDEC_FILTER_PERIOD_3 QDEC_FILTER_PERIOD_4 QDEC_FILTER_PERIOD_5 QDEC_FILTER_PERIOD_6 QDEC_FILTER_PERIOD_7 QDEC_FILTER_PERIOD_8
Returns
none

◆ QDEC_SetPolarity()

__STATIC_INLINE void QDEC_SetPolarity ( uint8_t  polarity)

This function used to set index polarity.

Parameters
[in]polaritypolarity select,including: QDEC_POLARITY_HIGH QDEC_POLARITY_LOW
Returns
none