MotorWare f2806x Driver API Documentation
Data Structures | Macros | Typedefs | Enumerations | Functions
QEP

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...
 

Enumerations

enum  QEP_Qsrc_e { QEP_Qsrc_Quad_Count_Mode =(0 << 14), QEP_Qsrc_Dir_Count_Mode =(1 << 14), QEP_Qsrc_Up_Count_Mode =(2 << 14), QEP_Qsrc_Down_Count_Mode =(3 << 14) }
 QEP counting mode. More...
 
enum  QEP_Spsel_e { QEP_Spsel_Index_Pin_Sync_Output =(0 << 12), QEP_Spsel_Strobe_Pin_Sync_Output =(1 << 12) }
 Sync output pin selection. More...
 
enum  QEP_Xcr_e { QEP_Xcr_2x_Res =(0 << 11), QEP_Xcr_1x_Res =(1 << 11) }
 External clock rate. More...
 
enum  QEP_Swap_e { QEP_Swap_Not_Swapped =(0 << 10), QEP_Swap_Swapped =(1 << 10) }
 Swap A/B channels. More...
 
enum  QEP_Igate_e { QEP_Igate_Disable =(0 << 9), QEP_Igate_Enable =(1 << 9) }
 Index gating. More...
 
enum  QEP_Qap_e { QEP_Qap_No_Effect =(0 << 8), QEP_Qap_Inverted =(1 << 8) }
 Channel A polarity. More...
 
enum  QEP_Qbp_e { QEP_Qbp_No_Effect =(0 << 7), QEP_Qbp_Inverted =(1 << 7) }
 Channel B polarity. More...
 
enum  QEP_Qip_e { QEP_Qip_No_Effect =(0 << 6), QEP_Qip_Inverted =(1 << 6) }
 Index polarity. More...
 
enum  QEP_Qsp_e { QEP_Qsp_No_Effect =(0 << 5), QEP_Qsp_Inverted =(1 << 5) }
 Channel S polarity. More...
 
enum  QEPCTL_Freesoft_e { QEPCTL_Freesoft_Immediate_Halt =(0 << 14), QEPCTL_Freesoft_Rollover_Halt =(1 << 14), QEPCTL_Freesoft_Unaffected_Halt =(2 << 14) }
 Emulation control bits. More...
 
enum  QEPCTL_Pcrm_e { QEPCTL_Pcrm_Index_Reset =(0 << 12), QEPCTL_Pcrm_Max_Reset =(1 << 12), QEPCTL_Pcrm_First_Index_Reset =(2 << 12), QEPCTL_Pcrm_Unit_Time_Reset =(3 << 12) }
 Position counter reset mode. More...
 
enum  QEPCTL_Sei_e { QEPCTL_Sei_Nothing =(0 << 10), QEPCTL_Sei_Rising_Edge_Init =(2 << 10), QEPCTL_Sei_Rising_Falling_Edge_Init =(3 << 10) }
 Strobe event initialization of position counter. More...
 
enum  QEPCTL_Iei_e { QEPCTL_Iei_Nothing =(0 << 8), QEPCTL_Iei_Rising_Edge_Init =(2 << 8), QEPCTL_Iei_Rising_Falling_Edge_Init =(3 << 8) }
 Index event initialization of position counter. More...
 
enum  QEPCTL_Swi_e { QEPCTL_Swi_Nothing =(0 << 7), QEPCTL_Swi_Auto_Init_Counter =(1 << 7) }
 Software initialization of position counter. More...
 
enum  QEPCTL_Sel_e { QEPCTL_Sel_Rising_Edge =(0 << 6), QEPCTL_Sel_Rising_Falling_Edge =(1 << 6) }
 Strobe event latch of position counter. More...
 
enum  QEPCTL_Iel_e { QEPCTL_Iel_Rising_Edge =(1 << 4), QEPCTL_Iel_Falling_Edge =(2 << 4), QEPCTL_Iel_Software_Index_Marker =(3 << 4) }
 Index event latch of position counter (software index marker) More...
 
enum  QEPCTL_Qclm_e { QEPCTL_Qclm_Latch_on_CPU_Read =(0 << 2), QEPCTL_Qclm_Latch_on_Unit_Timeout =(1 << 2) }
 QEP capture latch mode. More...
 
enum  QPOSCTL_Pcshdw_e { QPOSCTL_Pcshdw_Load_Immediate =(0 << 15), QPOSCTL_Pcshdw_Shadow_Enabled =(1 << 15) }
 Position compare shadow enable. More...
 
enum  QPOSCTL_Pcload_e { QPOSCTL_Pcload_Load_Posn_Count_Zero =(0 << 14), QPOSCTL_Pcload_Load_Posn_Count_Equal_Compare =(1 << 14) }
 Position compare shadow load mode. More...
 
enum  QPOSCTL_Pcpol_e { QPOSCTL_Pcpol_Active_High =(0 << 13), QPOSCTL_Pcpol_Active_Low =(1 << 13) }
 Polarity of sync output. More...
 
enum  QCAPCTL_Ccps_e {
  QCAPCTL_Ccps_Capture_Div_1 =(0 << 4), QCAPCTL_Ccps_Capture_Div_2 =(1 << 4), QCAPCTL_Ccps_Capture_Div_4 =(2 << 4), QCAPCTL_Ccps_Capture_Div_8 =(3 << 4),
  QCAPCTL_Ccps_Capture_Div_16 =(4 << 4), QCAPCTL_Ccps_Capture_Div_32 =(5 << 4), QCAPCTL_Ccps_Capture_Div_64 =(6 << 4), QCAPCTL_Ccps_Capture_Div_128 =(7 << 4)
}
 QEP capture timer clock prescaler. More...
 
enum  QCAPCTL_Upps_e {
  QCAPCTL_Upps_Div_1_Prescale =(0 << 0), QCAPCTL_Upps_Div_2_Prescale =(1 << 0), QCAPCTL_Upps_Div_4_Prescale =(2 << 0), QCAPCTL_Upps_Div_8_Prescale =(3 << 0),
  QCAPCTL_Upps_Div_16_Prescale =(4 << 0), QCAPCTL_Upps_Div_32_Prescale =(5 << 0), QCAPCTL_Upps_Div_64_Prescale =(6 << 0), QCAPCTL_Upps_Div_128_Prescale =(7 << 0),
  QCAPCTL_Upps_Div_256_Prescale =(8 << 0), QCAPCTL_Upps_Div_512_Prescale =(9 << 0), QCAPCTL_Upps_Div_1024_Prescale =(10 << 0), QCAPCTL_Upps_Div_2048_Prescale =(11 << 0)
}
 Unit position event prescaler. More...
 
