Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP
Fork of SystemManagement by
Libs/MODSERIAL/MACROS.h@32:e70407021ad2, 2014-11-16 (annotated)
- Committer:
- pspatel321
- Date:
- Sun Nov 16 02:43:58 2014 +0000
- Revision:
- 32:e70407021ad2
- Parent:
- 31:7eaa5e881b56
Changed watchdog to 110ms from 250ms. Forgot to change it back.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| pspatel321 | 31:7eaa5e881b56 | 1 | /* |
| pspatel321 | 31:7eaa5e881b56 | 2 | Copyright (c) 2010 Andy Kirkham |
| pspatel321 | 31:7eaa5e881b56 | 3 | |
| pspatel321 | 31:7eaa5e881b56 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy |
| pspatel321 | 31:7eaa5e881b56 | 5 | of this software and associated documentation files (the "Software"), to deal |
| pspatel321 | 31:7eaa5e881b56 | 6 | in the Software without restriction, including without limitation the rights |
| pspatel321 | 31:7eaa5e881b56 | 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| pspatel321 | 31:7eaa5e881b56 | 8 | copies of the Software, and to permit persons to whom the Software is |
| pspatel321 | 31:7eaa5e881b56 | 9 | furnished to do so, subject to the following conditions: |
| pspatel321 | 31:7eaa5e881b56 | 10 | |
| pspatel321 | 31:7eaa5e881b56 | 11 | The above copyright notice and this permission notice shall be included in |
| pspatel321 | 31:7eaa5e881b56 | 12 | all copies or substantial portions of the Software. |
| pspatel321 | 31:7eaa5e881b56 | 13 | |
| pspatel321 | 31:7eaa5e881b56 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| pspatel321 | 31:7eaa5e881b56 | 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| pspatel321 | 31:7eaa5e881b56 | 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| pspatel321 | 31:7eaa5e881b56 | 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| pspatel321 | 31:7eaa5e881b56 | 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| pspatel321 | 31:7eaa5e881b56 | 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| pspatel321 | 31:7eaa5e881b56 | 20 | THE SOFTWARE. |
| pspatel321 | 31:7eaa5e881b56 | 21 | */ |
| pspatel321 | 31:7eaa5e881b56 | 22 | |
| pspatel321 | 31:7eaa5e881b56 | 23 | #ifndef MODSERIAL_MACROS_H |
| pspatel321 | 31:7eaa5e881b56 | 24 | #define MODSERIAL_MACROS_H |
| pspatel321 | 31:7eaa5e881b56 | 25 | |
| pspatel321 | 31:7eaa5e881b56 | 26 | #define MODSERIAL_RBR 0x00 |
| pspatel321 | 31:7eaa5e881b56 | 27 | #define MODSERIAL_THR 0x00 |
| pspatel321 | 31:7eaa5e881b56 | 28 | #define MODSERIAL_DLL 0x00 |
| pspatel321 | 31:7eaa5e881b56 | 29 | #define MODSERIAL_IER 0x04 |
| pspatel321 | 31:7eaa5e881b56 | 30 | #define MODSERIAL_DML 0x04 |
| pspatel321 | 31:7eaa5e881b56 | 31 | #define MODSERIAL_IIR 0x08 |
| pspatel321 | 31:7eaa5e881b56 | 32 | #define MODSERIAL_FCR 0x08 |
| pspatel321 | 31:7eaa5e881b56 | 33 | #define MODSERIAL_LCR 0x0C |
| pspatel321 | 31:7eaa5e881b56 | 34 | #define MODSERIAL_LSR 0x14 |
| pspatel321 | 31:7eaa5e881b56 | 35 | #define MODSERIAL_SCR 0x1C |
| pspatel321 | 31:7eaa5e881b56 | 36 | #define MODSERIAL_ACR 0x20 |
| pspatel321 | 31:7eaa5e881b56 | 37 | #define MODSERIAL_ICR 0x24 |
| pspatel321 | 31:7eaa5e881b56 | 38 | #define MODSERIAL_FDR 0x28 |
| pspatel321 | 31:7eaa5e881b56 | 39 | #define MODSERIAL_TER 0x30 |
| pspatel321 | 31:7eaa5e881b56 | 40 | |
| pspatel321 | 31:7eaa5e881b56 | 41 | #define MODSERIAL_LSR_RDR (1UL << 0) |
| pspatel321 | 31:7eaa5e881b56 | 42 | #define MODSERIAL_LSR_OE (1UL << 1) |
| pspatel321 | 31:7eaa5e881b56 | 43 | #define MODSERIAL_LSR_PE (1UL << 2) |
| pspatel321 | 31:7eaa5e881b56 | 44 | #define MODSERIAL_LSR_FE (1UL << 3) |
| pspatel321 | 31:7eaa5e881b56 | 45 | #define MODSERIAL_LSR_BR (1UL << 4) |
| pspatel321 | 31:7eaa5e881b56 | 46 | #define MODSERIAL_LSR_THRE (1UL << 5) |
| pspatel321 | 31:7eaa5e881b56 | 47 | #define MODSERIAL_LSR_TEMT (1UL << 6) |
| pspatel321 | 31:7eaa5e881b56 | 48 | #define MODSERIAL_LSR_RXFE (1UL << 7) |
| pspatel321 | 31:7eaa5e881b56 | 49 | |
| pspatel321 | 31:7eaa5e881b56 | 50 | #define MODSERIAL_FIFO_ENABLE 1 |
| pspatel321 | 31:7eaa5e881b56 | 51 | #define MODSERIAL_FIFO_RX_RESET 2 |
| pspatel321 | 31:7eaa5e881b56 | 52 | #define MODSERIAL_FIFO_TX_RESET 4 |
| pspatel321 | 31:7eaa5e881b56 | 53 | |
| pspatel321 | 31:7eaa5e881b56 | 54 | #define _RBR *((char *)_base+MODSERIAL_RBR) |
| pspatel321 | 31:7eaa5e881b56 | 55 | #define _THR *((char *)_base+MODSERIAL_THR) |
| pspatel321 | 31:7eaa5e881b56 | 56 | #define _IIR *((char *)_base+MODSERIAL_IIR) |
| pspatel321 | 31:7eaa5e881b56 | 57 | #define _IER *((char *)_base+MODSERIAL_IER) |
| pspatel321 | 31:7eaa5e881b56 | 58 | #define _LSR *((char *)_base+MODSERIAL_LSR) |
| pspatel321 | 31:7eaa5e881b56 | 59 | #define _FCR *((char *)_base+MODSERIAL_FCR) |
| pspatel321 | 31:7eaa5e881b56 | 60 | |
| pspatel321 | 31:7eaa5e881b56 | 61 | #define MODSERIAL_TX_BUFFER_EMPTY (buffer_count[TxIrq]==0) |
| pspatel321 | 31:7eaa5e881b56 | 62 | #define MODSERIAL_RX_BUFFER_EMPTY (buffer_count[RxIrq]==0) |
| pspatel321 | 31:7eaa5e881b56 | 63 | #define MODSERIAL_TX_BUFFER_FULL (buffer_count[TxIrq]==buffer_size[TxIrq]) |
| pspatel321 | 31:7eaa5e881b56 | 64 | #define MODSERIAL_RX_BUFFER_FULL (buffer_count[RxIrq]==buffer_size[RxIrq]) |
| pspatel321 | 31:7eaa5e881b56 | 65 | |
| pspatel321 | 31:7eaa5e881b56 | 66 | #define MODSERIAL_THR_HAS_SPACE ((int)_LSR&MODSERIAL_LSR_THRE) |
| pspatel321 | 31:7eaa5e881b56 | 67 | #define MODSERIAL_TEMT_IS_EMPTY ((int)_LSR&MODSERIAL_LSR_TEMT) |
| pspatel321 | 31:7eaa5e881b56 | 68 | #define MODSERIAL_RBR_HAS_DATA ((int)_LSR&MODSERIAL_LSR_RDR) |
| pspatel321 | 31:7eaa5e881b56 | 69 | |
| pspatel321 | 31:7eaa5e881b56 | 70 | #endif |
