uc-sdk
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
lpc17xx_mcpwm.h File Reference

Contains all macro definitions and function prototypes support for Motor Control PWM firmware library on LPC17xx. More...

#include "LPC17xx.h"
#include "lpc_types.h"

Go to the source code of this file.

Classes

struct  MCPWM_CHANNEL_CFG_Type
 Motor Control PWM Channel Configuration structure type definition. More...
 
struct  MCPWM_CAPTURE_CFG_Type
 MCPWM Capture Configuration type definition. More...
 
struct  MCPWM_COUNT_CFG_Type
 MCPWM Count Control Configuration type definition. More...
 

Macros

#define MCPWM_CHANNEL_EDGE_MODE   ((uint32_t)(0))
 
#define MCPWM_CHANNEL_CENTER_MODE   ((uint32_t)(1))
 
#define MCPWM_CHANNEL_PASSIVE_LO   ((uint32_t)(0))
 
#define MCPWM_CHANNEL_PASSIVE_HI   ((uint32_t)(1))
 
#define MCPWM_PATENT_A0   ((uint32_t)(1<<0))
 
#define MCPWM_PATENT_B0   ((uint32_t)(1<<1))
 
#define MCPWM_PATENT_A1   ((uint32_t)(1<<2))
 
#define MCPWM_PATENT_B1   ((uint32_t)(1<<3))
 
#define MCPWM_PATENT_A2   ((uint32_t)(1<<4))
 
#define MCPWM_PATENT_B2   ((uint32_t)(1<<5))
 
#define MCPWM_INTFLAG_LIM0   MCPWM_INT_ILIM(0)
 
#define MCPWM_INTFLAG_MAT0   MCPWM_INT_IMAT(0)
 
#define MCPWM_INTFLAG_CAP0   MCPWM_INT_ICAP(0)
 
#define MCPWM_INTFLAG_LIM1   MCPWM_INT_ILIM(1)
 
#define MCPWM_INTFLAG_MAT1   MCPWM_INT_IMAT(1)
 
#define MCPWM_INTFLAG_CAP1   MCPWM_INT_ICAP(1)
 
#define MCPWM_INTFLAG_LIM2   MCPWM_INT_ILIM(2)
 
#define MCPWM_INTFLAG_MAT2   MCPWM_INT_IMAT(2)
 
#define MCPWM_INTFLAG_CAP2   MCPWM_INT_ICAP(2)
 
#define MCPWM_INTFLAG_ABORT   MCPWM_INT_ABORT
 
#define MCPWM_CON_RUN(n)   (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<((n*8)+0))) : (0))
 
#define MCPWM_CON_CENTER(n)   (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<((n*8)+1))) : (0))
 
#define MCPWM_CON_POLAR(n)   (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<((n*8)+2))) : (0))
 
#define MCPWM_CON_DTE(n)   (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<((n*8)+3))) : (0))
 
#define MCPWM_CON_DISUP(n)   (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<((n*8)+4))) : (0))
 
#define MCPWM_CON_INVBDC   ((uint32_t)(1<<29))
 
#define MCPWM_CON_ACMODE   ((uint32_t)(1<<30))
 
#define MCPWM_CON_DCMODE   ((uint32_t)(1<<31))
 
#define MCPWM_CAPCON_CAPMCI_RE(cap, mci)   (((cap>=0)&&(cap<=2)&&(mci>=0)&&(mci<=2)) ? ((uint32_t)(1<<((cap*6)+(mci*2)+0))) : (0))
 
#define MCPWM_CAPCON_CAPMCI_FE(cap, mci)   (((cap>=0)&&(cap<=2)&&(mci>=0)&&(mci<=2)) ? ((uint32_t)(1<<((cap*6)+(mci*2)+1))) : (0))
 
#define MCPWM_CAPCON_RT(n)   (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<(18+(n)))) : (0))
 
#define MCPWM_CAPCON_HNFCAP(n)   (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<(21+(n)))) : (0))
 
#define MCPWM_INT_ILIM(n)   (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<((n*4)+0))) : (0))
 
#define MCPWM_INT_IMAT(n)   (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<((n*4)+1))) : (0))
 
#define MCPWM_INT_ICAP(n)   (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<((n*4)+2))) : (0))
 
#define MCPWM_INT_ABORT   ((uint32_t)(1<<15))
 
