SMS Scheduler that will automatically send and receive text messages using the Enfora 1308 GSM Modem. Please note that it uses a modified NetServices library and to set the baud rate for the GSM Modem to 19.2K.

Dependencies:   mbed

Committer:
mafischl
Date:
Thu Oct 13 18:01:31 2011 +0000
Revision:
1:5a7cce9994a3
Parent:
0:d9266031f832

        

Who changed what in which revision?

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