I'm making UART support for SAM3x8e based Arduino Due board. I would like to clarify questions I can't resolve by searching the web.
Is it only one IRQ handler per MCU component like USART? This means that I should use status register of component to find out what event exactly occurred?
Is it just enough to define function with predefined name like
void USART0_Handler(void) {}
for USART0 component and USART1_Handler for USART1 and etc.?
- The MCU has UART, USART0, USART1, USART2, USART3 devices (components) on board. I looked into arduino source code, exactly
arduino-1.5.7/hardware/arduino/sam/variants/arduino_due_x/variant.cpp
and see that for serial0 UART component is used, for serial1 USART0 is used, for serial2 - USART1 and for serail3 - USART3. The USART2 is not even mentioned. The question why is this done that way? What does the UART, USART0, USART1, USART2, USART3 mean? I would like to know what names should I use to properly communicate through board's pins like TX0/RX0, TX1/RX1 and etc.
Thanx in advance.