mbed

Dependents:   DHTSensor_Test K64F_eCompass_OneNET_JW

Committer:
mbotkinl
Date:
Wed Feb 25 20:22:22 2015 +0000
Revision:
0:2cc6bb4d7fea
Working code to read Temperature and Humidity readings

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbotkinl 0:2cc6bb4d7fea 1 /* mbed Microcontroller Library
mbotkinl 0:2cc6bb4d7fea 2 * Copyright (c) 2006-2013 ARM Limited
mbotkinl 0:2cc6bb4d7fea 3 *
mbotkinl 0:2cc6bb4d7fea 4 * Licensed under the Apache License, Version 2.0 (the "License");
mbotkinl 0:2cc6bb4d7fea 5 * you may not use this file except in compliance with the License.
mbotkinl 0:2cc6bb4d7fea 6 * You may obtain a copy of the License at
mbotkinl 0:2cc6bb4d7fea 7 *
mbotkinl 0:2cc6bb4d7fea 8 * http://www.apache.org/licenses/LICENSE-2.0
mbotkinl 0:2cc6bb4d7fea 9 *
mbotkinl 0:2cc6bb4d7fea 10 * Unless required by applicable law or agreed to in writing, software
mbotkinl 0:2cc6bb4d7fea 11 * distributed under the License is distributed on an "AS IS" BASIS,
mbotkinl 0:2cc6bb4d7fea 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
mbotkinl 0:2cc6bb4d7fea 13 * See the License for the specific language governing permissions and
mbotkinl 0:2cc6bb4d7fea 14 * limitations under the License.
mbotkinl 0:2cc6bb4d7fea 15 */
mbotkinl 0:2cc6bb4d7fea 16 #ifndef MBED_GPIO_API_H
mbotkinl 0:2cc6bb4d7fea 17 #define MBED_GPIO_API_H
mbotkinl 0:2cc6bb4d7fea 18
mbotkinl 0:2cc6bb4d7fea 19 #include "device.h"
mbotkinl 0:2cc6bb4d7fea 20
mbotkinl 0:2cc6bb4d7fea 21 #ifdef __cplusplus
mbotkinl 0:2cc6bb4d7fea 22 extern "C" {
mbotkinl 0:2cc6bb4d7fea 23 #endif
mbotkinl 0:2cc6bb4d7fea 24
mbotkinl 0:2cc6bb4d7fea 25 /* Set the given pin as GPIO
mbotkinl 0:2cc6bb4d7fea 26 * @param pin The pin to be set as GPIO
mbotkinl 0:2cc6bb4d7fea 27 * @return The GPIO port mask for this pin
mbotkinl 0:2cc6bb4d7fea 28 **/
mbotkinl 0:2cc6bb4d7fea 29 uint32_t gpio_set(PinName pin);
mbotkinl 0:2cc6bb4d7fea 30
mbotkinl 0:2cc6bb4d7fea 31 /* GPIO object */
mbotkinl 0:2cc6bb4d7fea 32 void gpio_init(gpio_t *obj, PinName pin);
mbotkinl 0:2cc6bb4d7fea 33
mbotkinl 0:2cc6bb4d7fea 34 void gpio_mode (gpio_t *obj, PinMode mode);
mbotkinl 0:2cc6bb4d7fea 35 void gpio_dir (gpio_t *obj, PinDirection direction);
mbotkinl 0:2cc6bb4d7fea 36
mbotkinl 0:2cc6bb4d7fea 37 void gpio_write(gpio_t *obj, int value);
mbotkinl 0:2cc6bb4d7fea 38 int gpio_read (gpio_t *obj);
mbotkinl 0:2cc6bb4d7fea 39
mbotkinl 0:2cc6bb4d7fea 40 // the following set of functions are generic and are implemented in the common gpio.c file
mbotkinl 0:2cc6bb4d7fea 41 void gpio_init_in(gpio_t* gpio, PinName pin);
mbotkinl 0:2cc6bb4d7fea 42 void gpio_init_in_ex(gpio_t* gpio, PinName pin, PinMode mode);
mbotkinl 0:2cc6bb4d7fea 43 void gpio_init_out(gpio_t* gpio, PinName pin);
mbotkinl 0:2cc6bb4d7fea 44 void gpio_init_out_ex(gpio_t* gpio, PinName pin, int value);
mbotkinl 0:2cc6bb4d7fea 45 void gpio_init_inout(gpio_t* gpio, PinName pin, PinDirection direction, PinMode mode, int value);
mbotkinl 0:2cc6bb4d7fea 46
mbotkinl 0:2cc6bb4d7fea 47 #ifdef __cplusplus
mbotkinl 0:2cc6bb4d7fea 48 }
mbotkinl 0:2cc6bb4d7fea 49 #endif
mbotkinl 0:2cc6bb4d7fea 50
mbotkinl 0:2cc6bb4d7fea 51 #endif