C:/nxpdrv/LPC1700CMSIS/Drivers/include/lpc17xx_qei.h File Reference
: Contains all macro definitions and function prototypes support for QEI firmware library on LPC17xx More...
#include "LPC17xx.h"
#include "lpc_types.h"
Go to the source code of this file.
Data Structures | |
struct | QEI_CFG_Type |
QEI Configuration structure type definition. More... | |
struct | QEI_RELOADCFG_Type |
Timer Reload Configuration structure type definition. More... | |
Defines | |
#define | QEI_CON_RESP ((uint32_t)(1<<0)) |
#define | QEI_CON_RESPI ((uint32_t)(1<<1)) |
#define | QEI_CON_RESV ((uint32_t)(1<<2)) |
#define | QEI_CON_RESI ((uint32_t)(1<<3)) |
#define | QEI_CON_BITMASK ((uint32_t)(0x0F)) |
#define | QEI_CONF_DIRINV ((uint32_t)(1<<0)) |
#define | QEI_CONF_SIGMODE ((uint32_t)(1<<1)) |
#define | QEI_CONF_CAPMODE ((uint32_t)(1<<2)) |
#define | QEI_CONF_INVINX ((uint32_t)(1<<3)) |
#define | QEI_CONF_BITMASK ((uint32_t)(0x0F)) |
#define | QEI_STAT_DIR ((uint32_t)(1<<0)) |
#define | QEI_STAT_BITMASK ((uint32_t)(1<<0)) |
#define | QEI_INTSTAT_INX_Int ((uint32_t)(1<<0)) |
#define | QEI_INTSTAT_TIM_Int ((uint32_t)(1<<1)) |
#define | QEI_INTSTAT_VELC_Int ((uint32_t)(1<<2)) |
#define | QEI_INTSTAT_DIR_Int ((uint32_t)(1<<3)) |
#define | QEI_INTSTAT_ERR_Int ((uint32_t)(1<<4)) |
#define | QEI_INTSTAT_ENCLK_Int ((uint32_t)(1<<5)) |
#define | QEI_INTSTAT_POS0_Int ((uint32_t)(1<<6)) |
#define | QEI_INTSTAT_POS1_Int ((uint32_t)(1<<7)) |
#define | QEI_INTSTAT_POS2_Int ((uint32_t)(1<<8)) |
#define | QEI_INTSTAT_REV_Int ((uint32_t)(1<<9)) |
#define | QEI_INTSTAT_POS0REV_Int ((uint32_t)(1<<10)) |
#define | QEI_INTSTAT_POS1REV_Int ((uint32_t)(1<<11)) |
#define | QEI_INTSTAT_POS2REV_Int ((uint32_t)(1<<12)) |
#define | QEI_INTSTAT_BITMASK ((uint32_t)(0x1FFF)) |
#define | QEI_INTSET_INX_Int ((uint32_t)(1<<0)) |
#define | QEI_INTSET_TIM_Int ((uint32_t)(1<<1)) |
#define | QEI_INTSET_VELC_Int ((uint32_t)(1<<2)) |
#define | QEI_INTSET_DIR_Int ((uint32_t)(1<<3)) |
#define | QEI_INTSET_ERR_Int ((uint32_t)(1<<4)) |
#define | QEI_INTSET_ENCLK_Int ((uint32_t)(1<<5)) |
#define | QEI_INTSET_POS0_Int ((uint32_t)(1<<6)) |
#define | QEI_INTSET_POS1_Int ((uint32_t)(1<<7)) |
#define | QEI_INTSET_POS2_Int ((uint32_t)(1<<8)) |
#define | QEI_INTSET_REV_Int ((uint32_t)(1<<9)) |
#define | QEI_INTSET_POS0REV_Int ((uint32_t)(1<<10)) |
#define | QEI_INTSET_POS1REV_Int ((uint32_t)(1<<11)) |
#define | QEI_INTSET_POS2REV_Int ((uint32_t)(1<<12)) |
#define | QEI_INTSET_BITMASK ((uint32_t)(0x1FFF)) |
#define | QEI_INTCLR_INX_Int ((uint32_t)(1<<0)) |
#define | QEI_INTCLR_TIM_Int ((uint32_t)(1<<1)) |
#define | QEI_INTCLR_VELC_Int ((uint32_t)(1<<2)) |
#define | QEI_INTCLR_DIR_Int ((uint32_t)(1<<3)) |
#define | QEI_INTCLR_ERR_Int ((uint32_t)(1<<4)) |
#define | QEI_INTCLR_ENCLK_Int ((uint32_t)(1<<5)) |
#define | QEI_INTCLR_POS0_Int ((uint32_t)(1<<6)) |
#define | QEI_INTCLR_POS1_Int ((uint32_t)(1<<7)) |
#define | QEI_INTCLR_POS2_Int ((uint32_t)(1<<8)) |
#define | QEI_INTCLR_REV_Int ((uint32_t)(1<<9)) |
#define | QEI_INTCLR_POS0REV_Int ((uint32_t)(1<<10)) |
#define | QEI_INTCLR_POS1REV_Int ((uint32_t)(1<<11)) |
#define | QEI_INTCLR_POS2REV_Int ((uint32_t)(1<<12)) |
#define | QEI_INTCLR_BITMASK ((uint32_t)(0x1FFF)) |
#define | QEI_INTEN_INX_Int ((uint32_t)(1<<0)) |
#define | QEI_INTEN_TIM_Int ((uint32_t)(1<<1)) |
#define | QEI_INTEN_VELC_Int ((uint32_t)(1<<2)) |
#define | QEI_INTEN_DIR_Int ((uint32_t)(1<<3)) |
#define | QEI_INTEN_ERR_Int ((uint32_t)(1<<4)) |
#define | QEI_INTEN_ENCLK_Int ((uint32_t)(1<<5)) |
#define | QEI_INTEN_POS0_Int ((uint32_t)(1<<6)) |
#define | QEI_INTEN_POS1_Int ((uint32_t)(1<<7)) |
#define | QEI_INTEN_POS2_Int ((uint32_t)(1<<8)) |
#define | QEI_INTEN_REV_Int ((uint32_t)(1<<9)) |
#define | QEI_INTEN_POS0REV_Int ((uint32_t)(1<<10)) |
#define | QEI_INTEN_POS1REV_Int ((uint32_t)(1<<11)) |
#define | QEI_INTEN_POS2REV_Int ((uint32_t)(1<<12)) |
#define | QEI_INTEN_BITMASK ((uint32_t)(0x1FFF)) |
#define | QEI_IESET_INX_Int ((uint32_t)(1<<0)) |
#define | QEI_IESET_TIM_Int ((uint32_t)(1<<1)) |
#define | QEI_IESET_VELC_Int ((uint32_t)(1<<2)) |
#define | QEI_IESET_DIR_Int ((uint32_t)(1<<3)) |
#define | QEI_IESET_ERR_Int ((uint32_t)(1<<4)) |
#define | QEI_IESET_ENCLK_Int ((uint32_t)(1<<5)) |
#define | QEI_IESET_POS0_Int ((uint32_t)(1<<6)) |
#define | QEI_IESET_POS1_Int ((uint32_t)(1<<7)) |
#define | QEI_IESET_POS2_Int ((uint32_t)(1<<8)) |
#define | QEI_IESET_REV_Int ((uint32_t)(1<<9)) |
#define | QEI_IESET_POS0REV_Int ((uint32_t)(1<<10)) |
#define | QEI_IESET_POS1REV_Int ((uint32_t)(1<<11)) |
#define | QEI_IESET_POS2REV_Int ((uint32_t)(1<<12)) |
#define | QEI_IESET_BITMASK ((uint32_t)(0x1FFF)) |
#define | QEI_IECLR_INX_Int ((uint32_t)(1<<0)) |
#define | QEI_IECLR_TIM_Int ((uint32_t)(1<<1)) |
#define | QEI_IECLR_VELC_Int ((uint32_t)(1<<2)) |
#define | QEI_IECLR_DIR_Int ((uint32_t)(1<<3)) |
#define | QEI_IECLR_ERR_Int ((uint32_t)(1<<4)) |
#define | QEI_IECLR_ENCLK_Int ((uint32_t)(1<<5)) |
#define | QEI_IECLR_POS0_Int ((uint32_t)(1<<6)) |
#define | QEI_IECLR_POS1_Int ((uint32_t)(1<<7)) |
#define | QEI_IECLR_POS2_Int ((uint32_t)(1<<8)) |
#define | QEI_IECLR_REV_Int ((uint32_t)(1<<9)) |
#define | QEI_IECLR_POS0REV_Int ((uint32_t)(1<<10)) |
#define | QEI_IECLR_POS1REV_Int ((uint32_t)(1<<11)) |
#define | QEI_IECLR_POS2REV_Int ((uint32_t)(1<<12)) |
#define | QEI_IECLR_BITMASK ((uint32_t)(0x1FFF)) |
#define | PARAM_QEIx(n) ((n==LPC_QEI)) |
#define | QEI_RESET_POS QEI_CON_RESP |
#define | QEI_RESET_POSOnIDX QEI_CON_RESPI |
#define | QEI_RESET_VEL QEI_CON_RESV |
#define | QEI_RESET_IDX QEI_CON_RESI |
#define | PARAM_QEI_RESET(n) |
#define | QEI_DIRINV_NONE ((uint32_t)(0)) |
#define | QEI_DIRINV_CMPL ((uint32_t)(1)) |
#define | PARAM_QEI_DIRINV(n) ((n==QEI_DIRINV_NONE) || (n==QEI_DIRINV_CMPL)) |
#define | QEI_SIGNALMODE_QUAD ((uint32_t)(0)) |
#define | QEI_SIGNALMODE_CLKDIR ((uint32_t)(1)) |
#define | PARAM_QEI_SIGNALMODE(n) ((n==QEI_SIGNALMODE_QUAD) || (n==QEI_SIGNALMODE_CLKDIR)) |
#define | QEI_CAPMODE_2X ((uint32_t)(0)) |
#define | QEI_CAPMODE_4X ((uint32_t)(1)) |
#define | PARAM_QEI_CAPMODE(n) ((n==QEI_CAPMODE_2X) || (n==QEI_CAPMODE_4X)) |
#define | QEI_INVINX_NONE ((uint32_t)(0)) |
#define | QEI_INVINX_EN ((uint32_t)(1)) |
#define | PARAM_QEI_INVINX(n) ((n==QEI_INVINX_NONE) || (n==QEI_INVINX_EN)) |
#define | QEI_TIMERRELOAD_TICKVAL ((uint8_t)(0)) |
#define | QEI_TIMERRELOAD_USVAL ((uint8_t)(1)) |
#define | PARAM_QEI_TIMERRELOAD(n) ((n==QEI_TIMERRELOAD_TICKVAL) || (n==QEI_TIMERRELOAD_USVAL)) |
#define | QEI_STATUS_DIR ((uint32_t)(1<<0)) |
#define | PARAM_QEI_STATUS(n) ((n==QEI_STATUS_DIR)) |
#define | QEI_COMPPOS_CH_0 ((uint8_t)(0)) |
#define | QEI_COMPPOS_CH_1 ((uint8_t)(1)) |
#define | QEI_COMPPOS_CH_2 ((uint8_t)(2)) |
#define | PARAM_QEI_COMPPOS_CH(n) ((n==QEI_COMPPOS_CH_0) || (n==QEI_COMPPOS_CH_1) || (n==QEI_COMPPOS_CH_2)) |
#define | QEI_INTFLAG_INX_Int ((uint32_t)(1<<0)) |
#define | QEI_INTFLAG_TIM_Int ((uint32_t)(1<<1)) |
#define | QEI_INTFLAG_VELC_Int ((uint32_t)(1<<2)) |
#define | QEI_INTFLAG_DIR_Int ((uint32_t)(1<<3)) |
#define | QEI_INTFLAG_ERR_Int ((uint32_t)(1<<4)) |
#define | QEI_INTFLAG_ENCLK_Int ((uint32_t)(1<<5)) |
#define | QEI_INTFLAG_POS0_Int ((uint32_t)(1<<6)) |
#define | QEI_INTFLAG_POS1_Int ((uint32_t)(1<<7)) |
#define | QEI_INTFLAG_POS2_Int ((uint32_t)(1<<8)) |
#define | QEI_INTFLAG_REV_Int ((uint32_t)(1<<9)) |
#define | QEI_INTFLAG_POS0REV_Int ((uint32_t)(1<<10)) |
#define | QEI_INTFLAG_POS1REV_Int ((uint32_t)(1<<11)) |
#define | QEI_INTFLAG_POS2REV_Int ((uint32_t)(1<<12)) |
#define | PARAM_QEI_INTFLAG(n) |
Functions | |
void | QEI_Reset (LPC_QEI_TypeDef *QEIx, uint32_t ulResetType) |
Resets value for each type of QEI value, such as velocity, counter, position, etc.. | |
void | QEI_Init (LPC_QEI_TypeDef *QEIx, QEI_CFG_Type *QEI_ConfigStruct) |
Initializes the QEI peripheral according to the specified parameters in the QEI_ConfigStruct. | |
void | QEI_ConfigStructInit (QEI_CFG_Type *QIE_InitStruct) |
Fills each QIE_InitStruct member with its default value:
| |
void | QEI_DeInit (LPC_QEI_TypeDef *QEIx) |
De-initializes the QEI peripheral registers to their default reset values. | |
FlagStatus | QEI_GetStatus (LPC_QEI_TypeDef *QEIx, uint32_t ulFlagType) |
Check whether if specified flag status is set or not. | |
uint32_t | QEI_GetPosition (LPC_QEI_TypeDef *QEIx) |
Get current position value in QEI peripheral. | |
void | QEI_SetMaxPosition (LPC_QEI_TypeDef *QEIx, uint32_t ulMaxPos) |
Set max position value for QEI peripheral. | |
void | QEI_SetPositionComp (LPC_QEI_TypeDef *QEIx, uint8_t bPosCompCh, uint32_t ulPosComp) |
Set position compare value for QEI peripheral. | |
uint32_t | QEI_GetIndex (LPC_QEI_TypeDef *QEIx) |
Get current index counter of QEI peripheral. | |
void | QEI_SetIndexComp (LPC_QEI_TypeDef *QEIx, uint32_t ulIndexComp) |
Set value for index compare in QEI peripheral. | |
void | QEI_SetTimerReload (LPC_QEI_TypeDef *QEIx, QEI_RELOADCFG_Type *QEIReloadStruct) |
Set timer reload value for QEI peripheral. When the velocity timer is over-flow, the value that set for Timer Reload register will be loaded into the velocity timer for next period. The calculated velocity in RPM therefore will be affect by this value. | |
uint32_t | QEI_GetTimer (LPC_QEI_TypeDef *QEIx) |
Get current timer counter in QEI peripheral. | |
uint32_t | QEI_GetVelocity (LPC_QEI_TypeDef *QEIx) |
Get current velocity pulse counter in current time period. | |
uint32_t | QEI_GetVelocityCap (LPC_QEI_TypeDef *QEIx) |
Get the most recently measured velocity of the QEI. When the Velocity timer in QEI is over-flow, the current velocity value will be loaded into Velocity Capture register. | |
void | QEI_SetVelocityComp (LPC_QEI_TypeDef *QEIx, uint32_t ulVelComp) |
Set Velocity Compare value for QEI peripheral. | |
void | QEI_SetDigiFilter (LPC_QEI_TypeDef *QEIx, uint32_t ulSamplingPulse) |
Set value of sampling count for the digital filter in QEI peripheral. | |
FlagStatus | QEI_GetIntStatus (LPC_QEI_TypeDef *QEIx, uint32_t ulIntType) |
Check whether if specified interrupt flag status in QEI peripheral is set or not. | |
void | QEI_IntCmd (LPC_QEI_TypeDef *QEIx, uint32_t ulIntType, FunctionalState NewState) |
Enable/Disable specified interrupt in QEI peripheral. | |
void | QEI_IntSet (LPC_QEI_TypeDef *QEIx, uint32_t ulIntType) |
Sets (forces) specified interrupt in QEI peripheral. | |
void | QEI_IntClear (LPC_QEI_TypeDef *QEIx, uint32_t ulIntType) |
Clear (force) specified interrupt (pending) in QEI peripheral. | |
uint32_t | QEI_CalculateRPM (LPC_QEI_TypeDef *QEIx, uint32_t ulVelCapValue, uint32_t ulPPR) |
Calculates the actual velocity in RPM passed via velocity capture value and Pulse Per Round (of the encoder) value parameter input. |
Detailed Description
: Contains all macro definitions and function prototypes support for QEI firmware library on LPC17xx
- Version:
- : 1.0
- Date:
- : 26. May. 2009
- Author:
- : HieuNguyen
Definition in file lpc17xx_qei.h.
Generated on Mon Feb 8 10:01:40 2010 for LPC1700CMSIS Standard Peripheral Firmware Library by
