temp

Dependencies:   mbed SDFileSystem MS5607 ADXL345_I2C FATFileSystem

Committer:
IKobayashi
Date:
Mon Mar 16 23:37:42 2020 +0900
Revision:
0:c88c3b616c00
copy

Who changed what in which revision?

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