NXP's driver library for LPC17xx, ported to mbed's online compiler. Not tested! I had to fix a lot of warings and found a couple of pretty obvious bugs, so the chances are there are more. Original: http://ics.nxp.com/support/documents/microcontrollers/zip/lpc17xx.cmsis.driver.library.zip

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

lpc17xx_pwm.h File Reference

lpc17xx_pwm.h File Reference

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

Go to the source code of this file.

Data Structures

struct  PWM_TIMERCFG_Type
 Configuration structure in PWM TIMER mode. More...
struct  PWM_COUNTERCFG_Type
 Configuration structure in PWM COUNTER mode. More...
struct  PWM_MATCHCFG_Type
 PWM Match channel configuration structure. More...
struct  PWM_CAPTURECFG_Type
 PWM Capture Input configuration structure. More...

Enumerations

enum  PWM_TC_MODE_OPT { PWM_MODE_TIMER = 0, PWM_MODE_COUNTER }
 

PMW TC mode select option.

More...
enum  PWM_TIMER_PRESCALE_OPT { PWM_TIMER_PRESCALE_TICKVAL = 0, PWM_TIMER_PRESCALE_USVAL }
 

PWM Timer/Counter prescale option.

More...
enum  PWM_COUNTER_INPUTSEL_OPT { PWM_COUNTER_PCAP1_0 = 0, PWM_COUNTER_PCAP1_1 }
 

PWM Input Select in counter mode.

More...
enum  PWM_COUNTER_EDGE_OPT { PWM_COUNTER_RISING = 1, PWM_COUNTER_FALLING = 2, PWM_COUNTER_ANY = 3 }
 

PWM Input Edge Option in counter mode.

More...
enum  PWM_CHANNEL_EDGE_OPT { PWM_CHANNEL_SINGLE_EDGE, PWM_CHANNEL_DUAL_EDGE }
 

PWM operating mode options.

More...
enum  PWM_MATCH_UPDATE_OPT { PWM_MATCH_UPDATE_NOW = 0, PWM_MATCH_UPDATE_NEXT_RST }
 

PWM update type.

More...
enum  PWM_INTSTAT_TYPE {
  PWM_INTSTAT_MR0 = PWM_IR_PWMMRn(0), PWM_INTSTAT_MR1 = PWM_IR_PWMMRn(1), PWM_INTSTAT_MR2 = PWM_IR_PWMMRn(2), PWM_INTSTAT_MR3 = PWM_IR_PWMMRn(3),
  PWM_INTSTAT_CAP0 = PWM_IR_PWMCAPn(0), PWM_INTSTAT_CAP1 = PWM_IR_PWMCAPn(1), PWM_INTSTAT_MR4 = PWM_IR_PWMMRn(4), PWM_INTSTAT_MR6 = PWM_IR_PWMMRn(5),
  PWM_INTSTAT_MR5 = PWM_IR_PWMMRn(6)
}
 

PWM interrupt status type definition -----------------------------------------------------.

More...

Functions

IntStatus PWM_GetIntStatus (LPC_PWM_TypeDef *PWMx, uint32_t IntFlag)
 Check whether specified interrupt flag in PWM is set or not.
void PWM_ClearIntPending (LPC_PWM_TypeDef *PWMx, uint32_t IntFlag)
 Clear specified PWM Interrupt pending.
void PWM_ConfigStructInit (uint8_t PWMTimerCounterMode, void *PWM_InitStruct)
 Fills each PWM_InitStruct member with its default value:

  • If PWMCounterMode = PWM_MODE_TIMER: + PrescaleOption = PWM_TIMER_PRESCALE_USVAL + PrescaleValue = 1
  • If PWMCounterMode = PWM_MODE_COUNTER: + CountInputSelect = PWM_COUNTER_PCAP1_0 + CounterOption = PWM_COUNTER_RISING.

void PWM_Init (LPC_PWM_TypeDef *PWMx, uint32_t PWMTimerCounterMode, void *PWM_ConfigStruct)
 Initializes the PWMx peripheral corresponding to the specified parameters in the PWM_ConfigStruct.
void PWM_DeInit (LPC_PWM_TypeDef *PWMx)
 De-initializes the PWM peripheral registers to their default reset values.
void PWM_Cmd (LPC_PWM_TypeDef *PWMx, FunctionalState NewState)
 Enable/Disable PWM peripheral.
void PWM_CounterCmd (LPC_PWM_TypeDef *PWMx, FunctionalState NewState)
 Enable/Disable Counter in PWM peripheral.
void PWM_ResetCounter (LPC_PWM_TypeDef *PWMx)
 Reset Counter in PWM peripheral.
void PWM_ConfigMatch (LPC_PWM_TypeDef *PWMx, PWM_MATCHCFG_Type *PWM_MatchConfigStruct)
 Configures match for PWM peripheral.
void PWM_ConfigCapture (LPC_PWM_TypeDef *PWMx, PWM_CAPTURECFG_Type *PWM_CaptureConfigStruct)
 Configures capture input for PWM peripheral.
uint32_t PWM_GetCaptureValue (LPC_PWM_TypeDef *PWMx, uint8_t CaptureChannel)
 Read value of capture register PWM peripheral.
void PWM_MatchUpdate (LPC_PWM_TypeDef *PWMx, uint8_t MatchChannel,\uint32_t MatchValue, uint8_t UpdateType)
 Update value for each PWM channel with update type option.
void PWM_ChannelConfig (LPC_PWM_TypeDef *PWMx, uint8_t PWMChannel, uint8_t ModeOption)
 Configure Edge mode for each PWM channel.
void PWM_ChannelCmd (LPC_PWM_TypeDef *PWMx, uint8_t PWMChannel, FunctionalState NewState)
 Enable/Disable PWM channel output.

Detailed Description

: Contains all macro definitions and function prototypes support for PWM firmware library on LPC17xx

Version:
: 1.0
Date:
: 22. Apr. 2009
Author:
: HieuNguyen

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