enum  QEINT_e {
  QEINT_Uto =(1 << 11), QEINT_Iel =(1 << 10), QEINT_Sel =(1 << 9), QEINT_Pcm =(1 << 8),
  QEINT_Pcr =(1 << 7), QEINT_Pco =(1 << 6), QEINT_Pcu =(1 << 5), QEINT_Wto =(1 << 4),
  QEINT_Qdc =(1 << 3), QEINT_Qpe =(1 << 2), QEINT_Pce =(1 << 1)
}
 QEP interrupt enable flags. More...
 
enum  QEP_qepsts_e {
  UPEVNT =(1 << 7), FDF = (1 << 6), QDF = (1 << 5), QDLF = (1 << 4),
  COEF = (1 << 3), CDEF = (1 << 2), FIMF = (1 << 1), PCEF = (1 << 0)
}
 QEP status bits. 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...
 

Detailed Description


Data Structure Documentation

struct _QEP_Obj_

Defines the QEP object.

Definition at line 407 of file qep.h.

Data Fields
uint16_t QCAPCTL QEP Capture Control.
uint16_t QCLR QEP Interrupt Clear Register.
uint16_t QCPRD QEP Capture Period.
uint16_t QCPRDLAT QEP Capture Period Latch.
uint16_t QCTMR QEP Capture Timer.
uint16_t QCTMRLAT QEP Capture Timer Latch.
uint16_t QDECCTL QEP Decoder Control.
uint16_t QEINT QEP Interrupt Enable Register.
uint16_t QEPCTL QEP Control.
uint16_t QEPSTS QEP Status Register.
uint16_t QFLG QEP Interrupt Flag Register.
uint16_t QFRC QEP Interrupt Force Register.
uint32_t QPOSCMP QEP Position Compare.
uint32_t QPOSCNT QEP Position Counter.
uint16_t QPOSCTL QEP Position Compare Control.
uint32_t QPOSILAT QEP Index Position Latch.
uint32_t QPOSINIT QEP Initialization Position Count.
uint32_t QPOSLAT QEP Position Latch.
uint32_t QPOSMAX QEP Maximum Position Count.
uint32_t QPOSSLAT QEP Strobe Position Latch.
uint32_t QUPRD QEP Unit Period.
uint32_t QUTMR QEP Unit Timer.
uint16_t QWDPRD QEP Watchdog Period.
uint16_t QWDTMR QEP Watchdog Timer.

Macro Definition Documentation

#define QEP1_BASE_ADDR   (0x00006B00)

Definition at line 69 of file qep.h.

#define QEP2_BASE_ADDR   (0x00006B40)

Definition at line 71 of file qep.h.

#define QEP_QCAPCTL_CCPS   ( 7 << 4)

qep capture timer clock prescaler

Definition at line 107 of file qep.h.

Referenced by QEP_set_capture_prescale().

#define QEP_QCAPCTL_CEN   ( 1 << 15)

enable QEP capture

Definition at line 106 of file qep.h.

Referenced by QEP_disable_capture(), and QEP_enable_capture().

#define QEP_QCAPCTL_UPPS   ( 15 << 0)

unit position event prescaler

Definition at line 108 of file qep.h.

Referenced by QEP_set_unit_posn_prescale().

#define QEP_QCLR_IEL   ( 1 << 10)

clear index event latch interrupt flag

Definition at line 138 of file qep.h.

#define QEP_QCLR_PCE   ( 1 << 1)

clear position counter error interrupt flag

Definition at line 147 of file qep.h.

#define QEP_QCLR_PCM   ( 1 << 8)

clear position compare match interrupt flag

Definition at line 140 of file qep.h.

#define QEP_QCLR_PCO   ( 1 << 6)

clear position counter overflow interrupt flag

Definition at line 142 of file qep.h.

#define QEP_QCLR_PCR   ( 1 << 7)

clear position compare ready interrupt flag

Definition at line 141 of file qep.h.

#define QEP_QCLR_PCU   ( 1 << 5)

clear position counter underflow interrupt flag

Definition at line 143 of file qep.h.

#define QEP_QCLR_QDC   ( 1 << 3)

clear quadrature direction change interrupt flag

Definition at line 145 of file qep.h.

#define QEP_QCLR_QPE   ( 1 << 2)

clear quadrature phase error interrupt flag

Definition at line 146 of file qep.h.

#define QEP_QCLR_SEL   ( 1 << 9)

clear strobe event latch interrupt flag

Definition at line 139 of file qep.h.

#define QEP_QCLR_UTO   ( 1 << 11)

clear unit timeout interrupt flag

Definition at line 137 of file qep.h.

#define QEP_QCLR_WTO   ( 1 << 4)

clear watchdog time out interrupt flag

Definition at line 144 of file qep.h.

#define QEP_QDECCTL_IGATE   (1 << 9)

index pulse gating option

Definition at line 79 of file qep.h.

Referenced by QEP_disable_gate_index().

#define QEP_QDECCTL_QAP   (1 << 8)

QEPA input polarity.

Definition at line 80 of file qep.h.

Referenced by QEP_set_A_polarity().

#define QEP_QDECCTL_QBP   (1 << 7)

QEPB input polarity.

Definition at line 81 of file qep.h.

Referenced by QEP_set_B_polarity().

#define QEP_QDECCTL_QIP   (1 << 6)

QEPI input polarity.

Definition at line 82 of file qep.h.

Referenced by QEP_set_index_polarity().

#define QEP_QDECCTL_QSP   (1 << 5)

QEPS input polarity.

Definition at line 83 of file qep.h.

Referenced by QEP_set_strobe_polarity().

#define QEP_QDECCTL_QSRC   (3 << 14)

position counter source selection

Definition at line 74 of file qep.h.

Referenced by QEP_set_QEP_source().

#define QEP_QDECCTL_SOEN   (1 << 13)

sync output enable

Definition at line 75 of file qep.h.

Referenced by QEP_disable_sync_out(), and QEP_enable_sync_out().

#define QEP_QDECCTL_SPSEL   (1 << 12)

sync output pin selection

Definition at line 76 of file qep.h.

Referenced by QEP_set_select_sync_pin().

#define QEP_QDECCTL_SWAP   (1 << 10)

swap quadrature clock inputs

Definition at line 78 of file qep.h.

Referenced by QEP_set_swap_quad_inputs().

#define QEP_QDECCTL_XCR   (1 << 11)

external clock rate

