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.

[参考译文] Linux/66AK2L06:存储器映射 GPIO 出错。

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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/666224/linux-66ak2l06-error-in-memory-mapping-gpio

器件型号:66AK2L06

工具/软件:Linux

您好!

我将尝试使用 GPIO 2、3输入和输出。

我将使用 mmap()来控制 GPIO,因为 sysfs 太慢(我希望输出频率达到5MHz)。

我在下面知道。

#define GPIO_base0x0260BF00
#define GPIO_START_ADD0x0260BF00
#define GPIO_END_ADD0x0260BFFF

static int DEV_FD;

int main (void){

DEV_FD = open ("/dev/mem、O_RDWR | O_SYNC);

if (DEV_FD < 0){
printf ("oepn)、



unsigned t_map (/dev/mem)、unsigned t_map (nF)、t + t + t_map (unsigned t)、t + t + t_return)。 GPIO_base);

如果(map_base =map_failed){
perror ("Map failed;\n");
return -1;
}

return 0;
} 

结果是无效的参数。

什么是问题?

谢谢!