The nRF51822 only has one UART and my app needed two. One for a GPS receiver and one for a simple terminal command line interface. The UART RX is interrupt driven, but TX is only polled.
It is tested on the nRF51822-EK using Keil MDK. Unzip the project in any directory and build. I've copied the "source" and "include" directories from the C:\Keil\ARM\Device\Nordic\nrf51822 directory into my own svn repository.
The attached project does the following:
- defaults to GPS receiver port on power-up
- Using GPIOTE, any key entry from the terminal port causes an interrupt which switches from GPS gpio pins to the terminal interface.
- Hitting the "enter" key brings up a >> prompt.
- Entering the "q" command returns it back to the GPS gpio pins
Hope this is useful to someone.