Definition at line 77 of file qep.h.

Referenced by QEP_set_ext_clock_rate().

#define QEP_QEINT_IEL   ( 1 << 10)

index event latch interrupt enable

Definition at line 112 of file qep.h.

#define QEP_QEINT_PCE   ( 1 << 1)

position counter error interrupt enable

Definition at line 121 of file qep.h.

#define QEP_QEINT_PCM   ( 1 << 8)

position compare match interrupt enable

Definition at line 114 of file qep.h.

#define QEP_QEINT_PCO   ( 1 << 6)

position counter overflow interrupt enable

Definition at line 116 of file qep.h.

#define QEP_QEINT_PCR   ( 1 << 7)

position compare ready interrupt enable

Definition at line 115 of file qep.h.

#define QEP_QEINT_PCU   ( 1 << 5)

position counter underflow interrupt enable

Definition at line 117 of file qep.h.

#define QEP_QEINT_QDC   ( 1 << 3)

quadrature direction change interrupt enable

Definition at line 119 of file qep.h.

#define QEP_QEINT_QPE   ( 1 << 2)

quadrature phase error interrupt enable

Definition at line 120 of file qep.h.

#define QEP_QEINT_SEL   ( 1 << 9)

strobe event latch interrupt enable

Definition at line 113 of file qep.h.

#define QEP_QEINT_UTO   ( 1 << 11)

unit timeout interrupt enable

Definition at line 111 of file qep.h.

#define QEP_QEINT_WTO   ( 1 << 4)

watchdog time out interrupt enable

Definition at line 118 of file qep.h.

#define QEP_QEPCTL_FREESOFT   ( 3 << 14)

emulation control bit

Definition at line 86 of file qep.h.

Referenced by QEP_set_emu_control().

#define QEP_QEPCTL_IEI   ( 3 << 8)

index event initialization of position counter

Definition at line 89 of file qep.h.

Referenced by QEP_set_index_event_init().

#define QEP_QEPCTL_IEL   ( 3 << 4)

index event latch of position counter (software index marker)

Definition at line 92 of file qep.h.

Referenced by QEP_set_index_event_latch().

#define QEP_QEPCTL_PCRM   ( 3 << 12)

emulation control bit

Definition at line 87 of file qep.h.

Referenced by QEP_set_posn_count_reset_mode().

#define QEP_QEPCTL_QCLM   ( 1 << 2)

QEP capture latch mode.

Definition at line 94 of file qep.h.

Referenced by QEP_set_capture_latch_mode().

#define QEP_QEPCTL_QPEN   ( 1 << 3)

quad position counter enable/software reset

Definition at line 93 of file qep.h.

Referenced by QEP_enable_counter(), and QEP_reset_counter().

#define QEP_QEPCTL_SEI   ( 3 << 10)

strobe event initialization of position counter

Definition at line 88 of file qep.h.

Referenced by QEP_set_strobe_event_init().

#define QEP_QEPCTL_SEL   ( 1 << 6)

strobe event latch of position counter

Definition at line 91 of file qep.h.

Referenced by QEP_set_strobe_event_latch(), and QEP_setup_strobe_event_latch().

#define QEP_QEPCTL_SWI   ( 1 << 7)

software initialization of position counter

Definition at line 90 of file qep.h.

Referenced by QEP_set_soft_init().

#define QEP_QEPCTL_UTE   ( 1 << 1)

QEP unit timer enable.

Definition at line 95 of file qep.h.

Referenced by QEP_disable_unit_timer(), and QEP_enable_unit_timer().

#define QEP_QEPCTL_WDE   ( 1 << 0)

watchdog timer enable

Definition at line 96 of file qep.h.

Referenced by QEP_disable_watchdog(), and QEP_enable_watchdog().

#define QEP_QEPSTS_CDEF   ( 1 << 2)

capture direction error flag

Definition at line 168 of file qep.h.

#define QEP_QEPSTS_COEF   ( 1 << 3)

capture overflow error flag

Definition at line 167 of file qep.h.

#define QEP_QEPSTS_FDF   ( 1 << 6)

direction on the first index marker

Definition at line 164 of file qep.h.

#define QEP_QEPSTS_FIMF   ( 1 << 1)

first index marker flag

Definition at line 169 of file qep.h.

#define QEP_QEPSTS_PCEF   ( 1 << 0)

position counter error flag

Definition at line 170 of file qep.h.

#define QEP_QEPSTS_QDF   ( 1 << 5)

quadrature direction flag

Definition at line 165 of file qep.h.

#define QEP_QEPSTS_QDLF   ( 1 << 4)

direction latch flag

Definition at line 166 of file qep.h.

#define QEP_QEPSTS_UPEVNT   ( 1 << 7)

unit position event flag

Definition at line 163 of file qep.h.

#define QEP_QFLG_IEL   ( 1 << 10)

index event latch interrupt flag

Definition at line 125 of file qep.h.

#define QEP_QFLG_PCE   ( 1 << 1)

position counter error interrupt flag

Definition at line 134 of file qep.h.

#define QEP_QFLG_PCM   ( 1 << 8)

position compare match interrupt flag

Definition at line 127 of file qep.h.

#define QEP_QFLG_PCO   ( 1 << 6)

position counter overflow interrupt flag

Definition at line 129 of file qep.h.

#define QEP_QFLG_PCR   ( 1 << 7)

position compare ready interrupt flag

Definition at line 128 of file qep.h.

#define QEP_QFLG_PCU   ( 1 << 5)

position counter underflow interrupt flag

Definition at line 130 of file qep.h.

#define QEP_QFLG_QDC   ( 1 << 3)

quadrature direction change interrupt flag

Definition at line 132 of file qep.h.

#define QEP_QFLG_QPE   ( 1 << 2)

quadrature phase error interrupt flag

Definition at line 133 of file qep.h.

#define QEP_QFLG_SEL   ( 1 << 9)

strobe event latch interrupt flag

Definition at line 126 of file qep.h.

#define QEP_QFLG_UTO   ( 1 << 11)

unit timeout interrupt flag

Definition at line 124 of file qep.h.

#define QEP_QFLG_WTO   ( 1 << 4)

watchdog time out interrupt flag

Definition at line 131 of file qep.h.

#define QEP_QFRC_IEL   ( 1 << 10)

force index event latch interrupt

Definition at line 151 of file qep.h.

#define QEP_QFRC_PCE   ( 1 << 1)

force position counter error interrupt

Definition at line 160 of file qep.h.

#define QEP_QFRC_PCM   ( 1 << 8)

force position compare match interrupt

