Chapter 5. Uart; Codes - Waveshare NRF52840 User Manual

Eval kit
Table of Contents

Advertisement

NRF52840 Eval Kit User Manual

CHAPTER 5. UART

In this chapter, we describe about how to use UART interface of NRF52840. The
example used herein is 003_UART. With the example, data can be sent from NRF52840
to UART interface, and LED on eval board will turn on/off when receive corresponding
data from UART interface.

CODES

uart.h
#ifndef _UART_H_
#define _UART_H_
#include "nrf.h"
#include "nrf_gpio.h"
#include "app_uart.h"
#include "nrf_uart.h"
#define RX_PIN_NUMBER NRF_GPIO_PIN_MAP(0,8)
#define TX_PIN_NUMBER NRF_GPIO_PIN_MAP(0,6)
#define CTS_PIN_NUMBER NRF_GPIO_PIN_MAP(0,7)
#define RTS_PIN_NUMBER NRF_GPIO_PIN_MAP(0,5)
#define UART_HWFC APP_UART_FLOW_CONTROL_DISABLED
#define MAX_TEST_DATA_BYTES
#define UART_TX_BUF_SIZE 256
#define UART_RX_BUF_SIZE 256
extern
app_uart_comm_params_t
void
uart_error_handle(app_uart_evt_t
#endif
uart.c:
#include "uart.h"
Vision: V1.0.1 Date: 2019.01.19
(15U)
comm_params;
* p_event);
23 / 72

Advertisement

Table of Contents
loading

Table of Contents