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.

[参考译文] CC2640R2F:GPIO 读取问题

Guru**** 2589280 points


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

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/603022/cc2640r2f-gpio-read-issue

器件型号:CC2640R2F

尊敬的 TI:

我可以从您的"gpiointerrupt"示例代码中读取并写入 GPIO DIO6 (红色)和 DIO7 (绿色)的 LED 信号。

现在、我已经在 GIPO (21)[DIO 21]上设置了我的硬件并尝试读取它。 但我始终从21的 GPIO 中获取0。 我认为 GPIO (21)的值需要为1。

请帮帮我。

我还发布了我的源代码、请参阅我的源代码。 如果您希望我提供更多信息、请告诉我。

void * mainThread (void * arg0)

三、会议的报告

uint_fast8_t temp_LED1=0;
uint_fast8_t temp_LED0=0;
//unsigned int temp;
uint_fast8_t temp;
//unsigned int ledPinValue;


//Display_printf (display、0、0、"enter gpioin function\n");

/*调用驱动程序初始化函数*/
GPIO_init();

/*打开用户 LED */
GPIO_WRITE (Board_GPIO_LED0、Board_GPIO_LED_ON);

TEMP_LED1=GPIO_READ (Board_GPIO_LED1);
TEMP_LED0=GPIO_READ (3);
TEMP=GPIO_READ (Board_DIO21);


printf ("temp_LED1 value="%d\n"、temp_LED1);
printf ("temp_LED0 value="%d\n"、temp_LED0);
//printf ("第一个 temp9值=%d\n"、temp);
//ledPinValue=PIN_getOutputValue (Board_PIN_LED0);
//temp=PIN_getOutputValue (Board_DIO21);

printf ("temp=%d\n"temp);

…………

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

    尊敬的 TI:

    我找到了一种读取 GPIO 的方法。

    谢谢你

    劳伦斯

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

    您能否发布您找到的内容? 也许其他人会觉得它有用!

    很高兴听到您发现了它、

    此致、
    反叛分子