Definition at line 153 of file qep.h.

#define QEP_QFRC_PCO   ( 1 << 6)

force position counter overflow interrupt

Definition at line 155 of file qep.h.

#define QEP_QFRC_PCR   ( 1 << 7)

force position compare ready interrupt

Definition at line 154 of file qep.h.

#define QEP_QFRC_PCU   ( 1 << 5)

force position counter underflow interrupt

Definition at line 156 of file qep.h.

#define QEP_QFRC_QDC   ( 1 << 3)

force quadrature direction change interrupt

Definition at line 158 of file qep.h.

#define QEP_QFRC_QPE   ( 1 << 2)

force quadrature phase error interrupt

Definition at line 159 of file qep.h.

#define QEP_QFRC_SEL   ( 1 << 9)

force strobe event latch interrupt

Definition at line 152 of file qep.h.

#define QEP_QFRC_UTO   ( 1 << 11)

force unit timeout interrupt

Definition at line 150 of file qep.h.

#define QEP_QFRC_WTO   ( 1 << 4)

force watchdog time out interrupt

Definition at line 157 of file qep.h.

#define QEP_QPOSCTL_PCE   ( 1 << 12)

position compare enable/disable

Definition at line 102 of file qep.h.

Referenced by QEP_disable_posn_compare(), and QEP_enable_posn_compare().

#define QEP_QPOSCTL_PCLOAD   ( 1 << 14)

position compare shadow load mode

Definition at line 100 of file qep.h.

Referenced by QEP_set_posn_compare_shadow_load().

#define QEP_QPOSCTL_PCPOL   ( 1 << 13)

load when QPOSCNT = QPOSCMP

Definition at line 101 of file qep.h.

Referenced by QEP_set_synch_output_compare_polarity().

#define QEP_QPOSCTL_PCSHDW   ( 1 << 15)

position compare shadow enable

Definition at line 99 of file qep.h.

Referenced by QEP_disable_posn_compare_shadow(), and QEP_enable_posn_compare_shadow().

#define QEP_QPOSCTL_PCSPW   (4095 << 0)

selection position compare sync output pulse width

Definition at line 103 of file qep.h.

Referenced by QEP_set_posn_compare_pulse_width().

Typedef Documentation

typedef struct _QEP_Obj_* QEP_Handle

Defines the QEP handle.

Definition at line 438 of file qep.h.

typedef struct _QEP_Obj_ QEP_Obj

Defines the QEP object.

Enumeration Type Documentation

QEP capture timer clock prescaler.

Enumerator
QCAPCTL_Ccps_Capture_Div_1 

capclk = sysclkout/1

QCAPCTL_Ccps_Capture_Div_2 

capclk = sysclkout/2

QCAPCTL_Ccps_Capture_Div_4 

capclk = sysclkout/4

QCAPCTL_Ccps_Capture_Div_8 

capclk = sysclkout/8

QCAPCTL_Ccps_Capture_Div_16 

capclk = sysclkout/16

QCAPCTL_Ccps_Capture_Div_32 

capclk = sysclkout/32

QCAPCTL_Ccps_Capture_Div_64 

capclk = sysclkout/64

QCAPCTL_Ccps_Capture_Div_128 

capclk = sysclkout/128

Definition at line 345 of file qep.h.

Unit position event prescaler.

Enumerator
QCAPCTL_Upps_Div_1_Prescale 

upevnt = qclk/1

QCAPCTL_Upps_Div_2_Prescale 

upevnt = qclk/2

QCAPCTL_Upps_Div_4_Prescale 

upevnt = qclk/4

QCAPCTL_Upps_Div_8_Prescale 

upevnt = qclk/8

QCAPCTL_Upps_Div_16_Prescale 

upevnt = qclk/16

QCAPCTL_Upps_Div_32_Prescale 

upevnt = qclk/32

QCAPCTL_Upps_Div_64_Prescale 

upevnt = qclk/64

QCAPCTL_Upps_Div_128_Prescale 

upevnt = qclk/128

QCAPCTL_Upps_Div_256_Prescale 

upevnt = qclk/256

QCAPCTL_Upps_Div_512_Prescale 

upevnt = qclk/512

QCAPCTL_Upps_Div_1024_Prescale 

upevnt = qclk/1024

QCAPCTL_Upps_Div_2048_Prescale 

upevnt = qclk/2048

Definition at line 359 of file qep.h.

enum QEINT_e

QEP interrupt enable flags.

Enumerator
QEINT_Uto 

unit time out interrupt enable

QEINT_Iel 

index event latch interrupt enable

QEINT_Sel 

strobe event latch interrupt enable

QEINT_Pcm 

position compare match interrupt enable

QEINT_Pcr 

position compare ready interrupt enable

QEINT_Pco 

position compare overflow interrupt enable

QEINT_Pcu 

position compare underflow interrupt enable

QEINT_Wto 

position compare watchdog time out interrupt enable

QEINT_Qdc 

quadrature direction change interrupt enable

QEINT_Qpe 

quadrature phase error interrupt enable

QEINT_Pce 

position counter interrupt enable

Definition at line 376 of file qep.h.

Index gating.

Enumerator
QEP_Igate_Disable 

disable gating of index pulse

QEP_Igate_Enable 

enable gating of index pulse

Definition at line 211 of file qep.h.

enum QEP_Qap_e

Channel A polarity.

Enumerator
QEP_Qap_No_Effect 

no effect

QEP_Qap_Inverted 

negates QEPA input

Definition at line 219 of file qep.h.

enum QEP_Qbp_e

Channel B polarity.

Enumerator
QEP_Qbp_No_Effect 

no effect

QEP_Qbp_Inverted 

negates QEPB input

Definition at line 227 of file qep.h.

QEP status bits.

Enumerator
UPEVNT 

unit position event flag

FDF 

direction on the first index marker

QDF 

quadrature direction flag

QDLF 

direction latch flag

COEF 

capture overflow error flag

CDEF 

capture direction error flag

FIMF 

first index marker flag

PCEF 

position counter error flag

Definition at line 393 of file qep.h.

enum QEP_Qip_e

Index polarity.

Enumerator
QEP_Qip_No_Effect 

no effect

QEP_Qip_Inverted 

negates QEPI input

Definition at line 235 of file qep.h.

enum QEP_Qsp_e

Channel S polarity.

Enumerator
QEP_Qsp_No_Effect 

no effect

QEP_Qsp_Inverted 

negates QEPS input

Definition at line 243 of file qep.h.

enum QEP_Qsrc_e

QEP counting mode.

