Part Number: TDA2
Tool/software: TI-RTOS
Hi Sir,
I has Vayu EVM board (Rev.H) + SDK 03_03_00_00 and will drive GPIO_5[8] to output high or low.
I refer PDK document "API_Documentation.html" to know how to program it.
--------------------------------------------------------------------------------------
Programming sequence of gpio module is:
- Enable the functional clocks for the required GPIO instance.
- Perform a pin multiplexing for the required GPIO pin.
- Enable the GPIO module using the API GPIOModuleEnable.
- Perform a module reset of the GPIO module using the API GPIOModuleReset.
- When GPIO is input pin, following configuration is used
- Enable/disable debouncing feature for the specified input GPIO pin if required, using the API GPIODebounceFuncControl.
- Program the debouncing time, if required using the API GPIODebounceTimeConfig.
- Interrupt trigger conditions need to be configured using the API GPIOIntTypeSet.
- Enable GPIO to generate interrupts on detection of the specified transitions on the decided GPIO pin using the API GPIOPinIntEnable.
- When GPIO is output pin, following configuration is used
- A logic HIGH or a logic LOW could be driven on the specified GPIO pin by invoking the API GPIOPinWrite.
--------------------------------------------------------------------------------------
my sample code as below:
// a. Enable the functional clocks for the required GPIO instance.
/* Set the access to the GPMC registers - Enable GPMC Clock */
HW_WR_REG32(SOC_L4PER_CM_CORE_BASE + CM_L4PER_GPIO5_CLKCTRL, 0x101);
while ((HW_RD_REG32(SOC_L4PER_CM_CORE_BASE +
CM_L4PER_GPIO5_CLKCTRL) & (0x00030000U)) != 0x0)
{ ; }
// b. Perform a pin multiplexing for the required GPIO pin.
HW_WR_REG32(SOC_CORE_PAD_IO_REGISTERS_BASE + CTRL_CORE_PAD_MCASP1_AXR6,
(0x60000U | CTRL_CORE_PAD_MCASP1_AXR6_MCASP1_AXR6_MUXMODE_GPIO5_8_14)); //C12
GPIODirModeSet(SOC_GPIO5_BASE, 8, GPIO_DIR_OUTPUT); //C12
// c. Enable the GPIO module using the API GPIOModuleEnable.
GPIOModuleEnable(SOC_GPIO5_BASE);
// d. Perform a module reset of the GPIO module using the API GPIOModuleReset.
GPIOModuleReset(SOC_GPIO5_BASE);
// Set C12 to high.
GPIOPinWrite(SOC_GPIO5_BASE, 8, GPIO_PIN_HIGH); //C12
The sample code still can't drive GPIO_5[8], could you please give me some suggestion.
Thanks.