|
MotorWare f2806x Driver API Documentation
|
Contains public interface to various functions related to the quadrature pulse encoder (QEP) object. More...
#include "sw/drivers/cpu/src/32b/f28x/f2806x/cpu.h"#include "sw/modules/math/src/32b/math.h"#include "sw/modules/types/src/types.h"Go to the source code of this file.
Data Structures | |
| struct | _QEP_Obj_ |
| Defines the QEP object. More... | |
Macros | |
| #define | QEP1_BASE_ADDR (0x00006B00) |
| #define | QEP2_BASE_ADDR (0x00006B40) |
| #define | QEP_QDECCTL_QSRC (3 << 14) |
| position counter source selection More... | |
| #define | QEP_QDECCTL_SOEN (1 << 13) |
| sync output enable More... | |
| #define | QEP_QDECCTL_SPSEL (1 << 12) |
| sync output pin selection More... | |
| #define | QEP_QDECCTL_XCR (1 << 11) |
| external clock rate More... | |
| #define | QEP_QDECCTL_SWAP (1 << 10) |
| swap quadrature clock inputs More... | |
| #define | QEP_QDECCTL_IGATE (1 << 9) |
| index pulse gating option More... | |
| #define | QEP_QDECCTL_QAP (1 << 8) |
| QEPA input polarity. More... | |
| #define | QEP_QDECCTL_QBP (1 << 7) |
| QEPB input polarity. More... | |
| #define | QEP_QDECCTL_QIP (1 << 6) |
| QEPI input polarity. More... | |
| #define | QEP_QDECCTL_QSP (1 << 5) |
| QEPS input polarity. More... | |
| #define | QEP_QEPCTL_FREESOFT ( 3 << 14) |
| emulation control bit More... | |
| #define | QEP_QEPCTL_PCRM ( 3 << 12) |
| emulation control bit More... | |
| #define | QEP_QEPCTL_SEI ( 3 << 10) |
| strobe event initialization of position counter More... | |
| #define | QEP_QEPCTL_IEI ( 3 << 8) |
| index event initialization of position counter More... | |
| #define | QEP_QEPCTL_SWI ( 1 << 7) |
| software initialization of position counter More... | |
| #define | QEP_QEPCTL_SEL ( 1 << 6) |
| strobe event latch of position counter More... | |
| #define | QEP_QEPCTL_IEL ( 3 << 4) |
| index event latch of position counter (software index marker) More... | |
| #define | QEP_QEPCTL_QPEN ( 1 << 3) |
| quad position counter enable/software reset More... | |
| #define | QEP_QEPCTL_QCLM ( 1 << 2) |
| QEP capture latch mode. More... | |
| #define | QEP_QEPCTL_UTE ( 1 << 1) |
| QEP unit timer enable. More... | |
| #define | QEP_QEPCTL_WDE ( 1 << 0) |
| watchdog timer enable More... | |
| #define | QEP_QPOSCTL_PCSHDW ( 1 << 15) |
| position compare shadow enable More... | |
| #define | QEP_QPOSCTL_PCLOAD ( 1 << 14) |
| position compare shadow load mode More... | |
| #define | QEP_QPOSCTL_PCPOL ( 1 << 13) |
| load when QPOSCNT = QPOSCMP More... | |
| #define | QEP_QPOSCTL_PCE ( 1 << 12) |
| position compare enable/disable More... | |
| #define | QEP_QPOSCTL_PCSPW (4095 << 0) |
| selection position compare sync output pulse width More... | |
| #define | QEP_QCAPCTL_CEN ( 1 << 15) |
| enable QEP capture More... | |
| #define | QEP_QCAPCTL_CCPS ( 7 << 4) |
| qep capture timer clock prescaler More... | |
| #define | QEP_QCAPCTL_UPPS ( 15 << 0) |
| unit position event prescaler More... | |
| #define | QEP_QEINT_UTO ( 1 << 11) |
| unit timeout interrupt enable More... | |
| #define | QEP_QEINT_IEL ( 1 << 10) |
| index event latch interrupt enable More... | |
| #define | QEP_QEINT_SEL ( 1 << 9) |
| strobe event latch interrupt enable More... | |
| #define | QEP_QEINT_PCM ( 1 << 8) |
| position compare match interrupt enable More... | |
| #define | QEP_QEINT_PCR ( 1 << 7) |
| position compare ready interrupt enable More... | |
| #define | QEP_QEINT_PCO ( 1 << 6) |
| position counter overflow interrupt enable More... | |
| #define | QEP_QEINT_PCU ( 1 << 5) |
| position counter underflow interrupt enable More... | |
| #define | QEP_QEINT_WTO ( 1 << 4) |
| watchdog time out interrupt enable More... | |
| #define | QEP_QEINT_QDC ( 1 << 3) |
| quadrature direction change interrupt enable More... | |
| #define | QEP_QEINT_QPE ( 1 << 2) |
| quadrature phase error interrupt enable More... | |
| #define | QEP_QEINT_PCE ( 1 << 1) |
| position counter error interrupt enable More... | |
| #define | QEP_QFLG_UTO ( 1 << 11) |
| unit timeout interrupt flag More... | |
| #define | QEP_QFLG_IEL ( 1 << 10) |
| index event latch interrupt flag More... | |
| #define | QEP_QFLG_SEL ( 1 << 9) |
| strobe event latch interrupt flag More... | |
| #define | QEP_QFLG_PCM ( 1 << 8) |
| position compare match interrupt flag More... | |
| #define | QEP_QFLG_PCR ( 1 << 7) |
| position compare ready interrupt flag More... | |
| #define | QEP_QFLG_PCO ( 1 << 6) |
| position counter overflow interrupt flag More... | |
| #define | QEP_QFLG_PCU ( 1 << 5) |
| position counter underflow interrupt flag More... | |
| #define | QEP_QFLG_WTO ( 1 << 4) |
| watchdog time out interrupt flag More... | |
| #define | QEP_QFLG_QDC ( 1 << 3) |
| quadrature direction change interrupt flag More... | |
| #define | QEP_QFLG_QPE ( 1 << 2) |
| quadrature phase error interrupt flag More... | |
| #define | QEP_QFLG_PCE ( 1 << 1) |
| position counter error interrupt flag More... | |
| #define | QEP_QCLR_UTO ( 1 << 11) |
| clear unit timeout interrupt flag More... | |
| #define | QEP_QCLR_IEL ( 1 << 10) |
| clear index event latch interrupt flag More... | |
| #define | QEP_QCLR_SEL ( 1 << 9) |
| clear strobe event latch interrupt flag More... | |
| #define | QEP_QCLR_PCM ( 1 << 8) |
| clear position compare match interrupt flag More... | |
| #define | QEP_QCLR_PCR ( 1 << 7) |
| clear position compare ready interrupt flag More... | |
| #define | QEP_QCLR_PCO ( 1 << 6) |
| clear position counter overflow interrupt flag More... | |
| #define | QEP_QCLR_PCU ( 1 << 5) |
| clear position counter underflow interrupt flag More... | |
| #define | QEP_QCLR_WTO ( 1 << 4) |
| clear watchdog time out interrupt flag More... | |
| #define | QEP_QCLR_QDC ( 1 << 3) |
| clear quadrature direction change interrupt flag More... | |
| #define | QEP_QCLR_QPE ( 1 << 2) |
| clear quadrature phase error interrupt flag More... | |
| #define | QEP_QCLR_PCE ( 1 << 1) |
| clear position counter error interrupt flag More... | |
| #define | QEP_QFRC_UTO ( 1 << 11) |
| force unit timeout interrupt More... | |
| #define | QEP_QFRC_IEL ( 1 << 10) |
| force index event latch interrupt More... | |
| #define | QEP_QFRC_SEL ( 1 << 9) |
| force strobe event latch interrupt More... | |
| #define | QEP_QFRC_PCM ( 1 << 8) |
| force position compare match interrupt More... | |
| #define | QEP_QFRC_PCR ( 1 << 7) |
| force position compare ready interrupt More... | |
| #define | QEP_QFRC_PCO ( 1 << 6) |
| force position counter overflow interrupt More... | |
| #define | QEP_QFRC_PCU ( 1 << 5) |
| force position counter underflow interrupt More... | |
| #define | QEP_QFRC_WTO ( 1 << 4) |
| force watchdog time out interrupt More... | |
| #define | QEP_QFRC_QDC ( 1 << 3) |
| force quadrature direction change interrupt More... | |
| #define | QEP_QFRC_QPE ( 1 << 2) |
| force quadrature phase error interrupt More... | |
| #define | QEP_QFRC_PCE ( 1 << 1) |
| force position counter error interrupt More... | |
| #define | QEP_QEPSTS_UPEVNT ( 1 << 7) |
| unit position event flag More... | |
| #define | QEP_QEPSTS_FDF ( 1 << 6) |
| direction on the first index marker More... | |
| #define | QEP_QEPSTS_QDF ( 1 << 5) |
| quadrature direction flag More... | |
| #define | QEP_QEPSTS_QDLF ( 1 << 4) |
| direction latch flag More... | |
| #define | QEP_QEPSTS_COEF ( 1 << 3) |
| capture overflow error flag More... | |
| #define | QEP_QEPSTS_CDEF ( 1 << 2) |
| capture direction error flag More... | |
| #define | QEP_QEPSTS_FIMF ( 1 << 1) |
| first index marker flag More... | |
| #define | QEP_QEPSTS_PCEF ( 1 << 0) |
| position counter error flag More... | |
Typedefs | |
| typedef struct _QEP_Obj_ | QEP_Obj |
| Defines the QEP object. More... | |
| typedef struct _QEP_Obj_ * | QEP_Handle |
| Defines the QEP handle. More... | |
Functions | |
| void | QEP_clear_all_interrupt_flags (QEP_Handle qepHandle) |
| Clears all QEP interrupt flags. More... | |
| void | QEP_clear_interrupt_flag (QEP_Handle qepHandle, const QEINT_e QEINT) |
| Clears a single interrupt flag. More... | |
| void | QEP_clear_posn_counter (QEP_Handle qepHandle) |
| Clears the position counter. More... | |
| void | QEP_disable_all_interrupts (QEP_Handle qepHandle) |
| Disables all interrupts. More... | |
| void | QEP_disable_capture (QEP_Handle qepHandle) |
| Disable capture. More... | |
| void | QEP_disable_gate_index (QEP_Handle qepHandle) |
| Disable gating of index pulse. More... | |
| void | QEP_disable_interrupt (QEP_Handle qepHandle, const QEINT_e QEINT) |
| Disable individual interrupt. More... | |
| void | QEP_disable_posn_compare (QEP_Handle qepHandle) |
| Disable position compare. More... | |
| void | QEP_disable_posn_compare_shadow (QEP_Handle qepHandle) |
| Disable position compare shadowing. More... | |
| void | QEP_disable_sync_out (QEP_Handle qepHandle) |
| Disable output sync pulse. More... | |
| void | QEP_disable_unit_timer (QEP_Handle qepHandle) |
| Disable unit timer. More... | |
| void | QEP_disable_watchdog (QEP_Handle qepHandle) |
| Disable watchdog timer. More... | |
| void | QEP_enable_capture (QEP_Handle qepHandle) |
| Enable capture. More... | |
| void | QEP_enable_counter (QEP_Handle qepHandle) |
| Enable counter. More... | |
| void | QEP_enable_gate_index (QEP_Handle qepHandle) |
| Enable gating of index pulse. More... | |
| void | QEP_enable_interrupt (QEP_Handle qepHandle, const QEINT_e QEINT) |
| Enable individual interrupt. More... | |
| void | QEP_enable_posn_compare (QEP_Handle qepHandle) |
| Enable position compare. More... | |
| void | QEP_enable_posn_compare_shadow (QEP_Handle qepHandle) |
| Enable position compare shadowing. More... | |
| void | QEP_enable_sync_out (QEP_Handle qepHandle) |
| Enable output sync pulse. More... | |
| void | QEP_enable_unit_timer (QEP_Handle qepHandle) |
| Enable unit timer. More... | |
| void | QEP_enable_watchdog (QEP_Handle qepHandle) |
| Enable watchdog timer. More... | |
| void | QEP_force_interrupt (QEP_Handle qepHandle, const QEINT_e QEINT) |
| Manually force QEP interrupt. More... | |
| QEP_Handle | QEP_init (void *pMemory, const size_t numBytes) |
| Initializes the QEP object. More... | |
| uint16_t | QEP_read_capture_period_latch (QEP_Handle qepHandle) |
| Reads capture period latch. More... | |
| uint16_t | QEP_read_capture_timer_latch (QEP_Handle qepHandle) |
| Reads timer latch. More... | |
| uint16_t | QEP_read_interrupt_flag (QEP_Handle qepHandle, const QEINT_e QEINT) |
| Reads interrupt flag value. More... | |
| uint32_t | QEP_read_posn_compare (QEP_Handle qepHandle) |
| Reads position compare register. More... | |
| uint32_t | QEP_read_posn_count (QEP_Handle qepHandle) |
| Reads position counter. More... | |
| uint32_t | QEP_read_posn_index_latch (QEP_Handle qepHandle) |
| Reads position counter value index pulse latch register. More... | |
| uint32_t | QEP_read_posn_latch (QEP_Handle qepHandle) |
| Reads position counter value. More... | |
| uint32_t | QEP_read_posn_strobe_latch (QEP_Handle qepHandle) |
| Reads position strobe latch. More... | |
| uint16_t | QEP_read_status (QEP_Handle qepHandle) |
| Reads status register. More... | |
| void | QEP_reset_counter (QEP_Handle qepHandle) |
| Resets counter. More... | |
| void | QEP_reset_status (QEP_Handle qepHandle, const QEP_qepsts_e qepsts) |
| Resets the individual QEP status register bits. More... | |
| void | QEP_set_capture_latch_mode (QEP_Handle qepHandle, const QEPCTL_Qclm_e QEPCTL_Qclm) |
| Sets capture latch mode. More... | |
| void | QEP_set_capture_period (QEP_Handle qepHandle, const uint16_t period) |
| Sets capture period. More... | |
| void | QEP_set_capture_prescale (QEP_Handle qepHandle, const QCAPCTL_Ccps_e QCAPCTL_Ccps) |
| Sets capture pre-scaler. More... | |
| void | QEP_set_emu_control (QEP_Handle qepHandle, const QEPCTL_Freesoft_e QEPCTL_Freesoft) |
| Sets emulation control. More... | |
| void | QEP_set_ext_clock_rate (QEP_Handle qepHandle, const QEP_Xcr_e QEP_Xcr) |
| Sets external clock rate. More... | |
| void | QEP_set_index_event_init (QEP_Handle qepHandle, const QEPCTL_Iei_e QEPCTL_Iei) |
| Sets the event which initializes the counter register. More... | |
| void | QEP_set_index_event_latch (QEP_Handle qepHandle, const QEPCTL_Iel_e QEPCTL_Iel) |
| Sets the index event which latches the position counter. More... | |
| void | QEP_set_index_polarity (QEP_Handle qepHandle, const QEP_Qip_e QEP_Qip) |
| Sets index polarity. More... | |
| void | QEP_set_max_posn_count (QEP_Handle qepHandle, const uint32_t max_count) |
| Sets max position count. More... | |
| void | QEP_set_posn_compare_pulse_width (QEP_Handle qepHandle, const uint16_t pulse_width) |
| Sets output pulse width when a match occur. More... | |
| void | QEP_set_posn_compare_shadow_load (QEP_Handle qepHandle, const QPOSCTL_Pcload_e QPOSCTL_Pcload) |
| Sets position compare shadow load mode. More... | |
| void | QEP_set_posn_count_reset_mode (QEP_Handle qepHandle, const QEPCTL_Pcrm_e QEPCTL_Pcrm) |
| Sets position counter reset mode. More... | |
| void | QEP_set_posn_init_count (QEP_Handle qepHandle, const uint32_t init_count) |
| Sets initial position counter value. More... | |
| void | QEP_set_select_sync_pin (QEP_Handle qepHandle, const QEP_Spsel_e QEP_SPsel) |
| Selects whether index or strobe pin is used for sync output. More... | |
| void | QEP_set_soft_init (QEP_Handle qepHandle, const QEPCTL_Swi_e QEPCTL_Swi) |
| Determines if software initialization of position counter enabled. More... | |
| void | QEP_set_strobe_event_init (QEP_Handle qepHandle, const QEPCTL_Sei_e QEPCTL_Sei) |
| Determines strobe initialization of position counter. More... | |
| void | QEP_set_strobe_event_latch (QEP_Handle qepHandle, const QEPCTL_Sel_e QEPCTL_Sel) |
| Sets up strobe latch of position counter. More... | |
| void | QEP_set_strobe_polarity (QEP_Handle qepHandle, const QEP_Qsp_e QEP_Qsp) |
| Sets up strobe polarity. More... | |
| void | QEP_set_swap_quad_inputs (QEP_Handle qepHandle, QEP_Swap_e QEP_Swap) |
| Sets up swapping of A/B channels. More... | |
| void | QEP_set_synch_output_compare_polarity (QEP_Handle qepHandle, const QPOSCTL_Pcpol_e QPOSCTL_Pcpol) |
| Sets synch output compare polarity. More... | |
| void | QEP_set_unit_period (QEP_Handle qepHandle, const uint32_t unit_period) |
| Sets unit timer period. More... | |
| void | QEP_set_unit_posn_prescale (QEP_Handle qepHandle, const QCAPCTL_Upps_e QCAPCTL_Upps) |
| Sets unit timer prescaling. More... | |
| void | QEP_set_watchdog_period (QEP_Handle qepHandle, const uint16_t watchdog_period) |
| Sets watchdog period. More... | |
| void | QEP_set_A_polarity (QEP_Handle qepHandle, const QEP_Qap_e QEP_Qap) |
| Sets A polarity. More... | |
| void | QEP_set_B_polarity (QEP_Handle qepHandle, const QEP_Qbp_e QEP_Qbp) |
| Sets B polarity. More... | |
| void | QEP_set_QEP_source (QEP_Handle qepHandle, const QEP_Qsrc_e QEP_Qsrc) |
| QEP counting mode. More... | |
| void | QEP_setup_strobe_event_latch (QEP_Handle qepHandle, const QEPCTL_Sel_e QEPCTL_Sel) |
| QEP strobe latch event. More... | |
| void | QEP_write_posn_compare (QEP_Handle qepHandle, const uint32_t posn) |
| Writes a value to the position compare register. More... | |
Contains public interface to various functions related to the quadrature pulse encoder (QEP) object.
(C) Copyright 2015, Texas Instruments, Inc.
Definition in file qep.h.
1.8.9.1