Enumerator
QEP_Qsrc_Quad_Count_Mode 

quadrature count mode

QEP_Qsrc_Dir_Count_Mode 

direction count mode

QEP_Qsrc_Up_Count_Mode 

up count mode for frequency measurement (QCLK=XCLK, QDIR=1)

QEP_Qsrc_Down_Count_Mode 

down count mode for frequency measurement (QCLK=XCLK, QDIR=0)

Definition at line 177 of file qep.h.

Sync output pin selection.

Enumerator
QEP_Spsel_Index_Pin_Sync_Output 

index pin for sync output

QEP_Spsel_Strobe_Pin_Sync_Output 

strobe pin for sync output

Definition at line 187 of file qep.h.

enum QEP_Swap_e

Swap A/B channels.

Enumerator
QEP_Swap_Not_Swapped 

quad inputs not swapped

QEP_Swap_Swapped 

quad inputs swapped

Definition at line 203 of file qep.h.

enum QEP_Xcr_e

External clock rate.

Enumerator
QEP_Xcr_2x_Res 

2x resolution: count the rising/falling edge

QEP_Xcr_1x_Res 

1x resolution: count the rising edge only

Definition at line 195 of file qep.h.

Emulation control bits.

Enumerator
QEPCTL_Freesoft_Immediate_Halt 

position, watchdog, unit timer, capture timer stops immediately

QEPCTL_Freesoft_Rollover_Halt 

position, watchdog, unit timer continues until rollover, capture counts until next unit period event

QEPCTL_Freesoft_Unaffected_Halt 

position, watchdog, unit timer, capture timer unaffected by emu suspend

Definition at line 251 of file qep.h.

Index event initialization of position counter.

Enumerator
QEPCTL_Iei_Nothing 

does nothing

QEPCTL_Iei_Rising_Edge_Init 

initializes on rising edge of QEPI signal

QEPCTL_Iei_Rising_Falling_Edge_Init 

initializes on falling edge of QEPS signal

Definition at line 279 of file qep.h.

Index event latch of position counter (software index marker)

Enumerator
QEPCTL_Iel_Rising_Edge 

latches position counter on rising edge of index signal

QEPCTL_Iel_Falling_Edge 

ditto on falling edge of index signal

QEPCTL_Iel_Software_Index_Marker 

software index marker. See data sheet.

Definition at line 304 of file qep.h.

Position counter reset mode.

Enumerator
QEPCTL_Pcrm_Index_Reset 

position counter reset on index event

QEPCTL_Pcrm_Max_Reset 

position counter reset on max position

QEPCTL_Pcrm_First_Index_Reset 

position counter reset on first index event

QEPCTL_Pcrm_Unit_Time_Reset 

position counter reset on unit time event

Definition at line 260 of file qep.h.

QEP capture latch mode.

Enumerator
QEPCTL_Qclm_Latch_on_CPU_Read 

latch on position counter read by cpu

QEPCTL_Qclm_Latch_on_Unit_Timeout 

latch on unit time out

Definition at line 313 of file qep.h.

Strobe event initialization of position counter.

Enumerator
QEPCTL_Sei_Nothing 

does nothing

QEPCTL_Sei_Rising_Edge_Init 

initializes on rising edge of QEPS signal

QEPCTL_Sei_Rising_Falling_Edge_Init 

initializes on rising/falling edge of QEPS signal

Definition at line 270 of file qep.h.

Strobe event latch of position counter.

Enumerator
QEPCTL_Sel_Rising_Edge 

Position counter latched on rising edge of QEPS strobe (QPOSSLAT = POSCCNT)

QEPCTL_Sel_Rising_Falling_Edge 

Clockwise: position counter latched on rising edge, counter clockwise: latched on falling edge.

Definition at line 296 of file qep.h.

Software initialization of position counter.

Enumerator
QEPCTL_Swi_Nothing 

does nothing

QEPCTL_Swi_Auto_Init_Counter 

init position counter (QPOSCNT=QPOSINIT)

Definition at line 288 of file qep.h.

Position compare shadow load mode.

Enumerator
QPOSCTL_Pcload_Load_Posn_Count_Zero 

load on qposcnt = 0

QPOSCTL_Pcload_Load_Posn_Count_Equal_Compare 

load when qposcnt = qposcmp

Definition at line 329 of file qep.h.

Polarity of sync output.

Enumerator
QPOSCTL_Pcpol_Active_High 

active high pulse output

QPOSCTL_Pcpol_Active_Low 

active low pulse output

Definition at line 337 of file qep.h.

Position compare shadow enable.

Enumerator
QPOSCTL_Pcshdw_Load_Immediate 

shadow disabled, load immediate

QPOSCTL_Pcshdw_Shadow_Enabled 

shadow enabled

Definition at line 321 of file qep.h.

Function Documentation

void QEP_clear_all_interrupt_flags ( QEP_Handle  qepHandle)
inline

Clears all QEP interrupt flags.

Parameters
[in]qepHandleandle to QEP object

Definition at line 450 of file qep.h.

References _QEP_Obj_::QCLR.

void QEP_clear_interrupt_flag ( QEP_Handle  qepHandle,
const QEINT_e  QEINT 
)
inline

Clears a single interrupt flag.

Parameters
[in]qepHandleHandle to QEP object
[in]QEINTInterrupt flag

Definition at line 462 of file qep.h.

References _QEP_Obj_::QCLR, and _QEP_Obj_::QEINT.

void QEP_clear_posn_counter ( QEP_Handle  qepHandle)
inline

Clears the position counter.

Parameters
[in]qepHandleHandle to QEP object

Definition at line 473 of file qep.h.

References _QEP_Obj_::QPOSCNT.

void QEP_disable_all_interrupts ( QEP_Handle  qepHandle)
inline

Disables all interrupts.

Parameters
[in]qepHandleHandle to QEP object

Definition at line 484 of file qep.h.

References _QEP_Obj_::QEINT.

void QEP_disable_capture ( QEP_Handle  qepHandle)
inline

Disable capture.

Parameters
[in]qepHandleHandle to QEP object

Definition at line 495 of file qep.h.

References _QEP_Obj_::QCAPCTL, and QEP_QCAPCTL_CEN.

void QEP_disable_gate_index ( QEP_Handle  qepHandle)
inline

Disable gating of index pulse.

Parameters
[in]qepHandleHandle to QEP object

Definition at line 506 of file qep.h.

References _QEP_Obj_::QDECCTL, and QEP_QDECCTL_IGATE.

void QEP_disable_interrupt ( QEP_Handle  qepHandle,
const QEINT_e  QEINT 
)
inline

