AVR1600 Using the XMEGA Quadrature Decoder
qdec_driver.h
Go to the documentation of this file.
1 /* This file has been prepared for Doxygen automatic documentation generation. */
57 #ifndef __QDEC_DRIVER_H__
58 #define __QDEC_DRIVER_H__
59 
60 
61 #include "avr_compiler.h"
62 
63 #define CW_DIR 0 /* Clockwise direction. */
64 #define CCW_DIR 1 /* Counter Clockwise direction. */
65 
66 /* Definitions of macros. */
67 
72 #define GetCaptureValue(_tc) ( _tc.CCA )
73 
74 
75 /* Prototyping of functions. */
76 
77 bool QDEC_Total_Setup(PORT_t * qPort,
78  uint8_t qPin,
79  bool invIO,
80  uint8_t qEvMux,
81  EVSYS_CHMUX_t qPinInput,
82  bool useIndex,
83  EVSYS_QDIRM_t qIndexState,
84  TC0_t * qTimer,
85  TC_EVSEL_t qEventChannel,
86  uint8_t lineCount);
87 
88 bool QDEC_Port_Setup(PORT_t * qPort, uint8_t qPin, bool useIndex, bool invIO);
89 
90 bool QDEC_EVSYS_Setup(uint8_t qEvMux,
91  EVSYS_CHMUX_t qPinInput,
92  bool useIndex,
93  EVSYS_QDIRM_t qIndexState );
94 
95 void QDEC_TC_Dec_Setup(TC0_t * qTimer,
96  TC_EVSEL_t qEventChannel,
97  uint8_t lineCount);
98 
99 void QDEC_TC_Freq_Setup(TC0_t * qTimer,
100  TC_EVSEL_t qEventChannel,
101  EVSYS_CHMUX_t qPinInput,
102  TC_CLKSEL_t clksel);
103 
104 uint8_t QDEC_Get_Direction(TC0_t * qTimer);
105 
106 #endif /* __QDEC_DRIVER_H__ */
This file implements some macros that makes the IAR C-compiler and avr-gcc work with the same code ba...
void QDEC_TC_Freq_Setup(TC0_t *qTimer, TC_EVSEL_t qEventChannel, EVSYS_CHMUX_t qPinInput, TC_CLKSEL_t clksel)
This function set up the needed configuration for a Timer/Counter to handle the frequency/speed measu...
Definition: qdec_driver.c:231
uint8_t lineCount
Number of lines in the quadrature encoder.
Definition: qdec_example.c:72
bool QDEC_EVSYS_Setup(uint8_t qEvMux, EVSYS_CHMUX_t qPinInput, bool useIndex, EVSYS_QDIRM_t qIndexState)
This function configure the event system for quadrature decoding.
Definition: qdec_driver.c:158
uint8_t QDEC_Get_Direction(TC0_t *qTimer)
This function return the direction of the counter/QDEC.
Definition: qdec_driver.c:255
bool QDEC_Total_Setup(PORT_t *qPort, uint8_t qPin, bool invIO, uint8_t qEvMux, EVSYS_CHMUX_t qPinInput, bool useIndex, EVSYS_QDIRM_t qIndexState, TC0_t *qTimer, TC_EVSEL_t qEventChannel, uint8_t lineCount)
Wrapperfunction to set up all parameters for the quadrature decoder.
Definition: qdec_driver.c:87
bool QDEC_Port_Setup(PORT_t *qPort, uint8_t qPin, bool useIndex, bool invIO)
This function set up the needed configuration for the port used for the quadrature decoding...
Definition: qdec_driver.c:118
void QDEC_TC_Dec_Setup(TC0_t *qTimer, TC_EVSEL_t qEventChannel, uint8_t lineCount)
This function set up the needed configuration for the Timer/Counter to handle the quadrature decoding...
Definition: qdec_driver.c:210
@DOC_TITLE@
Generated on Thu Oct 26 2017 13:33:37 for AVR1600 Using the XMEGA Quadrature Decoder by doxygen 1.8.13