test test test

Dependencies:   mbed

Committer:
mohamedmoawya
Date:
Mon May 25 19:06:11 2020 +0000
Revision:
0:e4c5e6ec922e
snake game tteest

Who changed what in which revision?

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