主題:em335 GPIO 設置問題 共有35111人關注過本帖 |
---|
![]() benben |
1樓 信息 | 搜索 | 郵箱 |
![]() ![]() ![]() ![]() |
em335 GPIO 設置問題 ![]() em335 linux系統下,代碼如下: int fd = open("/dev/em335x_gpio", O_RDWR); int rc = GPIO_OutEnable(fd, 0x4500000); uint dwPinState = 0xFFFFFFFF; rc = GPIO_OutClear(fd, 1 << 20); rc = GPIO_PinState(fd, &dwPinState); //1 rc = GPIO_OutSet(fd, 1 << 20); rc = GPIO_PinState(fd, &dwPinState); //2 問題:1執行完,dwPinState值為ffeff3ff,2執行完,dwPinState值仍然為ffeff3ff。 GPIO_OutSet沒有起作用,2執行完,dwPinState的值不應該是fffff3ff嗎? 我這么寫有什么問題嗎? 調用函數用的例程test_gpio.c里的。 |
單帖管理 | 引用 | 回復 ![]() |