Hi,
I am trying to write my own uart init and irq handler routines by accessing the registers directly as per the data sheet. I also referred to https://devzone.nordicsemi.com/f/nordic-q-a/48107/low-level-uart-and-timer-drivers this query on devzone and saw the libuarte code but I believe it is software simulated UART code.
Here is my piece of code
#define UART0_RX 8
#define UART0_TX 6
#define UART0_CTS 7
#define UART0_RTS 5
void uart0Init()
{
NRF_UARTE0->PSEL.RXD = UART0_RX ;
NRF_UARTE0->PSEL.TXD = UART0_TX ;
NRF_UARTE0->PSEL.CTS = UART0_CTS ;
NRF_UARTE0->PSEL.RTS = UART0_RTS ;
NRF_UARTE0->BAUDRATE = 0x01D60000 ; //115200 Baud
NRF_UARTE0->INTEN = 0x00000104 ; //Enable RXDRDY and ENDTX interrupt
}
.
What I want is that where should I write my own IRQ routine so that my code will be directed to this isr like in other MCUs . I also tried doing this:
#define UART0_IRQHandler UARTE0_UART0_IRQHandler
#define UART1_IRQHandler UARTE1_UART1_IRQHandler
void UART0_IRQHandler()
{
//process my isr
}
But it is giving me an error saying multiple definitions of UARTE0 and UARTE1 detected.
I only need Transmit Complete interrupt and Receive Buffer Ready or No Ready interrupt. And need to write my own code for what to do when I get these interrupts.
Please help me get a solution to this