1309 views|0 replies

6547

Posts

0

Resources
The OP
 

How to configure the input and output of a GPIO in the TMS320C6000 series DSP? [Copy link]

1) Enable the general purpose input and output port peripheral (GPIO).

// Enable the GPIO module (the corresponding peripheral module can also be enabled in BootLoader)

PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_GPIO, PSC_POWERDOMAIN_ALWAYS_ON, PSC_MDCTL_NEXT_ENABLE);

2) Configure the corresponding GPIO port as a normal input and output port (select the multiplexing function in I/O multiplexing).

savePinmux = (HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(1)) &

~(SYSCFG_PINMUX1_PINMUX1_31_28)); //Read the value of the corresponding register

HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(1)) =

(PINMUX1_GPIO0_0_ENABLE | savePinmux); //Set the value of the corresponding register

HWREG: Macro definition of the value of the peripheral register.

3) Configure the corresponding GPIO port as input or output.

GPIODirModeSet(SOC_GPIO_0_REGS, 1, GPIO_DIR_OUTPUT); GPIO_DIR_INPUT

4) Configure the corresponding GPIO port to input or output high or low levels.

GPIOPinWrite(SOC_GPIO_0_REGS, 1, GPIO_PIN_LOW); //Low level GPIO0[0]

GPIOPinWrite(SOC_GPIO_0_REGS, 1, GPIO_PIN_HIGH); //High level GPIO0[0]

This post is from DSP and ARM Processors
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list