MODSERIAL with support for more devices

Dependents:   1D-Pong BMT-K9_encoder BMT-K9-Regelaar programma_filter ... more

Check the cookbook page for more information: https://mbed.org/cookbook/MODSERIAL

Did you add a device? Please send a pull request so we can keep everything in one library instead of many copies. In that case also send a PM, since currently mbed does not inform of new pull requests. I will then also add you to the developers of this library so you can do other changes directly.

Committer:
Sissors
Date:
Sun May 07 16:26:36 2017 +0000
Revision:
44:a3b2bc878529
Parent:
41:d8422efe4761
Child:
45:da0788f0bd77
Used callback functions to attach to Serial, to remove compilation warnings

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Gary Servin 41:d8422efe4761 1 /*
Gary Servin 41:d8422efe4761 2 Copyright (c) 2010 Andy Kirkham
Gary Servin 41:d8422efe4761 3
Gary Servin 41:d8422efe4761 4 Permission is hereby granted, free of charge, to any person obtaining a copy
Gary Servin 41:d8422efe4761 5 of this software and associated documentation files (the "Software"), to deal
Gary Servin 41:d8422efe4761 6 in the Software without restriction, including without limitation the rights
Gary Servin 41:d8422efe4761 7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
Gary Servin 41:d8422efe4761 8 copies of the Software, and to permit persons to whom the Software is
Gary Servin 41:d8422efe4761 9 furnished to do so, subject to the following conditions:
Gary Servin 41:d8422efe4761 10
Gary Servin 41:d8422efe4761 11 The above copyright notice and this permission notice shall be included in
Gary Servin 41:d8422efe4761 12 all copies or substantial portions of the Software.
Gary Servin 41:d8422efe4761 13
Gary Servin 41:d8422efe4761 14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Gary Servin 41:d8422efe4761 15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Gary Servin 41:d8422efe4761 16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Gary Servin 41:d8422efe4761 17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
Gary Servin 41:d8422efe4761 18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
Gary Servin 41:d8422efe4761 19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
Gary Servin 41:d8422efe4761 20 THE SOFTWARE.
Gary Servin 41:d8422efe4761 21 */
Gary Servin 41:d8422efe4761 22
Gary Servin 41:d8422efe4761 23 #ifndef MODSERIAL_MACROS_H
Gary Servin 41:d8422efe4761 24 #define MODSERIAL_MACROS_H
Gary Servin 41:d8422efe4761 25
Gary Servin 41:d8422efe4761 26 #include "MODSERIAL_LPC1768.h"
Gary Servin 41:d8422efe4761 27 #include "MODSERIAL_LPC11U24.h"
Gary Servin 41:d8422efe4761 28 #include "MODSERIAL_KL25Z.h"
Gary Servin 41:d8422efe4761 29 #include "MODSERIAL_KL05Z.h"
Gary Servin 41:d8422efe4761 30 #include "MODSERIAL_KSDK.h"
Gary Servin 41:d8422efe4761 31 #include "MODSERIAL_NUCLEO_F401RE.h"
Gary Servin 41:d8422efe4761 32 #include "MODSERIAL_PAC_F401RB.h"
Gary Servin 41:d8422efe4761 33
Gary Servin 41:d8422efe4761 34 #define MODSERIAL_TX_BUFFER_EMPTY (buffer_count[TxIrq]==0)
Gary Servin 41:d8422efe4761 35 #define MODSERIAL_RX_BUFFER_EMPTY (buffer_count[RxIrq]==0)
Gary Servin 41:d8422efe4761 36 #define MODSERIAL_TX_BUFFER_FULL (buffer_count[TxIrq]==buffer_size[TxIrq])
Gary Servin 41:d8422efe4761 37 #define MODSERIAL_RX_BUFFER_FULL (buffer_count[RxIrq]==buffer_size[RxIrq])
Gary Servin 41:d8422efe4761 38
Gary Servin 41:d8422efe4761 39 #endif