Usage of UART receive callback function

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Usage of UART receive callback function

ソリューションへジャンプ
3,061件の閲覧回数
eugenephua
Contributor III

Hi there, I am using KSDK1.2.0 with KDS 3.0.0 with FRDM-KL25Z board. I am trying to understand the purpose of the UART receive callback function when setting the parameters of UART in processor expert. In the callback function generated, there are 2 input parameters: uint32_t instance and void *uartState. How do i make use of these to obtain the received character in the UART?

ラベル(1)
タグ(3)
0 件の賞賛
返信
1 解決策
1,213件の閲覧回数
ivadorazinova
NXP Employee
NXP Employee

Hello Eugene,

you can get it for example by this way:

void uartCom1_RxCallback(uint32_t instance, void * uartState)

{

  /* Write your code here ... */

    uint8_t buffer[5]={0};

    UART_DRV_ReceiveData(instance,buffer,1);

}

where instance is UART number.

I hope this helps.

Best Regards,

Iva

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,214件の閲覧回数
ivadorazinova
NXP Employee
NXP Employee

Hello Eugene,

you can get it for example by this way:

void uartCom1_RxCallback(uint32_t instance, void * uartState)

{

  /* Write your code here ... */

    uint8_t buffer[5]={0};

    UART_DRV_ReceiveData(instance,buffer,1);

}

where instance is UART number.

I hope this helps.

Best Regards,

Iva

0 件の賞賛
返信
1,213件の閲覧回数
eugenephua
Contributor III

Hi Eva,

Thanks, that helps!

Regards

Eugene

0 件の賞賛
返信