Disable individual interrupt.

Parameters
[in]qepHandleHandle to QEP object
[in]QEINTIndividual interrupts

Definition at line 518 of file qep.h.

References _QEP_Obj_::QEINT.

void QEP_disable_posn_compare ( QEP_Handle  qepHandle)
inline

Disable position compare.

Parameters
[in]qepHandleHandle to QEP object

Definition at line 529 of file qep.h.

References QEP_QPOSCTL_PCE, and _QEP_Obj_::QPOSCTL.

void QEP_disable_posn_compare_shadow ( QEP_Handle  qepHandle)
inline

Disable position compare shadowing.

Parameters
[in]qepHandleHandle to QEP object

Definition at line 540 of file qep.h.

References QEP_QPOSCTL_PCSHDW, and _QEP_Obj_::QPOSCTL.

void QEP_disable_sync_out ( QEP_Handle  qepHandle)
inline

Disable output sync pulse.

Parameters
[in]qepHandleHandle to QEP object

Definition at line 551 of file qep.h.

References _QEP_Obj_::QDECCTL, and QEP_QDECCTL_SOEN.

void QEP_disable_unit_timer ( QEP_Handle  qepHandle)
inline

Disable unit timer.

Parameters
[in]qepHandleHandle to QEP object

Definition at line 562 of file qep.h.

References QEP_QEPCTL_UTE, and _QEP_Obj_::QEPCTL.

void QEP_disable_watchdog ( QEP_Handle  qepHandle)
inline

Disable watchdog timer.

Parameters
[in]qepHandleHandle to QEP object

Definition at line 573 of file qep.h.

References QEP_QEPCTL_WDE, and _QEP_Obj_::QEPCTL.

void QEP_enable_capture ( QEP_Handle  qepHandle)
inline

Enable capture.

Parameters
[in]qepHandleHandle to QEP object

Definition at line 584 of file qep.h.

References _QEP_Obj_::QCAPCTL, and QEP_QCAPCTL_CEN.

void QEP_enable_counter ( QEP_Handle  qepHandle)
inline

Enable counter.

Parameters
[in]qepHandleHandle to QEP object

Definition at line 595 of file qep.h.

References QEP_QEPCTL_QPEN, and _QEP_Obj_::QEPCTL.

void QEP_enable_gate_index ( QEP_Handle  qepHandle)
inline

Enable gating of index pulse.

Parameters
[in]qepHandleHandle to QEP object

Definition at line 606 of file qep.h.

References _QEP_Obj_::QDECCTL, and QEP_Igate_Enable.

void QEP_enable_interrupt ( QEP_Handle  qepHandle,
const QEINT_e  QEINT 
)
inline

Enable individual interrupt.

Parameters
[in]qepHandleHandle to QEP object
[in]QEINTIndividual interrupts

Definition at line 618 of file qep.h.

References _QEP_Obj_::QEINT.

void QEP_enable_posn_compare ( QEP_Handle  qepHandle)
inline

Enable position compare.

Parameters
[in]qepHandleHandle to QEP object

Definition at line 629 of file qep.h.

References QEP_QPOSCTL_PCE, and _QEP_Obj_::QPOSCTL.

void QEP_enable_posn_compare_shadow ( QEP_Handle  qepHandle)
inline

Enable position compare shadowing.

Parameters
[in]qepHandleHandle to QEP object

Definition at line 640 of file qep.h.

References QEP_QPOSCTL_PCSHDW, and _QEP_Obj_::QPOSCTL.

void QEP_enable_sync_out ( QEP_Handle  qepHandle)
inline

Enable output sync pulse.

Parameters
[in]qepHandleHandle to QEP object

Definition at line 651 of file qep.h.

References _QEP_Obj_::QDECCTL, and QEP_QDECCTL_SOEN.

void QEP_enable_unit_timer ( QEP_Handle  qepHandle)
inline

Enable unit timer.

Parameters
[in]qepHandleHandle to QEP object

Definition at line 662 of file qep.h.

References QEP_QEPCTL_UTE, and _QEP_Obj_::QEPCTL.

void QEP_enable_watchdog ( QEP_Handle  qepHandle)
inline

Enable watchdog timer.

Parameters
[in]qepHandleHandle to QEP object

Definition at line 673 of file qep.h.

References QEP_QEPCTL_WDE, and _QEP_Obj_::QEPCTL.

void QEP_force_interrupt ( QEP_Handle  qepHandle,
const QEINT_e  QEINT 
)
inline

Manually force QEP interrupt.

Parameters
[in]qepHandleHandle to QEP object
[in]QEINTIndividual interrupt

Definition at line 685 of file qep.h.

References _QEP_Obj_::QEINT, and _QEP_Obj_::QFRC.

QEP_Handle QEP_init ( void *  pMemory,
const size_t  numBytes 
)

Initializes the QEP object.

Parameters
[in]pMemoryMemory pointer for new object
[in]numBytesObject size
Returns
QEP Handle

Definition at line 57 of file qep.c.

uint16_t QEP_read_capture_period_latch ( QEP_Handle  qepHandle)
inline

Reads capture period latch.

Parameters
[in]qepHandleHandle to QEP object
Returns
Counter value

Definition at line 703 of file qep.h.

References _QEP_Obj_::QCPRDLAT.

uint16_t QEP_read_capture_timer_latch ( QEP_Handle  qepHandle)
inline

Reads timer latch.

Parameters
[in]qepHandleHandle to QEP object
Returns
Timer value

Definition at line 713 of file qep.h.

References _QEP_Obj_::QCTMRLAT.

uint16_t QEP_read_interrupt_flag ( QEP_Handle  qepHandle,
const QEINT_e  QEINT 
)
inline

Reads interrupt flag value.

Parameters
[in]qepHandleHandle to QEP object
[in]QEINTWhich interrupt to interrogate
Returns
Interrupt flag value

Definition at line 724 of file qep.h.

References _QEP_Obj_::QEINT, and _QEP_Obj_::QFLG.

uint32_t QEP_read_posn_compare ( QEP_Handle  qepHandle)
inline

Reads position compare register.

Parameters
[in]qepHandleHandle to QEP object
Returns
Counter value

Definition at line 734 of file qep.h.

References _QEP_Obj_::QPOSCMP.

uint32_t QEP_read_posn_count ( QEP_Handle  qepHandle)
inline

Reads position counter.

Parameters
[in]qepHandleHandle to QEP object
Returns
Counter value

Definition at line 744 of file qep.h.

References _QEP_Obj_::QPOSCNT.

