?? f281x_en.c
字號:
/* ==================================================================================
File name: F281X_EN.C
Originator: Digital Control Systems Group
Texas Instruments
Description: This program configures the I/O pins and enables/disables the drive on DMC1500
Target: TMS320F281x family
=====================================================================================
History:
-------------------------------------------------------------------------------------
04-15-2005 Version 3.20: Using DSP281x v. 1.00 or higher
------------------------------------------------------------------------------------*/
#include "DSP281x_Device.h"
#include "f281x_en.h"
void F281X_EV1_DRIVE_Init(DRIVE *p)
{
// IOPB4: strobe_ (T1PWM_GPIOA6); IO PB6: enable_ (TDIRA_GPIOA11)
EALLOW; // Enable EALLOW
GpioMuxRegs.GPAMUX.bit.T1PWM_GPIOA6 = 0;
GpioMuxRegs.GPAMUX.bit.TDIRA_GPIOA11 = 0;
// config IOPB4 & IOPB6 as outputs and output "1" to disable drive
GpioMuxRegs.GPADIR.bit.GPIOA6 = 1;
GpioMuxRegs.GPADIR.bit.GPIOA11 = 1;
EDIS; // Disable EALLOW
}
void F281X_EV1_DRIVE_Update(DRIVE *p)
{
if (p->EnableFlag==1) // Enable PWM drive on DMC1500
{
GpioDataRegs.GPADAT.bit.GPIOA6 = 0; // IOPB4 low (T1PWM_GPIOA6)
GpioDataRegs.GPADAT.bit.GPIOA6 = 1; // IOPB4 high (T1PWM_GPIOA6)
GpioDataRegs.GPADAT.bit.GPIOA11 = 0; // IOPB6 low (T1PWM_GPIOA11)
}
else if (p->EnableFlag==0) // Disable PWM drive on DMC1500
{
GpioDataRegs.GPADAT.all |= 0x0840; // IOPB4 (T1PWM_GPIOA6) & IOPB6 (T1PWM_GPIOA11) outputs high
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -