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

📄 dsp281x_gpio.c

📁 TI DSP芯片TMS320LF2812 完整结构形式头文件及相应的模块初始化C代码.rar
💻 C
字号:
//###########################################################################
//
// FILE:	DSP281x_Gpio.c
//
// TITLE:	DSP281x General Purpose I/O Initialization & Support Functions.
//
//###########################################################################
//
//  Ver | dd mmm yyyy | Who  | Description of changes
// =====|=============|======|===============================================
//  1.00| 11 Sep 2003 | L.H. | No change since previous version (v.58 Alpha)
//###########################################################################

#include "Device.h"     // DSP281x Headerfile Include File
#include "DSP281x_Examples.h"   // DSP281x Examples Include File

//---------------------------------------------------------------------------
// InitGpio: 
//---------------------------------------------------------------------------
// This function initializes the Gpio to a known state.
//
void InitGpio(void)
{

// Set GPIO A port pins,AL(Bits 7:0)(input)-AH(Bits 15:8) (output) 8bits
// Input Qualifier =0, none
     EALLOW;
     GpioMuxRegs.GPAMUX.all=0x0000;	 //as io
     GpioMuxRegs.GPADIR.all=0xFCFF; // as output 1111110011111111
     	 
     GpioMuxRegs.GPBMUX.all=0x0000;	 //as io
     GpioMuxRegs.GPBDIR.all=0x0000; // as input
     	 

     GpioMuxRegs.GPDMUX.all=0x0000;	 //as io 	 
     GpioMuxRegs.GPDDIR.all=0x0063;  // as input 0000,0000,0110,0011

     GpioMuxRegs.GPFMUX.all=0X0000; // Select GPIOF I/O   
     GpioMuxRegs.GPFDIR.all=0X100F; // Select GPIOF12 Output

     GpioMuxRegs.GPGMUX.all=0x0000;		 
     GpioMuxRegs.GPGDIR.all=0xFFFF;    	// as output

// 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
     EDIS;
}	
	
//===========================================================================
// No more.
//===========================================================================

⌨️ 快捷键说明

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