PAN1080 Peripheral API
|
Qdec Interface. More...
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... | |
Qdec Interface.
#define QDEC_FUNC_ALL (0XFF) |
Enable all qdec function
#define QDEC_FUNC_ALL_EXCEPT_WK (0XBF) |
Enable all qdec function except wake up function
__STATIC_INLINE uint32_t QDEC_ClearEventCnt | ( | uint8_t | idx | ) |
This function used to clear event count value.
[in] | idx | x,y,z count idx select,including: QDEC_CNT_IDX_X QDEC_CNT_IDX_Y QDEC_CNT_IDX_Z |
__STATIC_INLINE void QDEC_ClearIntFlag | ( | uint32_t | intMsk | ) |
This function clear qdec interrupt flag.
intMsk | interrupt 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 |
__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.
intMsk | interrupt 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] | NewState | function enable or not. Including: ENABLE and DISABLE |
__STATIC_INLINE void QDEC_ClearRawIntFlag | ( | uint32_t | intMsk | ) |
This function clear qdec raw interrupt flag.
intMsk | interrupt 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 |
__STATIC_INLINE void QDEC_Enable | ( | FunctionalState | NewState, |
uint32_t | func | ||
) |
This function is set qdec enable bit.
NewState | new state of the qdec peripheral |
func | function 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 |
__STATIC_INLINE uint32_t QDEC_GetEventCnt | ( | uint8_t | idx | ) |
This function used to get event count value.
[in] | idx | x,y,z count idx select,including: QDEC_CNT_IDX_X QDEC_CNT_IDX_Y QDEC_CNT_IDX_Z |
__STATIC_INLINE bool QDEC_IsIntOccured | ( | uint32_t | intMsk | ) |
This function adjust qdec interrupt occured or not.
intMsk | interrupt 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 |
__STATIC_INLINE bool QDEC_IsRawIntOccured | ( | uint32_t | intMsk | ) |
This function adjust qdec raw interrupt occured or not.
intMsk | interrupt 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 |
void QDEC_SetCntResolution | ( | uint8_t | resolution | ) |
This function used to set count resolution.
[in] | resolution | count resolution value,including: QDEC_CNT_RESOLUTION_1X QDEC_CNT_RESOLUTION_2X QDEC_CNT_RESOLUTION_4X |
void QDEC_SetEventThreshold | ( | uint16_t | threshold | ) |
This function used to set event threshold.
[in] | threshold | event threshold value |
void QDEC_SetFilterThreshold | ( | uint8_t | threshold | ) |
This function used to set filter threshold.
[in] | threshold | filter 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 |
__STATIC_INLINE void QDEC_SetPolarity | ( | uint8_t | polarity | ) |
This function used to set index polarity.
[in] | polarity | polarity select,including: QDEC_POLARITY_HIGH QDEC_POLARITY_LOW |