FRDM-K64F, Avnet M14A2A, Grove Shield, to create smart home system. In use with AT&Ts M2x & Flow.
Dependencies: mbed FXOS8700CQ MODSERIAL
mbed/gpio_api.h@84:fc8c9b39723a, 2019-03-06 (annotated)
- Committer:
- jwhammel
- Date:
- Wed Mar 06 21:11:49 2019 +0000
- Revision:
- 84:fc8c9b39723a
Embedded Systems Midterm Project Spring 2019
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jwhammel | 84:fc8c9b39723a | 1 | /* mbed Microcontroller Library |
jwhammel | 84:fc8c9b39723a | 2 | * Copyright (c) 2006-2013 ARM Limited |
jwhammel | 84:fc8c9b39723a | 3 | * |
jwhammel | 84:fc8c9b39723a | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
jwhammel | 84:fc8c9b39723a | 5 | * you may not use this file except in compliance with the License. |
jwhammel | 84:fc8c9b39723a | 6 | * You may obtain a copy of the License at |
jwhammel | 84:fc8c9b39723a | 7 | * |
jwhammel | 84:fc8c9b39723a | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
jwhammel | 84:fc8c9b39723a | 9 | * |
jwhammel | 84:fc8c9b39723a | 10 | * Unless required by applicable law or agreed to in writing, software |
jwhammel | 84:fc8c9b39723a | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
jwhammel | 84:fc8c9b39723a | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
jwhammel | 84:fc8c9b39723a | 13 | * See the License for the specific language governing permissions and |
jwhammel | 84:fc8c9b39723a | 14 | * limitations under the License. |
jwhammel | 84:fc8c9b39723a | 15 | */ |
jwhammel | 84:fc8c9b39723a | 16 | #ifndef MBED_GPIO_API_H |
jwhammel | 84:fc8c9b39723a | 17 | #define MBED_GPIO_API_H |
jwhammel | 84:fc8c9b39723a | 18 | |
jwhammel | 84:fc8c9b39723a | 19 | #include "device.h" |
jwhammel | 84:fc8c9b39723a | 20 | |
jwhammel | 84:fc8c9b39723a | 21 | #ifdef __cplusplus |
jwhammel | 84:fc8c9b39723a | 22 | extern "C" { |
jwhammel | 84:fc8c9b39723a | 23 | #endif |
jwhammel | 84:fc8c9b39723a | 24 | |
jwhammel | 84:fc8c9b39723a | 25 | /* Set the given pin as GPIO |
jwhammel | 84:fc8c9b39723a | 26 | * @param pin The pin to be set as GPIO |
jwhammel | 84:fc8c9b39723a | 27 | * @return The GPIO port mask for this pin |
jwhammel | 84:fc8c9b39723a | 28 | **/ |
jwhammel | 84:fc8c9b39723a | 29 | uint32_t gpio_set(PinName pin); |
jwhammel | 84:fc8c9b39723a | 30 | |
jwhammel | 84:fc8c9b39723a | 31 | /* GPIO object */ |
jwhammel | 84:fc8c9b39723a | 32 | void gpio_init(gpio_t *obj, PinName pin); |
jwhammel | 84:fc8c9b39723a | 33 | |
jwhammel | 84:fc8c9b39723a | 34 | void gpio_mode (gpio_t *obj, PinMode mode); |
jwhammel | 84:fc8c9b39723a | 35 | void gpio_dir (gpio_t *obj, PinDirection direction); |
jwhammel | 84:fc8c9b39723a | 36 | |
jwhammel | 84:fc8c9b39723a | 37 | void gpio_write(gpio_t *obj, int value); |
jwhammel | 84:fc8c9b39723a | 38 | int gpio_read (gpio_t *obj); |
jwhammel | 84:fc8c9b39723a | 39 | |
jwhammel | 84:fc8c9b39723a | 40 | // the following set of functions are generic and are implemented in the common gpio.c file |
jwhammel | 84:fc8c9b39723a | 41 | void gpio_init_in(gpio_t* gpio, PinName pin); |
jwhammel | 84:fc8c9b39723a | 42 | void gpio_init_in_ex(gpio_t* gpio, PinName pin, PinMode mode); |
jwhammel | 84:fc8c9b39723a | 43 | void gpio_init_out(gpio_t* gpio, PinName pin); |
jwhammel | 84:fc8c9b39723a | 44 | void gpio_init_out_ex(gpio_t* gpio, PinName pin, int value); |
jwhammel | 84:fc8c9b39723a | 45 | void gpio_init_inout(gpio_t* gpio, PinName pin, PinDirection direction, PinMode mode, int value); |
jwhammel | 84:fc8c9b39723a | 46 | |
jwhammel | 84:fc8c9b39723a | 47 | #ifdef __cplusplus |
jwhammel | 84:fc8c9b39723a | 48 | } |
jwhammel | 84:fc8c9b39723a | 49 | #endif |
jwhammel | 84:fc8c9b39723a | 50 | |
jwhammel | 84:fc8c9b39723a | 51 | #endif |
jwhammel | 84:fc8c9b39723a | 52 |