JN5168

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
1,385 Views
shicaisun
Contributor I
Hello:
How to learn JN5168 better, I feel a little difficult, I have no way to do it.
BR
Arvin
Labels (1)
0 Kudos
1 Solution
1,001 Views
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

View solution in original post

0 Kudos
6 Replies
1,001 Views
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 Kudos
1,001 Views
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 Kudos
1,001 Views
shicaisun
Contributor I

How to set up DIO?

0 Kudos
1,000 Views
shicaisun
Contributor I

Hi,


APP_BUTTONS_DIO_MASK?

BR

Arvin

0 Kudos
1,002 Views
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 Kudos
1,000 Views
shicaisun
Contributor I

Hi,

OK,

Let  me a look  at that document.

I  try to test it.

Thank for you !

BR

Arvin.Sun

0 Kudos