Mangue Baja Box

Dependencies:   mbed

Committer:
einsteingustavo
Date:
Mon Jul 29 20:38:00 2019 +0000
Revision:
0:0dee8840a1c0
Mangue Baja Box

Who changed what in which revision?

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