Hi I plan on using two UART modules from the nRF52840 which is why I am trying to use the app_uart_init however at this stage I keep getting the following error:
undefined reference to 'app_uart_init'
Moreover what is the difference between UARTE and UART? or would you recommend using the Serial library instead?
#include <stdbool.h>
#include <stdint.h>
#include "nrf_delay.h"
#include "nrf_gpio.h"
#include "app_uart.h"
#include "nrf_uart.h"
#define UART1_TX NRF_GPIO_PIN_MAP(1,1)
#define UART1_RX NRF_GPIO_PIN_MAP(1,2)
void uart_error_handle(app_uart_evt_t * p_event)
{
}
int main(void)
{
/*UART*/
const app_uart_comm_params_t comm_params =
{
UART1_RX,
UART1_TX,
APP_UART_FLOW_CONTROL_DISABLED,
false,
NRF_UART_BAUDRATE_9600
};
uint8_t UART1_RX_BUF;
uint8_t UART1_TX_BUF;
const app_uart_buffers_t p_buffers =
{
UART1_RX_BUF,
255,
UART1_TX_BUF,
255
};
app_uart_init (&comm_params,&p_buffers,uart_error_handle,APP_IRQ_PRIORITY_LOWEST);
}