uint32_t QEP_read_posn_index_latch ( QEP_Handle  qepHandle)
inline

Reads position counter value index pulse latch register.

Parameters
[in]qepHandleHandle to QEP object
Returns
Counter value

Definition at line 754 of file qep.h.

References _QEP_Obj_::QPOSILAT.

uint32_t QEP_read_posn_latch ( QEP_Handle  qepHandle)
inline

Reads position counter value.

Parameters
[in]qepHandleHandle to QEP object
Returns
Counter value

Definition at line 764 of file qep.h.

References _QEP_Obj_::QPOSLAT.

uint32_t QEP_read_posn_strobe_latch ( QEP_Handle  qepHandle)
inline

Reads position strobe latch.

Parameters
[in]qepHandleHandle to QEP object
Returns
Counter value

Definition at line 774 of file qep.h.

References _QEP_Obj_::QPOSSLAT.

uint16_t QEP_read_status ( QEP_Handle  qepHandle)
inline

Reads status register.

Parameters
[in]qepHandleHandle to QEP object
Returns
Status register value

Definition at line 784 of file qep.h.

References _QEP_Obj_::QEPSTS.

void QEP_reset_counter ( QEP_Handle  qepHandle)
inline

Resets counter.

Parameters
[in]qepHandleHandle to QEP object

Definition at line 793 of file qep.h.

References QEP_QEPCTL_QPEN, and _QEP_Obj_::QEPCTL.

void QEP_reset_status ( QEP_Handle  qepHandle,
const QEP_qepsts_e  qepsts 
)
inline

Resets the individual QEP status register bits.

Parameters
[in]qepHandleHandle to QEP object
[in]qepstsEnumeration selection of the QEP status flag to reset

Definition at line 805 of file qep.h.

References _QEP_Obj_::QEPSTS.

void QEP_set_A_polarity ( QEP_Handle  qepHandle,
const QEP_Qap_e  QEP_Qap 
)
inline

Sets A polarity.

Parameters
[in]qepHandleHandle to QEP object
[in]QEP_QapChannel A polarity

Definition at line 1111 of file qep.h.

References _QEP_Obj_::QDECCTL, and QEP_QDECCTL_QAP.

void QEP_set_B_polarity ( QEP_Handle  qepHandle,
const QEP_Qbp_e  QEP_Qbp 
)
inline

Sets B polarity.

Parameters
[in]qepHandleHandle to QEP object
[in]QEP_QbpChannel B polarity

Definition at line 1124 of file qep.h.

References _QEP_Obj_::QDECCTL, and QEP_QDECCTL_QBP.

void QEP_set_capture_latch_mode ( QEP_Handle  qepHandle,
const QEPCTL_Qclm_e  QEPCTL_Qclm 
)
inline

Sets capture latch mode.

Parameters
[in]qepHandleHandle to QEP object
[in]QEPCTL_Qclmcapture latch mode

Definition at line 817 of file qep.h.

References QEP_QEPCTL_QCLM, and _QEP_Obj_::QEPCTL.

void QEP_set_capture_period ( QEP_Handle  qepHandle,
const uint16_t  period 
)
inline

Sets capture period.

Parameters
[in]qepHandleHandle to QEP object
[in]periodCapture period

Definition at line 830 of file qep.h.

References _QEP_Obj_::QCPRD.

void QEP_set_capture_prescale ( QEP_Handle  qepHandle,
const QCAPCTL_Ccps_e  QCAPCTL_Ccps 
)
inline

Sets capture pre-scaler.

Parameters
[in]qepHandleHandle to QEP object
[in]QCAPCTL_CcpsCapture pre-scaler

Definition at line 842 of file qep.h.

References _QEP_Obj_::QCAPCTL, and QEP_QCAPCTL_CCPS.

void QEP_set_emu_control ( QEP_Handle  qepHandle,
const QEPCTL_Freesoft_e  QEPCTL_Freesoft 
)
inline

Sets emulation control.

Parameters
[in]qepHandleHandle to QEP object
[in]QEPCTL_FreesoftEmulation control bits

Definition at line 853 of file qep.h.

References QEP_QEPCTL_FREESOFT, and _QEP_Obj_::QEPCTL.

void QEP_set_ext_clock_rate ( QEP_Handle  qepHandle,
const QEP_Xcr_e  QEP_Xcr 
)
inline

Sets external clock rate.

Parameters
[in]qepHandleHandle to QEP object
[in]QEP_XcrExternal clock rate

Definition at line 866 of file qep.h.

References _QEP_Obj_::QDECCTL, and QEP_QDECCTL_XCR.

void QEP_set_index_event_init ( QEP_Handle  qepHandle,
const QEPCTL_Iei_e  QEPCTL_Iei 
)
inline

Sets the event which initializes the counter register.

Parameters
[in]qepHandleHandle to QEP object
[in]QEPCTL_IeiIndex event

Definition at line 879 of file qep.h.

References QEP_QEPCTL_IEI, and _QEP_Obj_::QEPCTL.

void QEP_set_index_event_latch ( QEP_Handle  qepHandle,
const QEPCTL_Iel_e  QEPCTL_Iel 
)
inline

Sets the index event which latches the position counter.

Parameters
[in]qepHandleHandle to QEP object
[in]QEPCTL_IelLatch event

Definition at line 892 of file qep.h.

References QEP_QEPCTL_IEL, and _QEP_Obj_::QEPCTL.

void QEP_set_index_polarity ( QEP_Handle  qepHandle,
const QEP_Qip_e  QEP_Qip 
)
inline

Sets index polarity.

Parameters
[in]qepHandleHandle to QEP object
[in]QEP_QipIndex polarity

Definition at line 905 of file qep.h.

References _QEP_Obj_::QDECCTL, and QEP_QDECCTL_QIP.

void QEP_set_max_posn_count ( QEP_Handle  qepHandle,
const uint32_t  max_count 
)
inline

Sets max position count.

Parameters
[in]qepHandleHandle to QEP object
[in]max_countMaximum counter value

Definition at line 918 of file qep.h.

References _QEP_Obj_::QPOSMAX.

void QEP_set_posn_compare_pulse_width ( QEP_Handle  qepHandle,
const uint16_t  pulse_width 
)
inline

Sets output pulse width when a match occur.

Parameters
[in]qepHandleHandle to QEP object
[in]pulse_widthPulse width value

Definition at line 930 of file qep.h.

References QEP_QPOSCTL_PCSPW, and _QEP_Obj_::QPOSCTL.

