JN5168

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
4,688件の閲覧回数
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,304件の閲覧回数
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,304件の閲覧回数
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,304件の閲覧回数
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,304件の閲覧回数
shicaisun
Contributor I

How to set up DIO?

0 件の賞賛
返信
4,303件の閲覧回数
shicaisun
Contributor I

Hi,


APP_BUTTONS_DIO_MASK?

BR

Arvin

0 件の賞賛
返信
4,305件の閲覧回数
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,303件の閲覧回数
shicaisun
Contributor I

Hi,

OK,

Let  me a look  at that document.

I  try to test it.

Thank for you !

BR

Arvin.Sun

0 件の賞賛
返信