#define MCPWM_CNTCON_TCMCI_RE(tc, mci)   (((tc>=0)&&(tc<=2)&&(mci>=0)&&(mci<=2)) ? ((uint32_t)(1<<((6*tc)+(2*mci)+0))) : (0))
 
#define MCPWM_CNTCON_TCMCI_FE(tc, mci)   (((tc>=0)&&(tc<=2)&&(mci>=0)&&(mci<=2)) ? ((uint32_t)(1<<((6*tc)+(2*mci)+1))) : (0))
 
#define MCPWM_CNTCON_CNTR(n)   (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<(29+n))) : (0))
 
#define MCPWM_DT(n, x)   (((n>=0)&&(n<=2)) ? ((uint32_t)((x&0x3FF)<<(n*10))) : (0))
 
#define MCPWM_CP_A0   ((uint32_t)(1<<0))
 
#define MCPWM_CP_B0   ((uint32_t)(1<<1))
 
#define MCPWM_CP_A1   ((uint32_t)(1<<2))
 
#define MCPWM_CP_B1   ((uint32_t)(1<<3))
 
#define MCPWM_CP_A2   ((uint32_t)(1<<4))
 
#define MCPWM_CP_B2   ((uint32_t)(1<<5))
 
#define MCPWM_CAPCLR_CAP(n)   (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<n)) : (0))
 

Functions

void MCPWM_Init (LPC_MCPWM_TypeDef *MCPWMx)
 
void MCPWM_ConfigChannel (LPC_MCPWM_TypeDef *MCPWMx, uint32_t channelNum, MCPWM_CHANNEL_CFG_Type *channelSetup)
 
void MCPWM_WriteToShadow (LPC_MCPWM_TypeDef *MCPWMx, uint32_t channelNum, MCPWM_CHANNEL_CFG_Type *channelSetup)
 
void MCPWM_ConfigCapture (LPC_MCPWM_TypeDef *MCPWMx, uint32_t channelNum, MCPWM_CAPTURE_CFG_Type *captureConfig)
 
void MCPWM_ClearCapture (LPC_MCPWM_TypeDef *MCPWMx, uint32_t captureChannel)
 
uint32_t MCPWM_GetCapture (LPC_MCPWM_TypeDef *MCPWMx, uint32_t captureChannel)
 
void MCPWM_CountConfig (LPC_MCPWM_TypeDef *MCPWMx, uint32_t channelNum, uint32_t countMode, MCPWM_COUNT_CFG_Type *countConfig)
 
void MCPWM_Start (LPC_MCPWM_TypeDef *MCPWMx, uint32_t channel0, uint32_t channel1, uint32_t channel2)
 
void MCPWM_Stop (LPC_MCPWM_TypeDef *MCPWMx, uint32_t channel0, uint32_t channel1, uint32_t channel2)
 
void MCPWM_ACMode (LPC_MCPWM_TypeDef *MCPWMx, uint32_t acMode)
 
void MCPWM_DCMode (LPC_MCPWM_TypeDef *MCPWMx, uint32_t dcMode, uint32_t outputInvered, uint32_t outputPattern)
 
void MCPWM_IntConfig (LPC_MCPWM_TypeDef *MCPWMx, uint32_t ulIntType, FunctionalState NewState)
 
void MCPWM_IntSet (LPC_MCPWM_TypeDef *MCPWMx, uint32_t ulIntType)
 
void MCPWM_IntClear (LPC_MCPWM_TypeDef *MCPWMx, uint32_t ulIntType)
 
FlagStatus MCPWM_GetIntStatus (LPC_MCPWM_TypeDef *MCPWMx, uint32_t ulIntType)
 

Detailed Description

Contains all macro definitions and function prototypes support for Motor Control PWM firmware library on LPC17xx.

Version
2.0
Date
21. May. 2010
Author
NXP MCU SW Application Team

Software that is described herein is for illustrative purposes only which provides customers with programming information regarding the products. This software is supplied "AS IS" without any warranties. NXP Semiconductors assumes no responsibility or liability for the use of the software, conveys no license or title under any patent, copyright, or mask work right to the product. NXP Semiconductors reserves the right to make changes in the software without notification. NXP Semiconductors also make no representation or warranty that such application will be suitable for the specified use without further testing or modification.

Definition in file lpc17xx_mcpwm.h.