summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/lm32/milkymist/Documentation/uart.txt
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-08-20 21:22:27 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-08-20 21:22:27 +0000
commit8affb5a9ed3661f67c8394094df617d004a19334 (patch)
tree188819f5aeb0aa92c18e100032a0c44984a77fee /c/src/lib/libbsp/lm32/milkymist/Documentation/uart.txt
parent2010-08-20 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-8affb5a9ed3661f67c8394094df617d004a19334.tar.bz2
2010-08-20 <yann.sionneau@telecom-sudparis.eu>
Add Milkymist BSP developed as part of GSOC 2010. * ChangeLog, Makefile.am, README, bsp_specs, configure.ac, preinstall.am, Documentation/uart.txt, include/.cvsignore, include/bsp.h, include/system_conf.h, include/tm27.h, make/custom/milkymist.cfg, startup/linkcmds: New files.
Diffstat (limited to 'c/src/lib/libbsp/lm32/milkymist/Documentation/uart.txt')
-rw-r--r--c/src/lib/libbsp/lm32/milkymist/Documentation/uart.txt31
1 files changed, 31 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/lm32/milkymist/Documentation/uart.txt b/c/src/lib/libbsp/lm32/milkymist/Documentation/uart.txt
new file mode 100644
index 0000000000..b5b93043e9
--- /dev/null
+++ b/c/src/lib/libbsp/lm32/milkymist/Documentation/uart.txt
@@ -0,0 +1,31 @@
+Initialization :
+
+ set the CSR_UART_DIVISOR to the correct VALUE,
+ depending on the internal frequency of the LatticeMico32 softcore.
+
+ for the ML401 board, this value is calculated using this formula : clk_frequency/230400/16
+ clk_frequency = 100000000 Hz
+ => we must set CSR_UART_DIVISOR to 27
+
+How to send a byte to uart :
+
+void writechar(char c)
+{
+ CSR_UART_RXTX = c;
+ while(!(irq_pending() & IRQ_UARTTX));
+ irq_ack(IRQ_UARTTX);
+}
+
+How to receive a byte from uart :
+
+
+char readchar()
+{
+ char c;
+ while(!(irq_pending() & IRQ_UARTRX));
+ irq_ack(IRQ_UARTRX);
+ c = CSR_UART_RXTX;
+ return c;
+}
+
+