This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TMDSEVM572X:用户 LED 控制

Guru**** 2924050 points

Other Parts Discussed in Thread: SYSCONFIG, SYSBIOS

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/666842/tmdsevm572x-user-led-control

器件型号:TMDSEVM572X
Thread 中讨论的其他器件:SysConfigSYSBIOS

我已经编写了一个代码来打开 am572x EVM 上的用户 LED1。 在原理图中、它位于 GPIO7_9上。  

问题是 、当我运行代码时、LED 不会亮起。

我从第7088页读取 AM572x TSM、其中提供了控制 GPIO 所需采取的步骤。

以下是我的代码

GPIO.h

*
*创建日期:2018年2月23日
*作者:Afua
*


#ifndef GPIO_INIT_H_
#define GPIO_INIT_H_
#define GPIO_CTRL_PAD (*(volatile UINT32_t *) 0x4A0037AC)//页4088
#define CM_L4PER_CLKSTCRL (*(volatile UINT32_t *) 0x4A009810)
#define GPIO_SysConfig (*(volatile UINT32_t *) 0x48051010)
#define GPIO_SYSSSTATUS (*(volatile UINT32_t *) 0x48051114)
#define GPIO_CTRL (*(volatile UINT32_t *) 0x48051130)
#define GPIO_OE (*(volatile UINT32_t *) 0x48051134)
#define GPIO_datain (*(volatile UINT32_t *) 0x48051138)
#define GPIO_DATAOUT (*(volatile UINT32_t *) 0x4805113C)
#define GPIO_CLEARDATAOUT (*(volatile UINT32_t *) 0x48051190)
#define GPIO_SETDATAOUT (*(volatile UINT32_t *) 0x48051194)

void GPIO_Init (void);
void GPIO_write (int value);
int GPIO_read (int 值);
void AppDelay (unsigned int delayVal);
#endif /* GPIO_init_H_*/

gpio.c

#include
#include
#include "GPIO_Init.h"


void GPIO_Init (void)

CM_L4PER_CLKSTCRL |= 0x101;
while (!(CM_L4PER_CLKSTCRL 和0x30000)=0){};
GPIO_CTRL_PAD |= 0x0E;
GPIO_SysConfig |= 0x0;
while (((GPIO_SYSSSTATUS & 0x1)=0){};
GPIO_SysConfig |= 0x18;
GPIO_CTRL |= 0x02;
GPIO_OE |= 0xFFFFFF;

void GPIO_write (int value){
GPIO_DATAOUT =值;

int GPIO_read (int 值)


返回(GPIO_datain 和 value);


void AppDelay (unsigned int delayVal)

while (delayVal)

DelayVal---;


/**
* main.c
*
#include
#include
#include "GPIO_Init.h"

#define DELAY_VALUE (0x6FFFFFU)

int main (空)

GPIO_Init();
while (1){
GPIO_WRITE (0x200);
AppDelay (delay_value);
GPIO_WRITE (0x000);



我按照下面的步骤操作、但我知道我错过了一些东西、希望有人可以告诉我