an old afLib which supports both SPI and UART

Committer:
Rhyme
Date:
Mon Apr 23 06:15:05 2018 +0000
Revision:
1:112741fe45d1
Parent:
0:6f371c791202
afLib1.3 first mbed version with working UART

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Rhyme 0:6f371c791202 1 /**
Rhyme 0:6f371c791202 2 * Copyright 2015 Afero, Inc.
Rhyme 0:6f371c791202 3 *
Rhyme 0:6f371c791202 4 * Licensed under the Apache License, Version 2.0 (the "License");
Rhyme 0:6f371c791202 5 * you may not use this file except in compliance with the License.
Rhyme 0:6f371c791202 6 * You may obtain a copy of the License at
Rhyme 0:6f371c791202 7 *
Rhyme 0:6f371c791202 8 * http://www.apache.org/licenses/LICENSE-2.0
Rhyme 0:6f371c791202 9 *
Rhyme 0:6f371c791202 10 * Unless required by applicable law or agreed to in writing, software
Rhyme 0:6f371c791202 11 * distributed under the License is distributed on an "AS IS" BASIS,
Rhyme 0:6f371c791202 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Rhyme 0:6f371c791202 13 * See the License for the specific language governing permissions and
Rhyme 0:6f371c791202 14 * limitations under the License.
Rhyme 0:6f371c791202 15 */
Rhyme 0:6f371c791202 16 #ifndef AFLIB_AFUART_H
Rhyme 0:6f371c791202 17 #define AFLIB_AFUART_H
Rhyme 0:6f371c791202 18
Rhyme 0:6f371c791202 19 #include <stdint.h>
Rhyme 0:6f371c791202 20
Rhyme 0:6f371c791202 21 class afUART {
Rhyme 0:6f371c791202 22 public:
Rhyme 0:6f371c791202 23 virtual int available() = 0;
Rhyme 0:6f371c791202 24 virtual char peek() = 0;
Rhyme 0:6f371c791202 25 virtual void read(uint8_t *buffer, int len) = 0;
Rhyme 0:6f371c791202 26 virtual char read() = 0;
Rhyme 0:6f371c791202 27 virtual void write(uint8_t *buffer, int len) = 0;
Rhyme 0:6f371c791202 28 };
Rhyme 0:6f371c791202 29
Rhyme 0:6f371c791202 30 #endif
Rhyme 0:6f371c791202 31
Rhyme 0:6f371c791202 32