#include "lpc17xx_qei.h"#include "lpc17xx_mcpwm.h"#include "lpc17xx_timer.h"#include "lpc17xx_pinsel.h"#include "lpc17xx_libcfg.h"#include "lpc17xx_nvic.h"#include "lpc17xx_clkpwr.h"#include "debug_frmwrk.h"Defines | |
| #define | DC_MODE_TEST 0 |
| #define | AC_MODE_TEST 0 |
| #define | CAPTURE_MODE_TEST 1 |
Functions | |
| void | MCPWM_IRQHandler (void) |
| MCPWM interrupt handler sub-routine. | |
| void | Timer_Wait (LPC_TIM_TypeDef *Timer, uint32_t time) |
| Delay millisecond. | |
| int | c_entry (void) |
| Main MCPWM program body. | |
| int | main (void) |
| void | check_failed (uint8_t *file, uint32_t line) |
Variables | |
| const PINSEL_CFG_Type | mcpwm_mco0a_pin [1] = {{1, 19, 1, 0, 0}} |
| const PINSEL_CFG_Type | mcpwm_mco0b_pin [1] = {{1, 22, 1, 0, 0}} |
| const PINSEL_CFG_Type | mcpwm_mco1a_pin [1] = {{1, 25, 1, 0, 0}} |
| const PINSEL_CFG_Type | mcpwm_mco1b_pin [1] = {{1, 26, 1, 0, 0}} |
| const PINSEL_CFG_Type | mcpwm_mco2a_pin [1] = {{1, 28, 1, 0, 0}} |
| const PINSEL_CFG_Type | mcpwm_mco2b_pin [1] = {{1, 29, 1, 0, 0}} |
| const PINSEL_CFG_Type | mcpwm_mcfb0_pin [1] = {{1, 20, 1, 0, 0}} |
| const PINSEL_CFG_Type | mcpwm_mcfb1_pin [1] = {{1, 23, 1, 0, 0}} |
| const PINSEL_CFG_Type | mcpwm_mcfb2_pin [1] = {{1, 24, 1, 0, 0}} |
| const PINSEL_CFG_Type | mcpwm_mcabort_pin [1] = {{ 1, 21, 1, 0, 0}} |
| MCPWM_CAPTURE_CFG_Type | captureCfg |
| __IO FlagStatus | CapFlag |
| __IO uint32_t | CapVal |
| #define AC_MODE_TEST 0 |
MCPWM in 3-phase AC motor mode test
| #define CAPTURE_MODE_TEST 1 |
MCPWM tested with Capture function
| #define DC_MODE_TEST 0 |
MCPWM in 3-phase DC motor mode test
| void Timer_Wait | ( | LPC_TIM_TypeDef * | Timer, | |
| uint32_t | time | |||
| ) |
Delay millisecond.
| [in] | Timer | Timer peripheral, should be TIM0..3 |
| [in] | time | delay time value in ms |
| __IO FlagStatus CapFlag |
capture flag
| MCPWM_CAPTURE_CFG_Type captureCfg |
Capture configuration data
| __IO uint32_t CapVal |
Latest capture value
| const PINSEL_CFG_Type mcpwm_mcabort_pin[1] = {{ 1, 21, 1, 0, 0}} |
Motor Control Low-active abort feed back
| const PINSEL_CFG_Type mcpwm_mcfb0_pin[1] = {{1, 20, 1, 0, 0}} |
Motor Control Feed Back Channel 0 - MCI0
| const PINSEL_CFG_Type mcpwm_mcfb1_pin[1] = {{1, 23, 1, 0, 0}} |
Motor Control Feed Back Channel 1 - MCI1
| const PINSEL_CFG_Type mcpwm_mcfb2_pin[1] = {{1, 24, 1, 0, 0}} |
Motor Control Feed Back Channel 2 - MCI2
| const PINSEL_CFG_Type mcpwm_mco0a_pin[1] = {{1, 19, 1, 0, 0}} |
Motor Control Channel 0 Output A
| const PINSEL_CFG_Type mcpwm_mco0b_pin[1] = {{1, 22, 1, 0, 0}} |
Motor Control Channel 0 Output B
| const PINSEL_CFG_Type mcpwm_mco1a_pin[1] = {{1, 25, 1, 0, 0}} |
Motor Control Channel 1 Output A
| const PINSEL_CFG_Type mcpwm_mco1b_pin[1] = {{1, 26, 1, 0, 0}} |
Motor Control Channel 1 Output B
| const PINSEL_CFG_Type mcpwm_mco2a_pin[1] = {{1, 28, 1, 0, 0}} |
Motor Control Channel 2 Output A
| const PINSEL_CFG_Type mcpwm_mco2b_pin[1] = {{1, 29, 1, 0, 0}} |
Motor Control Channel 2 Output B
1.5.8