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
skrawool 0:3954a906acc2 2 /** \addtogroup hal */
skrawool 0:3954a906acc2 3 /** @{*/
skrawool 0:3954a906acc2 4 /* mbed Microcontroller Library
skrawool 0:3954a906acc2 5 * Copyright (c) 2006-2013 ARM Limited
skrawool 0:3954a906acc2 6 *
skrawool 0:3954a906acc2 7 * Licensed under the Apache License, Version 2.0 (the "License");
skrawool 0:3954a906acc2 8 * you may not use this file except in compliance with the License.
skrawool 0:3954a906acc2 9 * You may obtain a copy of the License at
skrawool 0:3954a906acc2 10 *
skrawool 0:3954a906acc2 11 * http://www.apache.org/licenses/LICENSE-2.0
skrawool 0:3954a906acc2 12 *
skrawool 0:3954a906acc2 13 * Unless required by applicable law or agreed to in writing, software
skrawool 0:3954a906acc2 14 * distributed under the License is distributed on an "AS IS" BASIS,
skrawool 0:3954a906acc2 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
skrawool 0:3954a906acc2 16 * See the License for the specific language governing permissions and
skrawool 0:3954a906acc2 17 * limitations under the License.
skrawool 0:3954a906acc2 18 */
skrawool 0:3954a906acc2 19 #ifndef MBED_PORTMAP_H
skrawool 0:3954a906acc2 20 #define MBED_PORTMAP_H
skrawool 0:3954a906acc2 21
skrawool 0:3954a906acc2 22 #include "device.h"
skrawool 0:3954a906acc2 23
skrawool 0:3954a906acc2 24 #if DEVICE_PORTIN || DEVICE_PORTOUT
skrawool 0:3954a906acc2 25
skrawool 0:3954a906acc2 26 #ifdef __cplusplus
skrawool 0:3954a906acc2 27 extern "C" {
skrawool 0:3954a906acc2 28 #endif
skrawool 0:3954a906acc2 29
skrawool 0:3954a906acc2 30 /** Port HAL structure. port_s is declared in the target's HAL
skrawool 0:3954a906acc2 31 */
skrawool 0:3954a906acc2 32 typedef struct port_s port_t;
skrawool 0:3954a906acc2 33
skrawool 0:3954a906acc2 34 /**
skrawool 0:3954a906acc2 35 * \defgroup hal_port Port HAL functions
skrawool 0:3954a906acc2 36 * @{
skrawool 0:3954a906acc2 37 */
skrawool 0:3954a906acc2 38
skrawool 0:3954a906acc2 39 /** Get the pin name from the port's pin number
skrawool 0:3954a906acc2 40 *
skrawool 0:3954a906acc2 41 * @param port The port name
skrawool 0:3954a906acc2 42 * @param pin_n The pin number within the specified port
skrawool 0:3954a906acc2 43 * @return The pin name for the port's pin number
skrawool 0:3954a906acc2 44 */
skrawool 0:3954a906acc2 45 PinName port_pin(PortName port, int pin_n);
skrawool 0:3954a906acc2 46
skrawool 0:3954a906acc2 47 /** Initilize the port
skrawool 0:3954a906acc2 48 *
skrawool 0:3954a906acc2 49 * @param obj The port object to initialize
skrawool 0:3954a906acc2 50 * @param port The port name
skrawool 0:3954a906acc2 51 * @param mask The bitmask to identify which bits in the port should be included (0 - ignore)
skrawool 0:3954a906acc2 52 * @param dir The port direction
skrawool 0:3954a906acc2 53 */
skrawool 0:3954a906acc2 54 void port_init(port_t *obj, PortName port, int mask, PinDirection dir);
skrawool 0:3954a906acc2 55
skrawool 0:3954a906acc2 56 /** Set the input port mode
skrawool 0:3954a906acc2 57 *
skrawool 0:3954a906acc2 58 * @param obj The port object
skrawool 0:3954a906acc2 59 * @param mode THe port mode to be set
skrawool 0:3954a906acc2 60 */
skrawool 0:3954a906acc2 61 void port_mode(port_t *obj, PinMode mode);
skrawool 0:3954a906acc2 62
skrawool 0:3954a906acc2 63 /** Set port direction (in/out)
skrawool 0:3954a906acc2 64 *
skrawool 0:3954a906acc2 65 * @param obj The port object
skrawool 0:3954a906acc2 66 * @param dir The port direction to be set
skrawool 0:3954a906acc2 67 */
skrawool 0:3954a906acc2 68 void port_dir(port_t *obj, PinDirection dir);
skrawool 0:3954a906acc2 69
skrawool 0:3954a906acc2 70 /** Write value to the port
skrawool 0:3954a906acc2 71 *
skrawool 0:3954a906acc2 72 * @param obj The port object
skrawool 0:3954a906acc2 73 * @param value The value to be set
skrawool 0:3954a906acc2 74 */
skrawool 0:3954a906acc2 75 void port_write(port_t *obj, int value);
skrawool 0:3954a906acc2 76
skrawool 0:3954a906acc2 77 /** Read the current value on the port
skrawool 0:3954a906acc2 78 *
skrawool 0:3954a906acc2 79 * @param obj The port object
skrawool 0:3954a906acc2 80 * @return An integer with each bit corresponding to an associated port pin setting
skrawool 0:3954a906acc2 81 */
skrawool 0:3954a906acc2 82 int port_read(port_t *obj);
skrawool 0:3954a906acc2 83
skrawool 0:3954a906acc2 84 /**@}*/
skrawool 0:3954a906acc2 85
skrawool 0:3954a906acc2 86 #ifdef __cplusplus
skrawool 0:3954a906acc2 87 }
skrawool 0:3954a906acc2 88 #endif
skrawool 0:3954a906acc2 89 #endif
skrawool 0:3954a906acc2 90
skrawool 0:3954a906acc2 91 #endif
skrawool 0:3954a906acc2 92
skrawool 0:3954a906acc2 93 /** @}*/