Microchip® Advanced Software Framework

qdec.h File Reference

AVR XMEGA Quadrature Decoder driver header file This file contains the function prototypes and Macros.

Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.

#include "compiler.h"

Data Structures

struct  qdec_config
 

Typedefs

typedef struct qdec_config qdec_config_t
 

Enumerations

enum  QDec_index_rec_state {
  QDEC_STATE_NO_PH0_NO_PH90 = (0x00 << 0),
  QDEC_STATE_NO_PH0_PH90 = (0x01 << 0),
  QDEC_STATE_PH0_NO_PH90 = (0x02 << 0),
  QDEC_STATE_PH0_PH90 = (0x03 << 0)
}
 

Functions

void qdec_config_disable_index_pin (qdec_config_t *config)
 Disables index line. More...
 
void qdec_config_enable_freq (qdec_config_t *config, uint32_t unit)
 Defines frequency option. More...
 
void qdec_config_enable_index_pin (qdec_config_t *config, bool pin_invert, enum QDec_index_rec_state state)
 Defines index line to enable the automaticaly position reset. More...
 
void qdec_config_event_channel (qdec_config_t *config, uint8_t event_channel)
 Selects the event channel to use for quadrature decoder. More...
 
void qdec_config_freq_event_channel (qdec_config_t *config, uint8_t event_channel)
 Selects the event channel to use for frequency quadrature decoder. More...
 
void qdec_config_freq_tc (qdec_config_t *config, volatile void *timer)
 Selects the event channel to use for frequency quadrature decoder. More...
 
void qdec_config_phase_pins (qdec_config_t *config, PORT_t *port, uint8_t pins_base, bool pins_invert, uint16_t filter_us)
 This function set up the needed configuration to the port, used for the quadrature decoding. More...
 
void qdec_config_revolution (qdec_config_t *config, uint16_t revolution)
 Defines the revolution of quadrature decoder. More...
 
void qdec_config_tc (qdec_config_t *config, volatile void *timer)
 Selects the event channel to use for quadrature decoder. More...
 
void qdec_enabled (qdec_config_t *config)
 Loads and enables QDec system. More...
 
void qdec_get_config_defaults (qdec_config_t *config)
 This function initializes the configuration structure with the identified as commonly use case. More...
 
bool qdec_get_direction (qdec_config_t *config)
 Returns the direction of the quadrature decoding counter. More...
 
uint16_t qdec_get_frequency (qdec_config_t *config)
 Returns the frequency of quadrature encoder. More...
 
uint16_t qdec_get_position (qdec_config_t *config)
 Returns the position of quadrature encoder. More...
 
void qdec_reset_position (qdec_config_t *config)
 Returns the position of quadrature encoder. More...