Mbed SDK for XRange SX1272 LoRa module
Dependents: XRangePingPong XRange-LoRaWAN-lmic-app lora-transceiver
SX1272 LoRa RF module
https://www.netblocks.eu/xrange-sx1272-lora-datasheet/
api/Stream.h@339:ac6f3fd999f3, 2016-01-07 (annotated)
- Committer:
- netblocks
- Date:
- Thu Jan 07 13:01:25 2016 +0000
- Revision:
- 339:ac6f3fd999f3
- Parent:
- 336:1e18a06a987b
HSE_VALUE set for XTAL 16Mhz
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dudmuck | 336:1e18a06a987b | 1 | /* mbed Microcontroller Library |
dudmuck | 336:1e18a06a987b | 2 | * Copyright (c) 2006-2013 ARM Limited |
dudmuck | 336:1e18a06a987b | 3 | * |
dudmuck | 336:1e18a06a987b | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
dudmuck | 336:1e18a06a987b | 5 | * you may not use this file except in compliance with the License. |
dudmuck | 336:1e18a06a987b | 6 | * You may obtain a copy of the License at |
dudmuck | 336:1e18a06a987b | 7 | * |
dudmuck | 336:1e18a06a987b | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
dudmuck | 336:1e18a06a987b | 9 | * |
dudmuck | 336:1e18a06a987b | 10 | * Unless required by applicable law or agreed to in writing, software |
dudmuck | 336:1e18a06a987b | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
dudmuck | 336:1e18a06a987b | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
dudmuck | 336:1e18a06a987b | 13 | * See the License for the specific language governing permissions and |
dudmuck | 336:1e18a06a987b | 14 | * limitations under the License. |
dudmuck | 336:1e18a06a987b | 15 | */ |
dudmuck | 336:1e18a06a987b | 16 | #ifndef MBED_STREAM_H |
dudmuck | 336:1e18a06a987b | 17 | #define MBED_STREAM_H |
dudmuck | 336:1e18a06a987b | 18 | |
dudmuck | 336:1e18a06a987b | 19 | #include "platform.h" |
dudmuck | 336:1e18a06a987b | 20 | #include "FileLike.h" |
dudmuck | 336:1e18a06a987b | 21 | |
dudmuck | 336:1e18a06a987b | 22 | namespace mbed { |
dudmuck | 336:1e18a06a987b | 23 | |
dudmuck | 336:1e18a06a987b | 24 | extern void mbed_set_unbuffered_stream(FILE *_file); |
dudmuck | 336:1e18a06a987b | 25 | extern int mbed_getc(FILE *_file); |
dudmuck | 336:1e18a06a987b | 26 | extern char* mbed_gets(char *s, int size, FILE *_file); |
dudmuck | 336:1e18a06a987b | 27 | |
dudmuck | 336:1e18a06a987b | 28 | class Stream : public FileLike { |
dudmuck | 336:1e18a06a987b | 29 | |
dudmuck | 336:1e18a06a987b | 30 | public: |
dudmuck | 336:1e18a06a987b | 31 | Stream(const char *name=NULL); |
dudmuck | 336:1e18a06a987b | 32 | virtual ~Stream(); |
dudmuck | 336:1e18a06a987b | 33 | |
dudmuck | 336:1e18a06a987b | 34 | int putc(int c); |
dudmuck | 336:1e18a06a987b | 35 | int puts(const char *s); |
dudmuck | 336:1e18a06a987b | 36 | int getc(); |
dudmuck | 336:1e18a06a987b | 37 | char *gets(char *s, int size); |
dudmuck | 336:1e18a06a987b | 38 | int printf(const char* format, ...); |
dudmuck | 336:1e18a06a987b | 39 | int scanf(const char* format, ...); |
dudmuck | 336:1e18a06a987b | 40 | |
dudmuck | 336:1e18a06a987b | 41 | operator std::FILE*() {return _file;} |
dudmuck | 336:1e18a06a987b | 42 | |
dudmuck | 336:1e18a06a987b | 43 | protected: |
dudmuck | 336:1e18a06a987b | 44 | virtual int close(); |
dudmuck | 336:1e18a06a987b | 45 | virtual ssize_t write(const void* buffer, size_t length); |
dudmuck | 336:1e18a06a987b | 46 | virtual ssize_t read(void* buffer, size_t length); |
dudmuck | 336:1e18a06a987b | 47 | virtual off_t lseek(off_t offset, int whence); |
dudmuck | 336:1e18a06a987b | 48 | virtual int isatty(); |
dudmuck | 336:1e18a06a987b | 49 | virtual int fsync(); |
dudmuck | 336:1e18a06a987b | 50 | virtual off_t flen(); |
dudmuck | 336:1e18a06a987b | 51 | |
dudmuck | 336:1e18a06a987b | 52 | virtual int _putc(int c) = 0; |
dudmuck | 336:1e18a06a987b | 53 | virtual int _getc() = 0; |
dudmuck | 336:1e18a06a987b | 54 | |
dudmuck | 336:1e18a06a987b | 55 | std::FILE *_file; |
dudmuck | 336:1e18a06a987b | 56 | |
dudmuck | 336:1e18a06a987b | 57 | /* disallow copy constructor and assignment operators */ |
dudmuck | 336:1e18a06a987b | 58 | private: |
dudmuck | 336:1e18a06a987b | 59 | Stream(const Stream&); |
dudmuck | 336:1e18a06a987b | 60 | Stream & operator = (const Stream&); |
dudmuck | 336:1e18a06a987b | 61 | }; |
dudmuck | 336:1e18a06a987b | 62 | |
dudmuck | 336:1e18a06a987b | 63 | } // namespace mbed |
dudmuck | 336:1e18a06a987b | 64 | |
dudmuck | 336:1e18a06a987b | 65 | #endif |