From Ben Katz mbed-dev library. Removed unnecessary target files to reduce the overall size by a factor of 10 to make it easier to import into the online IDE.

Dependents:   motor_driver motor_driver_screaming_fix

Committer:
saloutos
Date:
Thu Nov 26 04:08:56 2020 +0000
Revision:
0:083111ae2a11
first commit of leaned mbed dev lib

Who changed what in which revision?

UserRevisionLine numberNew contents of line
saloutos 0:083111ae2a11 1
saloutos 0:083111ae2a11 2 /** \addtogroup hal */
saloutos 0:083111ae2a11 3 /** @{*/
saloutos 0:083111ae2a11 4 /* mbed Microcontroller Library
saloutos 0:083111ae2a11 5 * Copyright (c) 2006-2013 ARM Limited
saloutos 0:083111ae2a11 6 *
saloutos 0:083111ae2a11 7 * Licensed under the Apache License, Version 2.0 (the "License");
saloutos 0:083111ae2a11 8 * you may not use this file except in compliance with the License.
saloutos 0:083111ae2a11 9 * You may obtain a copy of the License at
saloutos 0:083111ae2a11 10 *
saloutos 0:083111ae2a11 11 * http://www.apache.org/licenses/LICENSE-2.0
saloutos 0:083111ae2a11 12 *
saloutos 0:083111ae2a11 13 * Unless required by applicable law or agreed to in writing, software
saloutos 0:083111ae2a11 14 * distributed under the License is distributed on an "AS IS" BASIS,
saloutos 0:083111ae2a11 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
saloutos 0:083111ae2a11 16 * See the License for the specific language governing permissions and
saloutos 0:083111ae2a11 17 * limitations under the License.
saloutos 0:083111ae2a11 18 */
saloutos 0:083111ae2a11 19 #ifndef MBED_GPIO_IRQ_API_H
saloutos 0:083111ae2a11 20 #define MBED_GPIO_IRQ_API_H
saloutos 0:083111ae2a11 21
saloutos 0:083111ae2a11 22 #include "device.h"
saloutos 0:083111ae2a11 23
saloutos 0:083111ae2a11 24 #if DEVICE_INTERRUPTIN
saloutos 0:083111ae2a11 25
saloutos 0:083111ae2a11 26 #ifdef __cplusplus
saloutos 0:083111ae2a11 27 extern "C" {
saloutos 0:083111ae2a11 28 #endif
saloutos 0:083111ae2a11 29
saloutos 0:083111ae2a11 30 /** GPIO IRQ events
saloutos 0:083111ae2a11 31 */
saloutos 0:083111ae2a11 32 typedef enum {
saloutos 0:083111ae2a11 33 IRQ_NONE,
saloutos 0:083111ae2a11 34 IRQ_RISE,
saloutos 0:083111ae2a11 35 IRQ_FALL
saloutos 0:083111ae2a11 36 } gpio_irq_event;
saloutos 0:083111ae2a11 37
saloutos 0:083111ae2a11 38 /** GPIO IRQ HAL structure. gpio_irq_s is declared in the target's HAL
saloutos 0:083111ae2a11 39 */
saloutos 0:083111ae2a11 40 typedef struct gpio_irq_s gpio_irq_t;
saloutos 0:083111ae2a11 41
saloutos 0:083111ae2a11 42 typedef void (*gpio_irq_handler)(uint32_t id, gpio_irq_event event);
saloutos 0:083111ae2a11 43
saloutos 0:083111ae2a11 44 /**
saloutos 0:083111ae2a11 45 * \defgroup hal_gpioirq GPIO IRQ HAL functions
saloutos 0:083111ae2a11 46 * @{
saloutos 0:083111ae2a11 47 */
saloutos 0:083111ae2a11 48
saloutos 0:083111ae2a11 49 /** Initialize the GPIO IRQ pin
saloutos 0:083111ae2a11 50 *
saloutos 0:083111ae2a11 51 * @param obj The GPIO object to initialize
saloutos 0:083111ae2a11 52 * @param pin The GPIO pin name
saloutos 0:083111ae2a11 53 * @param handler The handler to be attached to GPIO IRQ
saloutos 0:083111ae2a11 54 * @param id The object ID (id != 0, 0 is reserved)
saloutos 0:083111ae2a11 55 * @return -1 if pin is NC, 0 otherwise
saloutos 0:083111ae2a11 56 */
saloutos 0:083111ae2a11 57 int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32_t id);
saloutos 0:083111ae2a11 58
saloutos 0:083111ae2a11 59 /** Release the GPIO IRQ PIN
saloutos 0:083111ae2a11 60 *
saloutos 0:083111ae2a11 61 * @param obj The gpio object
saloutos 0:083111ae2a11 62 */
saloutos 0:083111ae2a11 63 void gpio_irq_free(gpio_irq_t *obj);
saloutos 0:083111ae2a11 64
saloutos 0:083111ae2a11 65 /** Enable/disable pin IRQ event
saloutos 0:083111ae2a11 66 *
saloutos 0:083111ae2a11 67 * @param obj The GPIO object
saloutos 0:083111ae2a11 68 * @param event The GPIO IRQ event
saloutos 0:083111ae2a11 69 * @param enable The enable flag
saloutos 0:083111ae2a11 70 */
saloutos 0:083111ae2a11 71 void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable);
saloutos 0:083111ae2a11 72
saloutos 0:083111ae2a11 73 /** Enable GPIO IRQ
saloutos 0:083111ae2a11 74 *
saloutos 0:083111ae2a11 75 * This is target dependent, as it might enable the entire port or just a pin
saloutos 0:083111ae2a11 76 * @param obj The GPIO object
saloutos 0:083111ae2a11 77 */
saloutos 0:083111ae2a11 78 void gpio_irq_enable(gpio_irq_t *obj);
saloutos 0:083111ae2a11 79
saloutos 0:083111ae2a11 80 /** Disable GPIO IRQ
saloutos 0:083111ae2a11 81 *
saloutos 0:083111ae2a11 82 * This is target dependent, as it might disable the entire port or just a pin
saloutos 0:083111ae2a11 83 * @param obj The GPIO object
saloutos 0:083111ae2a11 84 */
saloutos 0:083111ae2a11 85 void gpio_irq_disable(gpio_irq_t *obj);
saloutos 0:083111ae2a11 86
saloutos 0:083111ae2a11 87 /**@}*/
saloutos 0:083111ae2a11 88
saloutos 0:083111ae2a11 89 #ifdef __cplusplus
saloutos 0:083111ae2a11 90 }
saloutos 0:083111ae2a11 91 #endif
saloutos 0:083111ae2a11 92
saloutos 0:083111ae2a11 93 #endif
saloutos 0:083111ae2a11 94
saloutos 0:083111ae2a11 95 #endif
saloutos 0:083111ae2a11 96
saloutos 0:083111ae2a11 97 /** @}*/