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

posted on 2021-08-29 08:07  wblade  阅读(129)  评论(0编辑  收藏  举报