JN5168

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决
5,172 次查看
shicaisun
Contributor I
Hello:
How to learn JN5168 better, I feel a little difficult, I have no way to do it.
BR
Arvin
标签 (1)
0 项奖励
回复
1 解答
4,788 次查看
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Shicai Sun,

Please take as reference  the JN516x Integrated Peripherals API User Guide  Chapter 5.1 Using the DIOs

Example; Input Pin configuration

PUBLIC bool_t APP_bButtonInitialise(void)
{
    /* Set DIO lines to inputs with buttons connected */
    vAHI_DioSetDirection(APP_BUTTONS_DIO_MASK, 0);

    /* Turn on pull-ups for DIO lines with buttons connected */
    vAHI_DioSetPullup(APP_BUTTONS_DIO_MASK, 0);

    /* Set the edge detection for falling edges */
    vAHI_DioInterruptEdge(0, APP_BUTTONS_DIO_MASK);

    /* Enable interrupts to occur on selected edge */
    vAHI_DioInterruptEnable(APP_BUTTONS_DIO_MASK, 0);

    uint32 u32Buttons = u32AHI_DioReadInput() & APP_BUTTONS_DIO_MASK;

    /* If we came out of deep sleep; perform an appropriate action as well based
       on button press.*/
    APP_cbTimerButtonScan(NULL);

    if (u32Buttons != APP_BUTTONS_DIO_MASK)
    {
        return TRUE;
    }
    return FALSE;
}

Hope it helps,

Mario

在原帖中查看解决方案

0 项奖励
回复
6 回复数
4,788 次查看
shicaisun
Contributor I

Hi,

Please see below:

In some of the above functions, a 32-bit bitmap is used to represent the set of DIOs. In the bitmap, each of bits 0 to 19 represents a DIO pin, where bit 0 represents DIO0 and bit 19 represents DIO19 (bits 20-31 are unused).

I want to know ,1 is set or 0 is set.

(I feel like an idiot)

Thank for you !

BR

Arvin

0 项奖励
回复
4,788 次查看
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Shica,

For example;

/* Set DIO lines to inputs with buttons connected */
vAHI_DioSetDirection(APP_BUTTONS_DIO_MASK, 0);

APP_BUTTONS_DIO_MASK = (1 << APP_BUTTONS_BUTTON_1) and the APP_BUTTONS_BUTTON_1 is equal to 8.

So, for setting the direction in this case 1 is to set.

Please let me if you have more questions.

Mario

0 项奖励
回复
4,788 次查看
shicaisun
Contributor I

How to set up DIO?

0 项奖励
回复
4,787 次查看
shicaisun
Contributor I

Hi,


APP_BUTTONS_DIO_MASK?

BR

Arvin

0 项奖励
回复
4,789 次查看
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Shicai Sun,

Please take as reference  the JN516x Integrated Peripherals API User Guide  Chapter 5.1 Using the DIOs

Example; Input Pin configuration

PUBLIC bool_t APP_bButtonInitialise(void)
{
    /* Set DIO lines to inputs with buttons connected */
    vAHI_DioSetDirection(APP_BUTTONS_DIO_MASK, 0);

    /* Turn on pull-ups for DIO lines with buttons connected */
    vAHI_DioSetPullup(APP_BUTTONS_DIO_MASK, 0);

    /* Set the edge detection for falling edges */
    vAHI_DioInterruptEdge(0, APP_BUTTONS_DIO_MASK);

    /* Enable interrupts to occur on selected edge */
    vAHI_DioInterruptEnable(APP_BUTTONS_DIO_MASK, 0);

    uint32 u32Buttons = u32AHI_DioReadInput() & APP_BUTTONS_DIO_MASK;

    /* If we came out of deep sleep; perform an appropriate action as well based
       on button press.*/
    APP_cbTimerButtonScan(NULL);

    if (u32Buttons != APP_BUTTONS_DIO_MASK)
    {
        return TRUE;
    }
    return FALSE;
}

Hope it helps,

Mario

0 项奖励
回复
4,787 次查看
shicaisun
Contributor I

Hi,

OK,

Let  me a look  at that document.

I  try to test it.

Thank for you !

BR

Arvin.Sun

0 项奖励
回复