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

相关文章:

猜你喜欢
  • 2022-12-23
  • 2021-09-06
  • 2022-12-23
  • 2021-06-09
  • 2021-06-09
相关资源
相似解决方案