TM4C123G DSP库移植(keil版) 可以在评估板上直接运行,经测试比不使用DSP库快1.4倍
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-04-15 21:46 DSP
目录 0 2019-04-15 21:30 DSPDSP_LIB
目录 0 2019-04-15 21:25 DSPDSP_LIBInclude
文件 4676 2014-07-17 21:52 DSPDSP_LIBIncludearm_common_tables.h
文件 3666 2014-07-17 21:52 DSPDSP_LIBIncludearm_const_structs.h
文件 242444 2014-07-17 21:52 DSPDSP_LIBIncludearm_math.h
文件 33042 2014-07-17 21:52 DSPDSP_LIBIncludecore_cm0.h
文件 40429 2014-07-17 21:52 DSPDSP_LIBIncludecore_cm0plus.h
文件 99832 2014-07-17 21:52 DSPDSP_LIBIncludecore_cm3.h
文件 109142 2014-07-17 21:52 DSPDSP_LIBIncludecore_cm4.h
文件 22735 2014-07-17 21:52 DSPDSP_LIBIncludecore_cm4_simd.h
文件 17146 2014-07-17 21:52 DSPDSP_LIBIncludecore_cmFunc.h
文件 20513 2014-07-17 21:52 DSPDSP_LIBIncludecore_cmInstr.h
文件 41744 2014-07-17 21:52 DSPDSP_LIBIncludecore_sc000.h
文件 98211 2014-07-17 21:52 DSPDSP_LIBIncludecore_sc300.h
文件 11673458 2014-07-17 21:52 DSPDSP_LIBarm_cortexM4lf_math.lib
目录 0 2019-04-15 21:38 DSPHAREWARE
文件 3382 2019-03-30 16:57 DSPHAREWAREa_pwm.c
文件 407 2019-04-01 19:16 DSPHAREWAREa_pwm.h
文件 1574 2019-04-15 21:37 DSPHAREWAREa_uart.c
文件 456 2019-04-14 13:53 DSPHAREWAREa_uart.h
文件 1207 2019-04-15 12:58 DSPHAREWARE imers.c
文件 577 2019-04-15 12:43 DSPHAREWARE imers.h
文件 102422 2019-04-15 21:46 DSPJlinkLog.txt
文件 576 2019-04-14 13:36 DSPJlinkSettings.ini
目录 0 2019-04-15 21:24 DSPLibraries
目录 0 2019-04-15 21:24 DSPLibrariesdriverlib
文件 4098 2016-07-17 16:33 DSPLibrariesdriverlibMakefile
文件 67583 2016-07-17 16:33 DSPLibrariesdriverlibadc.c
文件 16073 2016-07-17 16:33 DSPLibrariesdriverlibadc.h
文件 45682 2016-07-17 16:33 DSPLibrariesdriverlibaes.c
............此处省略200个文件信息
#include “a_pwm.h“
#define PWM_Period_MAX 3125//2.5ms————400hz
static uint16_t period;
void aPWM_Init(void)//PWM初始化
{
SysCtlPWMClockSet(SYSCTL_PWMDIV_64); // Set divider to 80M/64
SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM0); // Enable PWM peripheral
SysCtlDelay(2); // Insert a few cycles after enabling the peripheral to allow the clock to be fully activated
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); // Enable GPIOB peripheral
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC); // Enable GPIOC peripheral
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE); // Enable GPIOE peripheral
SysCtlDelay(2); // Insert a few cycles after enabling the peripheral to allow the clock to be fully activated
// Use alternate function
GPIOPinConfigure(GPIO_PB6_M0PWM0);
GPIOPinConfigure(GPIO_PB7_M0PWM1);
GPIOPinConfigure(GPIO_PB4_M0PWM2);
GPIOPinConfigure(GPIO_PB5_M0PWM3);
GPIOPinConfigure(GPIO_PE4_M0PWM4);
GPIOPinConfigure(GPIO_PE5_M0PWM5);
GPIOPinConfigure(GPIO_PC4_M0PWM6);
GPIOPinConfigure(GPIO_PC5_M0PWM7);
// Use pin with PWM peripheral
GPIOPinTypePWM(GPIO_PORTB_base GPIO_PIN_6);//M0PWM0
GPIOPinTypePWM(GPIO_PORTB_base GPIO_PIN_7);//M0PWM1
GPIOPinTypePWM(GPIO_PORTB_base GPIO_PIN_4);//M0PWM2
GPIOPinTypePWM(GPIO_PORTB_base GPIO_PIN_5);//M0PWM3
GPIOPinTypePWM(GPIO_PORTE_base GPIO_PIN_4);//M0PWM4
GPIOPinTypePWM(GPIO_PORTE_base GPIO_PIN_5);//M0PWM5
GPIOPinTypePWM(GPIO_PORTC_base GPIO_PIN_4);//M0PWM6
GPIOPinTypePWM(GPIO_PORTC_base GPIO_PIN_5);//M0PWM7
// Configure the PWM generator for count down mode with immediate updates to the parameters
PWMGenConfigure(PWM0_base PWM_GEN_0 PWM_GEN_MODE_DOWN | PWM_GEN_MODE_NO_SYNC);
PWMGenConfigure(PWM0_base PWM_GEN_1 PWM_GEN_MODE_DOWN | PWM_GEN_MODE_NO_SYNC);
PWMGenConfigure(PWM0_base PWM_GEN_2 PWM_GEN_MODE_DOWN | PWM_GEN_MODE_NO_SYNC);
PWMGenConfigure(PWM0_base PWM_GEN_3 PWM_GEN_MODE_DOWN | PWM_GEN_MODE_NO_SYNC);
// The period is set to 2.5ms (400 Hz)
period = PWM_Period_MAX;
PWMGenPeriodSet(PWM0_base PWM_GEN_0 period); // Set the period
PWMGenPeriodSet(PWM0_base PWM_GEN_1 period);
PWMGenPeriodSet(PWM0_base PWM_GEN_2 period); // Set the period
PWMGenPeriodSet(PWM0_base PWM_GEN_3 period);
// Start the timers in generator 0 and 1
PWMGenEnable(PWM0_base PWM_GEN_0);
PWMGenEnable(PWM0_base PWM_GEN_1);
PWMGenEnable(PWM0_base PWM_GEN_2);
PWMGenEnable(PWM0_base PWM_GEN_3);
// Enable the outputs
PWMOutputState(PWM0_base PWM_OUT_0_BIT | PWM_OUT_1_BIT | PWM_OUT_2_BIT | PWM_OUT_3_BIT
| PWM_OUT_4_BIT | PWM_OUT_5_BIT | PWM_OUT_6_BIT | PWM_OUT_7_BIT true);
aPWM_Output(12501250125012501250125012501250);
}
void aPWM_Output(uint16_t width1uint16_t width2uint16_t width3uint16_t width4
uint16_t width5uint16_t width6uint16_t width7uint16_t width8)
{
PWMPulseWidthSet(PWM0_basePWM_OUT_6width1);//PC4
PWMPulse
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-04-15 21:46 DSP
目录 0 2019-04-15 21:30 DSPDSP_LIB
目录 0 2019-04-15 21:25 DSPDSP_LIBInclude
文件 4676 2014-07-17 21:52 DSPDSP_LIBIncludearm_common_tables.h
文件 3666 2014-07-17 21:52 DSPDSP_LIBIncludearm_const_structs.h
文件 242444 2014-07-17 21:52 DSPDSP_LIBIncludearm_math.h
文件 33042 2014-07-17 21:52 DSPDSP_LIBIncludecore_cm0.h
文件 40429 2014-07-17 21:52 DSPDSP_LIBIncludecore_cm0plus.h
文件 99832 2014-07-17 21:52 DSPDSP_LIBIncludecore_cm3.h
文件 109142 2014-07-17 21:52 DSPDSP_LIBIncludecore_cm4.h
文件 22735 2014-07-17 21:52 DSPDSP_LIBIncludecore_cm4_simd.h
文件 17146 2014-07-17 21:52 DSPDSP_LIBIncludecore_cmFunc.h
文件 20513 2014-07-17 21:52 DSPDSP_LIBIncludecore_cmInstr.h
文件 41744 2014-07-17 21:52 DSPDSP_LIBIncludecore_sc000.h
文件 98211 2014-07-17 21:52 DSPDSP_LIBIncludecore_sc300.h
文件 11673458 2014-07-17 21:52 DSPDSP_LIBarm_cortexM4lf_math.lib
目录 0 2019-04-15 21:38 DSPHAREWARE
文件 3382 2019-03-30 16:57 DSPHAREWAREa_pwm.c
文件 407 2019-04-01 19:16 DSPHAREWAREa_pwm.h
文件 1574 2019-04-15 21:37 DSPHAREWAREa_uart.c
文件 456 2019-04-14 13:53 DSPHAREWAREa_uart.h
文件 1207 2019-04-15 12:58 DSPHAREWARE imers.c
文件 577 2019-04-15 12:43 DSPHAREWARE imers.h
文件 102422 2019-04-15 21:46 DSPJli
文件 576 2019-04-14 13:36 DSPJli
目录 0 2019-04-15 21:24 DSPLibraries
目录 0 2019-04-15 21:24 DSPLibrariesdriverlib
文件 4098 2016-07-17 16:33 DSPLibrariesdriverlibMakefile
文件 67583 2016-07-17 16:33 DSPLibrariesdriverlibadc.c
文件 16073 2016-07-17 16:33 DSPLibrariesdriverlibadc.h
文件 45682 2016-07-17 16:33 DSPLibrariesdriverlibaes.c
............此处省略200个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)