A simple 128x32 graphical LCD program to quickstart with LCD on ARM mbed IoT Starter Kit. This requires mbed Applciation Shield with FRDM-K64F platform.
mbed/FileBase.h@1:eb68c94a8ee5, 2015-04-12 (annotated)
- Committer:
- tushki7
- Date:
- Sun Apr 12 15:45:52 2015 +0000
- Revision:
- 1:eb68c94a8ee5
- Parent:
- 0:60d829a0353a
A simple 128x32 LCD program with ARM mbed IoT Starter Kit;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tushki7 | 0:60d829a0353a | 1 | /* mbed Microcontroller Library |
tushki7 | 0:60d829a0353a | 2 | * Copyright (c) 2006-2013 ARM Limited |
tushki7 | 0:60d829a0353a | 3 | * |
tushki7 | 0:60d829a0353a | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
tushki7 | 0:60d829a0353a | 5 | * you may not use this file except in compliance with the License. |
tushki7 | 0:60d829a0353a | 6 | * You may obtain a copy of the License at |
tushki7 | 0:60d829a0353a | 7 | * |
tushki7 | 0:60d829a0353a | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
tushki7 | 0:60d829a0353a | 9 | * |
tushki7 | 0:60d829a0353a | 10 | * Unless required by applicable law or agreed to in writing, software |
tushki7 | 0:60d829a0353a | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
tushki7 | 0:60d829a0353a | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
tushki7 | 0:60d829a0353a | 13 | * See the License for the specific language governing permissions and |
tushki7 | 0:60d829a0353a | 14 | * limitations under the License. |
tushki7 | 0:60d829a0353a | 15 | */ |
tushki7 | 0:60d829a0353a | 16 | #ifndef MBED_FILEBASE_H |
tushki7 | 0:60d829a0353a | 17 | #define MBED_FILEBASE_H |
tushki7 | 0:60d829a0353a | 18 | |
tushki7 | 0:60d829a0353a | 19 | typedef int FILEHANDLE; |
tushki7 | 0:60d829a0353a | 20 | |
tushki7 | 0:60d829a0353a | 21 | #include <stdio.h> |
tushki7 | 0:60d829a0353a | 22 | |
tushki7 | 0:60d829a0353a | 23 | #if defined(__ARMCC_VERSION) || defined(__ICCARM__) |
tushki7 | 0:60d829a0353a | 24 | # define O_RDONLY 0 |
tushki7 | 0:60d829a0353a | 25 | # define O_WRONLY 1 |
tushki7 | 0:60d829a0353a | 26 | # define O_RDWR 2 |
tushki7 | 0:60d829a0353a | 27 | # define O_CREAT 0x0200 |
tushki7 | 0:60d829a0353a | 28 | # define O_TRUNC 0x0400 |
tushki7 | 0:60d829a0353a | 29 | # define O_APPEND 0x0008 |
tushki7 | 0:60d829a0353a | 30 | |
tushki7 | 0:60d829a0353a | 31 | # define NAME_MAX 255 |
tushki7 | 0:60d829a0353a | 32 | |
tushki7 | 0:60d829a0353a | 33 | typedef int mode_t; |
tushki7 | 0:60d829a0353a | 34 | typedef int ssize_t; |
tushki7 | 0:60d829a0353a | 35 | typedef long off_t; |
tushki7 | 0:60d829a0353a | 36 | |
tushki7 | 0:60d829a0353a | 37 | #else |
tushki7 | 0:60d829a0353a | 38 | # include <sys/fcntl.h> |
tushki7 | 0:60d829a0353a | 39 | # include <sys/types.h> |
tushki7 | 0:60d829a0353a | 40 | # include <sys/syslimits.h> |
tushki7 | 0:60d829a0353a | 41 | #endif |
tushki7 | 0:60d829a0353a | 42 | |
tushki7 | 0:60d829a0353a | 43 | #include "platform.h" |
tushki7 | 0:60d829a0353a | 44 | |
tushki7 | 0:60d829a0353a | 45 | namespace mbed { |
tushki7 | 0:60d829a0353a | 46 | |
tushki7 | 0:60d829a0353a | 47 | typedef enum { |
tushki7 | 0:60d829a0353a | 48 | FilePathType, |
tushki7 | 0:60d829a0353a | 49 | FileSystemPathType |
tushki7 | 0:60d829a0353a | 50 | } PathType; |
tushki7 | 0:60d829a0353a | 51 | |
tushki7 | 0:60d829a0353a | 52 | class FileBase { |
tushki7 | 0:60d829a0353a | 53 | public: |
tushki7 | 0:60d829a0353a | 54 | FileBase(const char *name, PathType t); |
tushki7 | 0:60d829a0353a | 55 | |
tushki7 | 0:60d829a0353a | 56 | virtual ~FileBase(); |
tushki7 | 0:60d829a0353a | 57 | |
tushki7 | 0:60d829a0353a | 58 | const char* getName(void); |
tushki7 | 0:60d829a0353a | 59 | PathType getPathType(void); |
tushki7 | 0:60d829a0353a | 60 | |
tushki7 | 0:60d829a0353a | 61 | static FileBase *lookup(const char *name, unsigned int len); |
tushki7 | 0:60d829a0353a | 62 | |
tushki7 | 0:60d829a0353a | 63 | static FileBase *get(int n); |
tushki7 | 0:60d829a0353a | 64 | |
tushki7 | 0:60d829a0353a | 65 | protected: |
tushki7 | 0:60d829a0353a | 66 | static FileBase *_head; |
tushki7 | 0:60d829a0353a | 67 | |
tushki7 | 0:60d829a0353a | 68 | FileBase *_next; |
tushki7 | 0:60d829a0353a | 69 | const char *_name; |
tushki7 | 0:60d829a0353a | 70 | PathType _path_type; |
tushki7 | 0:60d829a0353a | 71 | |
tushki7 | 0:60d829a0353a | 72 | /* disallow copy constructor and assignment operators */ |
tushki7 | 0:60d829a0353a | 73 | private: |
tushki7 | 0:60d829a0353a | 74 | FileBase(const FileBase&); |
tushki7 | 0:60d829a0353a | 75 | FileBase & operator = (const FileBase&); |
tushki7 | 0:60d829a0353a | 76 | }; |
tushki7 | 0:60d829a0353a | 77 | |
tushki7 | 0:60d829a0353a | 78 | } // namespace mbed |
tushki7 | 0:60d829a0353a | 79 | |
tushki7 | 0:60d829a0353a | 80 | #endif |