首页 > 其他 > 详细

uart write example

时间:2021-08-30 01:13:11      阅读:7      评论:0      收藏:0      [点我收藏+]


static void uart_loopback_test()
{
uint8_t tx_data[8] = {0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00};
uint8_t tx_dataRelease[8] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
// uint8_t *pData = (uint8_t)&tx_data;


// Start sending one byte and see if you get the same
for (uint32_t i = 0; i < 8; i++)
{
uint32_t err_code;
while (app_uart_put(tx_data[i]) != NRF_SUCCESS);
nrf_delay_ms(200);

}

for (uint32_t i = 0; i < 8; i++)
{
uint32_t err_code;
while (app_uart_put(tx_dataRelease[i]) != NRF_SUCCESS);
nrf_delay_ms(10);
}

nrf_delay_ms(10000);
return;
}
#else
/* When UART is used for communication with the host do not use flow control.*/
#define UART_HWFC APP_UART_FLOW_CONTROL_DISABLED
#endif

uart write example

原文:https://www.cnblogs.com/wblade/p/15201826.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!