summaryrefslogtreecommitdiff
path: root/software/ihu/uart.inc
diff options
context:
space:
mode:
authorChristian Pointner <equinox@mur.at>2013-06-30 17:40:35 +0000
committerChristian Pointner <equinox@mur.at>2013-06-30 17:40:35 +0000
commit71f93c3098e14ac5d8eacf47529045d38272a8dc (patch)
tree693028a65288130ae1d521cc8b7d4a85c6cc7e6a /software/ihu/uart.inc
parentfixed inverted UART for IHU-MPU Interface (diff)
moved UART code to seperate file
git-svn-id: https://svn.spreadspace.org/mur.sat@798 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/ihu/uart.inc')
-rw-r--r--software/ihu/uart.inc48
1 files changed, 48 insertions, 0 deletions
diff --git a/software/ihu/uart.inc b/software/ihu/uart.inc
new file mode 100644
index 0000000..196fc80
--- /dev/null
+++ b/software/ihu/uart.inc
@@ -0,0 +1,48 @@
+ ;;
+ ;; mur.sat
+ ;;
+ ;; Somewhen in the year 2012, mur.at will have a nano satellite launched
+ ;; into a low earth orbit (310 km above the surface of our planet). The
+ ;; satellite itself is a TubeSat personal satellite kit, developed and
+ ;; launched by interorbital systems. mur.sat is a joint venture of mur.at,
+ ;; ESC im Labor and realraum.
+ ;;
+ ;; Please visit the project hompage at sat.mur.at for further information.
+ ;;
+ ;;
+ ;; Copyright (C) 2011 Christian Pointner <equinox@mur.at>
+ ;;
+ ;; This file is part of mur.sat.
+ ;;
+ ;; mur.sat is free software: you can redistribute it and/or modify
+ ;; it under the terms of the GNU General Public License as published by
+ ;; the Free Software Foundation, either version 3 of the License, or
+ ;; any later version.
+ ;;
+ ;; mur.sat is distributed in the hope that it will be useful,
+ ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ ;; GNU General Public License for more details.
+ ;;
+ ;; You should have received a copy of the GNU General Public License
+ ;; along with mur.sat. If not, see <http://www.gnu.org/licenses/>.
+ ;;
+
+ ;; -------------------------------------
+uart_tx_byte
+ btfss PIR1,TXIF
+ goto uart_tx_byte
+ movwf TXREG
+ return
+
+ ;; -------------------------------------
+uart_rx_byte
+ btfsc RCSTA,FERR
+ goto uart_rx_fe
+ movf RCREG,w ; TODO: check parity
+ movwf TMP ; TODO: move to input string
+ return
+
+uart_rx_fe
+ movf RCREG,w
+ return