⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 f2812_gpio.c

📁 TMS320F2812串行口通信程序-采用循环缓冲区方式
💻 C
字号:

#include "F2812_GPIO.h"
//---------------------------------------------------------------------------
// InitGpio: 
//---------------------------------------------------------------------------
// This function initializes the Gpio to a known state.


#if PERIPHERAL == F2812_GPIO

void GPIOinit(void)
{
	
// Set GPIO A port pins,AL(Bits 7:0)(input)-AH(Bits 15:8) (output) 8bits
// Input Qualifier =0, none
     asm(" EALLOW");
     
     GpioMuxRegs.GPAMUX.all=0x0000;     
     GpioMuxRegs.GPADIR.all=0xFFFF;    	// as output
     GpioMuxRegs.GPAQUAL.all=0x0000;	// Input qualifier disabled

     GpioMuxRegs.GPBMUX.all=0x0000;     
     GpioMuxRegs.GPBDIR.all=0xFFFF;    	// as output
     GpioMuxRegs.GPBQUAL.all=0x0000;	// Input qualifier disabled
    
     GpioMuxRegs.GPDMUX.all=0x0000;     
     GpioMuxRegs.GPDDIR.all=0xFFFF;    	// as output
     GpioMuxRegs.GPDQUAL.all=0x0000;	// Input qualifier disabled
     
     GpioMuxRegs.GPEMUX.all=0x0000;     
     GpioMuxRegs.GPEDIR.all=0xFFFF;    	// as output
     GpioMuxRegs.GPEQUAL.all=0x0000;	// Input qualifier disabled
     
     GpioMuxRegs.GPFMUX.all=0x0000;     
     GpioMuxRegs.GPFDIR.all=0xFFFF;    	// as output
    
     GpioMuxRegs.GPGMUX.all=0x0000;     
     GpioMuxRegs.GPGDIR.all=0xFFFF;    	// as output
	
     asm(" EDIS");
}

//#elif PERIPHERAL == F2812_NOTGPIO
#else
void GPIOInit(void)
{

// Set GPIO A port pins,AL(Bits 7:0)(input)-AH(Bits 15:8) (output) 8bits
// Input Qualifier =0, none
     asm(" EALLOW");
     GpioMuxRegs.GPAMUX.all=0x0000;     
     GpioMuxRegs.GPADIR.all=0xFF00;    	// upper byte as output/low byte as input
     GpioMuxRegs.GPAQUAL.all=0x0000;	// Input qualifier disabled

// Set GPIO B port pins, configured as EVB signals
// Input Qualifier =0, none
// Set bits to 1 to configure peripherals signals on the pins
     GpioMuxRegs.GPBMUX.all=0xFFFF;   
     GpioMuxRegs.GPBQUAL.all=0x0000;	// Input qualifier disabled
     
//set GPIO F port pins,configured as scia & spi
	 GpioMuxRegs.GPFMUX.all=0x003f;
	
//set GPIO g port pins,configured as scib
     GpioMuxRegs.GPGMUX.all=0x0030;
	
     asm(" EDIS");

}

#endif
	
	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -