JEK changes enabling proper recording of IMU/GPS datastrams - 02-APR-2013

Dependencies:   mbed

Fork of GPS_Incremental by Dan Matthews

Committer:
jekain314
Date:
Fri Apr 19 16:21:27 2013 +0000
Revision:
9:b45feb91ba38
Parent:
0:c746ee34feae
update to allow better imu gps data collection

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dannyman939 0:c746ee34feae 1 /*
dannyman939 0:c746ee34feae 2 Copyright (c) 2010 Andy Kirkham
dannyman939 0:c746ee34feae 3
dannyman939 0:c746ee34feae 4 Permission is hereby granted, free of charge, to any person obtaining a copy
dannyman939 0:c746ee34feae 5 of this software and associated documentation files (the "Software"), to deal
dannyman939 0:c746ee34feae 6 in the Software without restriction, including without limitation the rights
dannyman939 0:c746ee34feae 7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
dannyman939 0:c746ee34feae 8 copies of the Software, and to permit persons to whom the Software is
dannyman939 0:c746ee34feae 9 furnished to do so, subject to the following conditions:
dannyman939 0:c746ee34feae 10
dannyman939 0:c746ee34feae 11 The above copyright notice and this permission notice shall be included in
dannyman939 0:c746ee34feae 12 all copies or substantial portions of the Software.
dannyman939 0:c746ee34feae 13
dannyman939 0:c746ee34feae 14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
dannyman939 0:c746ee34feae 15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
dannyman939 0:c746ee34feae 16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
dannyman939 0:c746ee34feae 17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
dannyman939 0:c746ee34feae 18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
dannyman939 0:c746ee34feae 19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
dannyman939 0:c746ee34feae 20 THE SOFTWARE.
dannyman939 0:c746ee34feae 21 */
dannyman939 0:c746ee34feae 22
dannyman939 0:c746ee34feae 23 #ifndef MODSERIAL_MACROS_H
dannyman939 0:c746ee34feae 24 #define MODSERIAL_MACROS_H
dannyman939 0:c746ee34feae 25
dannyman939 0:c746ee34feae 26 #define MODSERIAL_RBR 0x00
dannyman939 0:c746ee34feae 27 #define MODSERIAL_THR 0x00
dannyman939 0:c746ee34feae 28 #define MODSERIAL_DLL 0x00
dannyman939 0:c746ee34feae 29 #define MODSERIAL_IER 0x04
dannyman939 0:c746ee34feae 30 #define MODSERIAL_DML 0x04
dannyman939 0:c746ee34feae 31 #define MODSERIAL_IIR 0x08
dannyman939 0:c746ee34feae 32 #define MODSERIAL_FCR 0x08
dannyman939 0:c746ee34feae 33 #define MODSERIAL_LCR 0x0C
dannyman939 0:c746ee34feae 34 #define MODSERIAL_LSR 0x14
dannyman939 0:c746ee34feae 35 #define MODSERIAL_SCR 0x1C
dannyman939 0:c746ee34feae 36 #define MODSERIAL_ACR 0x20
dannyman939 0:c746ee34feae 37 #define MODSERIAL_ICR 0x24
dannyman939 0:c746ee34feae 38 #define MODSERIAL_FDR 0x28
dannyman939 0:c746ee34feae 39 #define MODSERIAL_TER 0x30
dannyman939 0:c746ee34feae 40
dannyman939 0:c746ee34feae 41 #define MODSERIAL_LSR_RDR (1UL << 0)
dannyman939 0:c746ee34feae 42 #define MODSERIAL_LSR_OE (1UL << 1)
dannyman939 0:c746ee34feae 43 #define MODSERIAL_LSR_PE (1UL << 2)
dannyman939 0:c746ee34feae 44 #define MODSERIAL_LSR_FE (1UL << 3)
dannyman939 0:c746ee34feae 45 #define MODSERIAL_LSR_BR (1UL << 4)
dannyman939 0:c746ee34feae 46 #define MODSERIAL_LSR_THRE (1UL << 5)
dannyman939 0:c746ee34feae 47 #define MODSERIAL_LSR_TEMT (1UL << 6)
dannyman939 0:c746ee34feae 48 #define MODSERIAL_LSR_RXFE (1UL << 7)
dannyman939 0:c746ee34feae 49
dannyman939 0:c746ee34feae 50 #define MODSERIAL_FIFO_ENABLE 1
dannyman939 0:c746ee34feae 51 #define MODSERIAL_FIFO_RX_RESET 2
dannyman939 0:c746ee34feae 52 #define MODSERIAL_FIFO_TX_RESET 4
dannyman939 0:c746ee34feae 53
dannyman939 0:c746ee34feae 54 #define _RBR *((char *)_base+MODSERIAL_RBR)
dannyman939 0:c746ee34feae 55 #define _THR *((char *)_base+MODSERIAL_THR)
dannyman939 0:c746ee34feae 56 #define _IIR *((char *)_base+MODSERIAL_IIR)
dannyman939 0:c746ee34feae 57 #define _IER *((char *)_base+MODSERIAL_IER)
dannyman939 0:c746ee34feae 58 #define _LSR *((char *)_base+MODSERIAL_LSR)
dannyman939 0:c746ee34feae 59 #define _FCR *((char *)_base+MODSERIAL_FCR)
dannyman939 0:c746ee34feae 60
dannyman939 0:c746ee34feae 61 #define MODSERIAL_TX_BUFFER_EMPTY (buffer_count[TxIrq]==0)
dannyman939 0:c746ee34feae 62 #define MODSERIAL_RX_BUFFER_EMPTY (buffer_count[RxIrq]==0)
dannyman939 0:c746ee34feae 63 #define MODSERIAL_TX_BUFFER_FULL (buffer_count[TxIrq]==buffer_size[TxIrq])
dannyman939 0:c746ee34feae 64 #define MODSERIAL_RX_BUFFER_FULL (buffer_count[RxIrq]==buffer_size[RxIrq])
dannyman939 0:c746ee34feae 65
dannyman939 0:c746ee34feae 66 #define MODSERIAL_THR_HAS_SPACE ((int)_LSR&MODSERIAL_LSR_THRE)
dannyman939 0:c746ee34feae 67 #define MODSERIAL_TEMT_IS_EMPTY ((int)_LSR&MODSERIAL_LSR_TEMT)
dannyman939 0:c746ee34feae 68 #define MODSERIAL_RBR_HAS_DATA ((int)_LSR&MODSERIAL_LSR_RDR)
dannyman939 0:c746ee34feae 69
dannyman939 0:c746ee34feae 70 #endif