|
SmartSnippets DA1459x SDK
|
Quadrature Decoder. More...
Files | |
| file | hw_quad_v2.h |
| Definition of API for the Quad Decoder Low Level Driver. | |
Data Structures | |
| struct | hw_quad_values_t |
| Local Quadrature Decoder Counter and Deltas repository definition. More... | |
| struct | hw_quad_config_t |
| Initialization Struct for use with "hw_quad_init()". More... | |
Typedefs | |
| typedef void(* | hw_quad_handler_cb) (const volatile hw_quad_values_t *quad_values, void *user_data) |
| Quadrature Decoder Interrupt Callback. More... | |
Enumerations | |
| enum | HW_QUAD_REG_CLK |
| Quadrature Decoder CTRL Clock Enable Status. More... | |
| enum | HW_QUAD_REG_CTRL_IRQ_STATUS |
| Quadrature Decoder CTRL Register IRQ Status. | |
| enum | HW_QUAD_REG_CTRL_EVENT_CNT_CLR |
| Quadrature Decoder CTRL Register Event Counter Clear. | |
| enum | HW_QUAD_REG_CTRL_IRQ_EN |
| Quadrature Decoder CTRL Register IRQ Status. | |
| enum | HW_QUAD_REG_CTRL2_CHANNEL_EVENT_MODE |
| Quadrature Decoder CTRL2 Register Channel X-Y-Z Event Mode. | |
| enum | HW_QUAD_GPIO_INPUT |
| Quadrature Decoder CTRL2 Register Channel X-Y-Z Port Selection. | |
| enum | HW_QUAD_REG_CLOCKDIV_PRESCALER |
| Quadrature Decoder CLOCKDIV Register Prescaler. | |
Functions | |
| __STATIC_FORCEINLINE int16_t | hw_quad_get_xcnt_reg (void) |
| Get XCNT Register. More... | |
| __STATIC_FORCEINLINE int16_t | hw_quad_get_ycnt_reg (void) |
| Get YCNT Register. More... | |
| __STATIC_FORCEINLINE int16_t | hw_quad_get_zcnt_reg (void) |
| Get ZCNT Register. More... | |
| __STATIC_FORCEINLINE uint8_t | hw_quad_get_event_cnt_reg (void) |
| Get Event Count Register. More... | |
| __STATIC_FORCEINLINE void | hw_quad_qdec_clk_en (HW_QUAD_REG_CLK enable) |
| Quadrature Decoder Clock Enable/Disable. More... | |
| __STATIC_FORCEINLINE void | hw_quad_clr_event_cnt (void) |
| Clear Event Count Register. More... | |
| __STATIC_FORCEINLINE void | hw_quad_clr_irq_status (void) |
| Clear IRQ. More... | |
| __STATIC_FORCEINLINE HW_QUAD_REG_CTRL_IRQ_EN | hw_quad_return_irq_status (void) |
| Return IRQ Status. More... | |
| void | hw_quad_interrupt_enable_and_register (hw_quad_handler_cb cb, uint8_t thres_num, void *user_data_p) |
| Enable Interrupt. More... | |
| void | hw_quad_interrupt_disable_and_unregister (void) |
| Disable Interrupt. More... | |
| void | hw_quad_start (void) |
| Start Quadrature Decoder. More... | |
| void | hw_quad_stop (void) |
| Stop Quadrature Decoder. More... | |
| void | hw_quad_disable (void) |
| Disable Quadrature Decoder. More... | |
| void | hw_quad_init (const hw_quad_config_t *init_data) |
| Initialize Quadrature Decoder. More... | |
Quadrature Decoder.
| typedef void(* hw_quad_handler_cb) (const volatile hw_quad_values_t *quad_values, void *user_data) |
Quadrature Decoder Interrupt Callback.
| [in] | user_data | pointer to additional user data |
| enum HW_QUAD_REG_CLK |
Quadrature Decoder CTRL Clock Enable Status.
| __STATIC_FORCEINLINE void hw_quad_clr_event_cnt | ( | void | ) |
Clear Event Count Register.
Clears the QDEC_EVENT_CNT_REG. Please note that when an interrupt has been raised the QDEC_EVENT_CNT_REG will continue to count events. No further interrupts will be generated unless the Event Count Register has been cleared.
| __STATIC_FORCEINLINE void hw_quad_clr_irq_status | ( | void | ) |
Clear IRQ.
Clears pending interrupts.
| void hw_quad_disable | ( | void | ) |
| __STATIC_FORCEINLINE uint8_t hw_quad_get_event_cnt_reg | ( | void | ) |
Get Event Count Register.
Returns the contents of the Quadrature Decoder Event Count Register (QDEC_EVENT_CNT_REG).
| __STATIC_FORCEINLINE int16_t hw_quad_get_xcnt_reg | ( | void | ) |
Get XCNT Register.
Returns the contents of the Quadrature Decoder XCNT Register (QDEC_XCNT_REG).
| __STATIC_FORCEINLINE int16_t hw_quad_get_ycnt_reg | ( | void | ) |
Get YCNT Register.
Returns the contents of the Quadrature Decoder YCNT Register (QDEC_YCNT_REG).
| __STATIC_FORCEINLINE int16_t hw_quad_get_zcnt_reg | ( | void | ) |
Get ZCNT Register.
Returns the contents of the Quadrature Decoder ZCNT Register (QDEC_ZCNT_REG).
| void hw_quad_init | ( | const hw_quad_config_t * | init_data | ) |
Initialize Quadrature Decoder.
Initializes the quadrature decoder block.
| [in] | init_data | defines the initialization struct |
| void hw_quad_interrupt_disable_and_unregister | ( | void | ) |
Disable Interrupt.
Clears QDEC_CTRL_REG pending IRQ and Event Counter, disables IRQ,s in both QDEC_CTRL_REG and NVIC (unregisters callback)
| void hw_quad_interrupt_enable_and_register | ( | hw_quad_handler_cb | cb, |
| uint8_t | thres_num, | ||
| void * | user_data_p | ||
| ) |
Enable Interrupt.
Sets the Control Register (QDEC_CTRL_REG) and registers callback.
| [in] | cb | defines the callback intended to be registered. |
| [in] | thres_num | defines the number of events on either counter (X or Y or Z) that need to be reached before an interrupt is generated. Events are equal to irq_thres + 1 and are monitored through QDEC_EVENT_CNT_REG. |
| [in] | user_data_p | pointer to additional user data |
| __STATIC_FORCEINLINE void hw_quad_qdec_clk_en | ( | HW_QUAD_REG_CLK | enable | ) |
Quadrature Decoder Clock Enable/Disable.
Enables or Disables the Quadrature Decoder clock (CRG_TOP, CLK_AMBA_REG, QDEC_CLK_ENABLE).
| [in] | enable | defines whether the clock will be enabled or disabled. |
| __STATIC_FORCEINLINE HW_QUAD_REG_CTRL_IRQ_EN hw_quad_return_irq_status | ( | void | ) |
Return IRQ Status.
Returns whether an interrupt has occurred or not.
| void hw_quad_start | ( | void | ) |
Start Quadrature Decoder.
Sets QDEC_CTRL2_REG Pin Input pairs according to X-Y-Z stored port pairs in hw_x_axis_ports, hw_y_axis_ports and hw_z_axis_ports respectively.
| void hw_quad_stop | ( | void | ) |
Stop Quadrature Decoder.
Disables QDEC_CTRL2_REG Pin Input pairs, resets counter variables in QDEC_XCNT_REG, QDEC_YCNT_REG. QDEC_ZCNT_REG.
1.8.16