void QEP_set_posn_compare_shadow_load ( QEP_Handle  qepHandle,
const QPOSCTL_Pcload_e  QPOSCTL_Pcload 
)
inline

Sets position compare shadow load mode.

Parameters
[in]qepHandleHandle to QEP object
[in]QPOSCTL_PcloadPC load event

Definition at line 945 of file qep.h.

References QEP_QPOSCTL_PCLOAD, and _QEP_Obj_::QPOSCTL.

void QEP_set_posn_count_reset_mode ( QEP_Handle  qepHandle,
const QEPCTL_Pcrm_e  QEPCTL_Pcrm 
)
inline

Sets position counter reset mode.

Parameters
[in]qepHandleHandle to QEP object
[in]QEPCTL_PcrmPosition counter reset mode

Definition at line 958 of file qep.h.

References QEP_QEPCTL_PCRM, and _QEP_Obj_::QEPCTL.

void QEP_set_posn_init_count ( QEP_Handle  qepHandle,
const uint32_t  init_count 
)
inline

Sets initial position counter value.

Parameters
[in]qepHandleHandle to QEP object
[in]init_countinitial counter value

Definition at line 971 of file qep.h.

References _QEP_Obj_::QPOSINIT.

void QEP_set_QEP_source ( QEP_Handle  qepHandle,
const QEP_Qsrc_e  QEP_Qsrc 
)
inline

QEP counting mode.

Parameters
[in]qepHandleHandle to QEP object
[in]QEP_QsrcSets QEP counting mode

Definition at line 1137 of file qep.h.

References _QEP_Obj_::QDECCTL, and QEP_QDECCTL_QSRC.

void QEP_set_select_sync_pin ( QEP_Handle  qepHandle,
const QEP_Spsel_e  QEP_SPsel 
)
inline

Selects whether index or strobe pin is used for sync output.

Parameters
[in]qepHandleHandle to QEP object
[in]QEP_SPselSelected pin

Definition at line 983 of file qep.h.

References _QEP_Obj_::QDECCTL, and QEP_QDECCTL_SPSEL.

void QEP_set_soft_init ( QEP_Handle  qepHandle,
const QEPCTL_Swi_e  QEPCTL_Swi 
)
inline

Determines if software initialization of position counter enabled.

Parameters
[in]qepHandleHandle to QEP object
[in]QEPCTL_SwiEnable/disable position counter initialization

Definition at line 996 of file qep.h.

References QEP_QEPCTL_SWI, and _QEP_Obj_::QEPCTL.

void QEP_set_strobe_event_init ( QEP_Handle  qepHandle,
const QEPCTL_Sei_e  QEPCTL_Sei 
)
inline

Determines strobe initialization of position counter.

Parameters
[in]qepHandleHandle to QEP object
[in]QEPCTL_SeiStrobe initialization of position counter (disabled, rising edge of QEPI) or rising/falling depending on direction

Definition at line 1009 of file qep.h.

References QEP_QEPCTL_SEI, and _QEP_Obj_::QEPCTL.

void QEP_set_strobe_event_latch ( QEP_Handle  qepHandle,
const QEPCTL_Sel_e  QEPCTL_Sel 
)
inline

Sets up strobe latch of position counter.

Parameters
[in]qepHandleHandle to QEP object
[in]QEPCTL_SelSets strobe latch of position counter

Definition at line 1022 of file qep.h.

References QEP_QEPCTL_SEL, and _QEP_Obj_::QEPCTL.

void QEP_set_strobe_polarity ( QEP_Handle  qepHandle,
const QEP_Qsp_e  QEP_Qsp 
)
inline

Sets up strobe polarity.

Parameters
[in]qepHandleHandle to QEP object
[in]QEP_QspStrobe polarity

Definition at line 1035 of file qep.h.

References _QEP_Obj_::QDECCTL, and QEP_QDECCTL_QSP.

void QEP_set_swap_quad_inputs ( QEP_Handle  qepHandle,
QEP_Swap_e  QEP_Swap 
)
inline

Sets up swapping of A/B channels.

Parameters
[in]qepHandleHandle to QEP object
[in]QEP_SwapSwap/don't swap A/B channels

Definition at line 1048 of file qep.h.

References _QEP_Obj_::QDECCTL, and QEP_QDECCTL_SWAP.

void QEP_set_synch_output_compare_polarity ( QEP_Handle  qepHandle,
const QPOSCTL_Pcpol_e  QPOSCTL_Pcpol 
)
inline

Sets synch output compare polarity.

Parameters
[in]qepHandleHandle to QEP object
[in]QPOSCTL_PcpolPolarity of sync output

Definition at line 1061 of file qep.h.

References QEP_QPOSCTL_PCPOL, and _QEP_Obj_::QPOSCTL.

void QEP_set_unit_period ( QEP_Handle  qepHandle,
const uint32_t  unit_period 
)
inline

Sets unit timer period.

Parameters
[in]qepHandleHandle to QEP object
[in]unit_periodUnit period

Definition at line 1074 of file qep.h.

References _QEP_Obj_::QUPRD.

void QEP_set_unit_posn_prescale ( QEP_Handle  qepHandle,
const QCAPCTL_Upps_e  QCAPCTL_Upps 
)
inline

Sets unit timer prescaling.

Parameters
[in]qepHandleHandle to QEP object
[in]QCAPCTL_UppsUnit timer prescaling

Definition at line 1086 of file qep.h.

References _QEP_Obj_::QCAPCTL, and QEP_QCAPCTL_UPPS.

void QEP_set_watchdog_period ( QEP_Handle  qepHandle,
const uint16_t  watchdog_period 
)
inline

Sets watchdog period.

Parameters
[in]qepHandleHandle to QEP object
[in]watchdog_periodWatchdog period

Definition at line 1099 of file qep.h.

References _QEP_Obj_::QWDPRD.

void QEP_setup_strobe_event_latch ( QEP_Handle  qepHandle,
const QEPCTL_Sel_e  QEPCTL_Sel 
)
inline

QEP strobe latch event.

Parameters
[in]qepHandleHandle to QEP object
[in]QEPCTL_SelSets QEP strobe latch event

Definition at line 1152 of file qep.h.

References QEP_QEPCTL_SEL, and _QEP_Obj_::QEPCTL.

void QEP_write_posn_compare ( QEP_Handle  qepHandle,
const uint32_t  posn 
)
inline

Writes a value to the position compare register.

Parameters
[in]qepHandleHandle to QEP object
[in]posnPosition compare register value

Definition at line 1166 of file qep.h.

References _QEP_Obj_::QPOSCMP.