Shruti Rawool / pir-motion-sensor

Dependencies:   mbed

Committer:
skrawool
Date:
Mon Dec 05 16:39:27 2016 +0000
Revision:
0:3954a906acc2
PIR grove sensor that sends the sensed data to thingspeak through the wifi module ESP 8266

Who changed what in which revision?

UserRevisionLine numberNew contents of line
skrawool 0:3954a906acc2 1 /* mbed Microcontroller Library
skrawool 0:3954a906acc2 2 * Copyright (c) 2006-2013 ARM Limited
skrawool 0:3954a906acc2 3 *
skrawool 0:3954a906acc2 4 * Licensed under the Apache License, Version 2.0 (the "License");
skrawool 0:3954a906acc2 5 * you may not use this file except in compliance with the License.
skrawool 0:3954a906acc2 6 * You may obtain a copy of the License at
skrawool 0:3954a906acc2 7 *
skrawool 0:3954a906acc2 8 * http://www.apache.org/licenses/LICENSE-2.0
skrawool 0:3954a906acc2 9 *
skrawool 0:3954a906acc2 10 * Unless required by applicable law or agreed to in writing, software
skrawool 0:3954a906acc2 11 * distributed under the License is distributed on an "AS IS" BASIS,
skrawool 0:3954a906acc2 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
skrawool 0:3954a906acc2 13 * See the License for the specific language governing permissions and
skrawool 0:3954a906acc2 14 * limitations under the License.
skrawool 0:3954a906acc2 15 */
skrawool 0:3954a906acc2 16 #ifndef MBED_FILEBASE_H
skrawool 0:3954a906acc2 17 #define MBED_FILEBASE_H
skrawool 0:3954a906acc2 18
skrawool 0:3954a906acc2 19 typedef int FILEHANDLE;
skrawool 0:3954a906acc2 20
skrawool 0:3954a906acc2 21 #include <cstdio>
skrawool 0:3954a906acc2 22 #include <cstring>
skrawool 0:3954a906acc2 23
skrawool 0:3954a906acc2 24 #if defined(__ARMCC_VERSION) || defined(__ICCARM__)
skrawool 0:3954a906acc2 25 # define O_RDONLY 0
skrawool 0:3954a906acc2 26 # define O_WRONLY 1
skrawool 0:3954a906acc2 27 # define O_RDWR 2
skrawool 0:3954a906acc2 28 # define O_CREAT 0x0200
skrawool 0:3954a906acc2 29 # define O_TRUNC 0x0400
skrawool 0:3954a906acc2 30 # define O_APPEND 0x0008
skrawool 0:3954a906acc2 31
skrawool 0:3954a906acc2 32 # define NAME_MAX 255
skrawool 0:3954a906acc2 33
skrawool 0:3954a906acc2 34 typedef int mode_t;
skrawool 0:3954a906acc2 35 typedef int ssize_t;
skrawool 0:3954a906acc2 36 typedef long off_t;
skrawool 0:3954a906acc2 37
skrawool 0:3954a906acc2 38 #else
skrawool 0:3954a906acc2 39 # include <sys/fcntl.h>
skrawool 0:3954a906acc2 40 # include <sys/types.h>
skrawool 0:3954a906acc2 41 # include <sys/syslimits.h>
skrawool 0:3954a906acc2 42 #endif
skrawool 0:3954a906acc2 43
skrawool 0:3954a906acc2 44 #include "platform/platform.h"
skrawool 0:3954a906acc2 45 #include "platform/SingletonPtr.h"
skrawool 0:3954a906acc2 46 #include "platform/PlatformMutex.h"
skrawool 0:3954a906acc2 47
skrawool 0:3954a906acc2 48 namespace mbed {
skrawool 0:3954a906acc2 49 /** \addtogroup drivers */
skrawool 0:3954a906acc2 50 /** @{*/
skrawool 0:3954a906acc2 51
skrawool 0:3954a906acc2 52 typedef enum {
skrawool 0:3954a906acc2 53 FilePathType,
skrawool 0:3954a906acc2 54 FileSystemPathType
skrawool 0:3954a906acc2 55 } PathType;
skrawool 0:3954a906acc2 56
skrawool 0:3954a906acc2 57 class FileBase {
skrawool 0:3954a906acc2 58 public:
skrawool 0:3954a906acc2 59 FileBase(const char *name, PathType t);
skrawool 0:3954a906acc2 60
skrawool 0:3954a906acc2 61 virtual ~FileBase();
skrawool 0:3954a906acc2 62
skrawool 0:3954a906acc2 63 const char* getName(void);
skrawool 0:3954a906acc2 64 PathType getPathType(void);
skrawool 0:3954a906acc2 65
skrawool 0:3954a906acc2 66 static FileBase *lookup(const char *name, unsigned int len);
skrawool 0:3954a906acc2 67
skrawool 0:3954a906acc2 68 static FileBase *get(int n);
skrawool 0:3954a906acc2 69
skrawool 0:3954a906acc2 70 /* disallow copy constructor and assignment operators */
skrawool 0:3954a906acc2 71 private:
skrawool 0:3954a906acc2 72 static FileBase *_head;
skrawool 0:3954a906acc2 73 static SingletonPtr<PlatformMutex> _mutex;
skrawool 0:3954a906acc2 74
skrawool 0:3954a906acc2 75 FileBase *_next;
skrawool 0:3954a906acc2 76 const char * const _name;
skrawool 0:3954a906acc2 77 const PathType _path_type;
skrawool 0:3954a906acc2 78 FileBase(const FileBase&);
skrawool 0:3954a906acc2 79 FileBase & operator = (const FileBase&);
skrawool 0:3954a906acc2 80 };
skrawool 0:3954a906acc2 81
skrawool 0:3954a906acc2 82 } // namespace mbed
skrawool 0:3954a906acc2 83
skrawool 0:3954a906acc2 84 #endif
skrawool 0:3954a906acc2 85
skrawool 0:3954a906acc2 86 /** @}*/