Dependencies:   PinDetect TextLCD mbed mRotaryEncoder

Committer:
cicklaus
Date:
Mon Feb 13 02:11:20 2012 +0000
Revision:
0:afb2650fb49a

        

Who changed what in which revision?

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