mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
targets/hal/TARGET_STM/TARGET_DISCO_F303VC/gpio_irq_api.c@285:31249416b6f9, 2014-08-15 (annotated)
- Committer:
- mbed_official
- Date:
- Fri Aug 15 16:30:08 2014 +0100
- Revision:
- 285:31249416b6f9
- Parent:
- 251:de9a1e4ffd79
Synchronized with git revision 601712595f49bbd2a2771c52cf3e84c9c7a591af
Full URL: https://github.com/mbedmicro/mbed/commit/601712595f49bbd2a2771c52cf3e84c9c7a591af/
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 157:90e3acc479a2 | 1 | /* mbed Microcontroller Library |
mbed_official | 157:90e3acc479a2 | 2 | ******************************************************************************* |
mbed_official | 157:90e3acc479a2 | 3 | * Copyright (c) 2014, STMicroelectronics |
mbed_official | 157:90e3acc479a2 | 4 | * All rights reserved. |
mbed_official | 157:90e3acc479a2 | 5 | * |
mbed_official | 157:90e3acc479a2 | 6 | * Redistribution and use in source and binary forms, with or without |
mbed_official | 157:90e3acc479a2 | 7 | * modification, are permitted provided that the following conditions are met: |
mbed_official | 157:90e3acc479a2 | 8 | * |
mbed_official | 157:90e3acc479a2 | 9 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 157:90e3acc479a2 | 10 | * this list of conditions and the following disclaimer. |
mbed_official | 157:90e3acc479a2 | 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 157:90e3acc479a2 | 12 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 157:90e3acc479a2 | 13 | * and/or other materials provided with the distribution. |
mbed_official | 157:90e3acc479a2 | 14 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 157:90e3acc479a2 | 15 | * may be used to endorse or promote products derived from this software |
mbed_official | 157:90e3acc479a2 | 16 | * without specific prior written permission. |
mbed_official | 157:90e3acc479a2 | 17 | * |
mbed_official | 157:90e3acc479a2 | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 157:90e3acc479a2 | 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 157:90e3acc479a2 | 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 157:90e3acc479a2 | 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 157:90e3acc479a2 | 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 157:90e3acc479a2 | 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 157:90e3acc479a2 | 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 157:90e3acc479a2 | 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 157:90e3acc479a2 | 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 157:90e3acc479a2 | 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 157:90e3acc479a2 | 28 | ******************************************************************************* |
mbed_official | 157:90e3acc479a2 | 29 | */ |
mbed_official | 157:90e3acc479a2 | 30 | #include <stddef.h> |
mbed_official | 157:90e3acc479a2 | 31 | #include "cmsis.h" |
mbed_official | 157:90e3acc479a2 | 32 | |
mbed_official | 157:90e3acc479a2 | 33 | #include "gpio_irq_api.h" |
mbed_official | 157:90e3acc479a2 | 34 | #include "pinmap.h" |
mbed_official | 285:31249416b6f9 | 35 | #include "mbed_error.h" |
mbed_official | 157:90e3acc479a2 | 36 | |
mbed_official | 157:90e3acc479a2 | 37 | #define EDGE_NONE (0) |
mbed_official | 157:90e3acc479a2 | 38 | #define EDGE_RISE (1) |
mbed_official | 157:90e3acc479a2 | 39 | #define EDGE_FALL (2) |
mbed_official | 157:90e3acc479a2 | 40 | #define EDGE_BOTH (3) |
mbed_official | 157:90e3acc479a2 | 41 | |
mbed_official | 157:90e3acc479a2 | 42 | #define CHANNEL_NUM (7) |
mbed_official | 157:90e3acc479a2 | 43 | |
mbed_official | 157:90e3acc479a2 | 44 | static uint32_t channel_ids[CHANNEL_NUM] = {0, 0, 0, 0, 0, 0, 0}; |
mbed_official | 157:90e3acc479a2 | 45 | static uint32_t channel_gpio[CHANNEL_NUM] = {0, 0, 0, 0, 0, 0, 0}; |
mbed_official | 157:90e3acc479a2 | 46 | static uint32_t channel_pin[CHANNEL_NUM] = {0, 0, 0, 0, 0, 0, 0}; |
mbed_official | 157:90e3acc479a2 | 47 | |
mbed_official | 157:90e3acc479a2 | 48 | static gpio_irq_handler irq_handler; |
mbed_official | 157:90e3acc479a2 | 49 | |
mbed_official | 157:90e3acc479a2 | 50 | static void handle_interrupt_in(uint32_t irq_index) { |
mbed_official | 157:90e3acc479a2 | 51 | // Retrieve the gpio and pin that generate the irq |
mbed_official | 157:90e3acc479a2 | 52 | GPIO_TypeDef *gpio = (GPIO_TypeDef *)(channel_gpio[irq_index]); |
mbed_official | 157:90e3acc479a2 | 53 | uint32_t pin = (uint32_t)(1 << channel_pin[irq_index]); |
mbed_official | 157:90e3acc479a2 | 54 | |
mbed_official | 157:90e3acc479a2 | 55 | // Clear interrupt flag |
mbed_official | 157:90e3acc479a2 | 56 | if (EXTI_GetITStatus(channel_pin[irq_index]) != RESET) { |
mbed_official | 157:90e3acc479a2 | 57 | EXTI_ClearITPendingBit(channel_pin[irq_index]); |
mbed_official | 157:90e3acc479a2 | 58 | } |
mbed_official | 157:90e3acc479a2 | 59 | |
mbed_official | 157:90e3acc479a2 | 60 | if (channel_ids[irq_index] == 0) return; |
mbed_official | 157:90e3acc479a2 | 61 | |
mbed_official | 157:90e3acc479a2 | 62 | // Check which edge has generated the irq |
mbed_official | 157:90e3acc479a2 | 63 | if ((gpio->IDR & pin) == 0) { |
mbed_official | 157:90e3acc479a2 | 64 | irq_handler(channel_ids[irq_index], IRQ_FALL); |
mbed_official | 157:90e3acc479a2 | 65 | } else { |
mbed_official | 157:90e3acc479a2 | 66 | irq_handler(channel_ids[irq_index], IRQ_RISE); |
mbed_official | 157:90e3acc479a2 | 67 | } |
mbed_official | 157:90e3acc479a2 | 68 | } |
mbed_official | 157:90e3acc479a2 | 69 | |
mbed_official | 157:90e3acc479a2 | 70 | static void gpio_irq0(void) { |
mbed_official | 157:90e3acc479a2 | 71 | handle_interrupt_in(0); // EXTI line 0 |
mbed_official | 157:90e3acc479a2 | 72 | } |
mbed_official | 157:90e3acc479a2 | 73 | |
mbed_official | 157:90e3acc479a2 | 74 | static void gpio_irq1(void) { |
mbed_official | 157:90e3acc479a2 | 75 | handle_interrupt_in(1); // EXTI line 1 |
mbed_official | 157:90e3acc479a2 | 76 | } |
mbed_official | 157:90e3acc479a2 | 77 | |
mbed_official | 157:90e3acc479a2 | 78 | static void gpio_irq2(void) { |
mbed_official | 157:90e3acc479a2 | 79 | handle_interrupt_in(2); // EXTI line 2 |
mbed_official | 157:90e3acc479a2 | 80 | } |
mbed_official | 157:90e3acc479a2 | 81 | |
mbed_official | 157:90e3acc479a2 | 82 | static void gpio_irq3(void) { |
mbed_official | 157:90e3acc479a2 | 83 | handle_interrupt_in(3); // EXTI line 3 |
mbed_official | 157:90e3acc479a2 | 84 | } |
mbed_official | 157:90e3acc479a2 | 85 | |
mbed_official | 157:90e3acc479a2 | 86 | static void gpio_irq4(void) { |
mbed_official | 157:90e3acc479a2 | 87 | handle_interrupt_in(4); // EXTI line 4 |
mbed_official | 157:90e3acc479a2 | 88 | } |
mbed_official | 157:90e3acc479a2 | 89 | |
mbed_official | 157:90e3acc479a2 | 90 | static void gpio_irq5(void) { |
mbed_official | 157:90e3acc479a2 | 91 | handle_interrupt_in(5); // EXTI lines 5 to 9 |
mbed_official | 157:90e3acc479a2 | 92 | } |
mbed_official | 157:90e3acc479a2 | 93 | |
mbed_official | 157:90e3acc479a2 | 94 | static void gpio_irq6(void) { |
mbed_official | 157:90e3acc479a2 | 95 | handle_interrupt_in(6); // EXTI lines 10 to 15 |
mbed_official | 157:90e3acc479a2 | 96 | } |
mbed_official | 157:90e3acc479a2 | 97 | |
mbed_official | 157:90e3acc479a2 | 98 | extern uint32_t Set_GPIO_Clock(uint32_t port_idx); |
mbed_official | 157:90e3acc479a2 | 99 | |
mbed_official | 157:90e3acc479a2 | 100 | int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32_t id) { |
mbed_official | 157:90e3acc479a2 | 101 | IRQn_Type irq_n = (IRQn_Type)0; |
mbed_official | 157:90e3acc479a2 | 102 | uint32_t vector = 0; |
mbed_official | 157:90e3acc479a2 | 103 | uint32_t irq_index; |
mbed_official | 157:90e3acc479a2 | 104 | |
mbed_official | 157:90e3acc479a2 | 105 | if (pin == NC) return -1; |
mbed_official | 157:90e3acc479a2 | 106 | |
mbed_official | 157:90e3acc479a2 | 107 | uint32_t port_index = STM_PORT(pin); |
mbed_official | 157:90e3acc479a2 | 108 | uint32_t pin_index = STM_PIN(pin); |
mbed_official | 157:90e3acc479a2 | 109 | |
mbed_official | 157:90e3acc479a2 | 110 | // Select irq number and interrupt routine |
mbed_official | 157:90e3acc479a2 | 111 | switch (pin_index) { |
mbed_official | 157:90e3acc479a2 | 112 | case 0: |
mbed_official | 157:90e3acc479a2 | 113 | irq_n = EXTI0_IRQn; |
mbed_official | 157:90e3acc479a2 | 114 | vector = (uint32_t)&gpio_irq0; |
mbed_official | 157:90e3acc479a2 | 115 | irq_index = 0; |
mbed_official | 157:90e3acc479a2 | 116 | break; |
mbed_official | 157:90e3acc479a2 | 117 | case 1: |
mbed_official | 157:90e3acc479a2 | 118 | irq_n = EXTI1_IRQn; |
mbed_official | 157:90e3acc479a2 | 119 | vector = (uint32_t)&gpio_irq1; |
mbed_official | 157:90e3acc479a2 | 120 | irq_index = 1; |
mbed_official | 157:90e3acc479a2 | 121 | break; |
mbed_official | 157:90e3acc479a2 | 122 | case 2: |
mbed_official | 157:90e3acc479a2 | 123 | irq_n = EXTI2_TS_IRQn; |
mbed_official | 157:90e3acc479a2 | 124 | vector = (uint32_t)&gpio_irq2; |
mbed_official | 157:90e3acc479a2 | 125 | irq_index = 2; |
mbed_official | 157:90e3acc479a2 | 126 | break; |
mbed_official | 157:90e3acc479a2 | 127 | case 3: |
mbed_official | 157:90e3acc479a2 | 128 | irq_n = EXTI3_IRQn; |
mbed_official | 157:90e3acc479a2 | 129 | vector = (uint32_t)&gpio_irq3; |
mbed_official | 157:90e3acc479a2 | 130 | irq_index = 3; |
mbed_official | 157:90e3acc479a2 | 131 | break; |
mbed_official | 157:90e3acc479a2 | 132 | case 4: |
mbed_official | 157:90e3acc479a2 | 133 | irq_n = EXTI4_IRQn; |
mbed_official | 157:90e3acc479a2 | 134 | vector = (uint32_t)&gpio_irq4; |
mbed_official | 157:90e3acc479a2 | 135 | irq_index = 4; |
mbed_official | 157:90e3acc479a2 | 136 | break; |
mbed_official | 157:90e3acc479a2 | 137 | case 5: |
mbed_official | 157:90e3acc479a2 | 138 | case 6: |
mbed_official | 157:90e3acc479a2 | 139 | case 7: |
mbed_official | 157:90e3acc479a2 | 140 | case 8: |
mbed_official | 157:90e3acc479a2 | 141 | case 9: |
mbed_official | 157:90e3acc479a2 | 142 | irq_n = EXTI9_5_IRQn; |
mbed_official | 157:90e3acc479a2 | 143 | vector = (uint32_t)&gpio_irq5; |
mbed_official | 157:90e3acc479a2 | 144 | irq_index = 5; |
mbed_official | 157:90e3acc479a2 | 145 | break; |
mbed_official | 157:90e3acc479a2 | 146 | case 10: |
mbed_official | 157:90e3acc479a2 | 147 | case 11: |
mbed_official | 157:90e3acc479a2 | 148 | case 12: |
mbed_official | 157:90e3acc479a2 | 149 | case 13: |
mbed_official | 157:90e3acc479a2 | 150 | case 14: |
mbed_official | 157:90e3acc479a2 | 151 | case 15: |
mbed_official | 157:90e3acc479a2 | 152 | irq_n = EXTI15_10_IRQn; |
mbed_official | 157:90e3acc479a2 | 153 | vector = (uint32_t)&gpio_irq6; |
mbed_official | 157:90e3acc479a2 | 154 | irq_index = 6; |
mbed_official | 157:90e3acc479a2 | 155 | break; |
mbed_official | 157:90e3acc479a2 | 156 | default: |
mbed_official | 241:ffe41b0c8126 | 157 | error("This pin is not supported with InterruptIn."); |
mbed_official | 157:90e3acc479a2 | 158 | return -1; |
mbed_official | 157:90e3acc479a2 | 159 | } |
mbed_official | 157:90e3acc479a2 | 160 | |
mbed_official | 157:90e3acc479a2 | 161 | // Enable GPIO clock |
mbed_official | 157:90e3acc479a2 | 162 | uint32_t gpio_add = Set_GPIO_Clock(port_index); |
mbed_official | 157:90e3acc479a2 | 163 | |
mbed_official | 157:90e3acc479a2 | 164 | // Enable SYSCFG clock |
mbed_official | 157:90e3acc479a2 | 165 | RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE); |
mbed_official | 157:90e3acc479a2 | 166 | |
mbed_official | 157:90e3acc479a2 | 167 | // Connect EXTI line to pin |
mbed_official | 157:90e3acc479a2 | 168 | SYSCFG_EXTILineConfig(port_index, pin_index); |
mbed_official | 157:90e3acc479a2 | 169 | |
mbed_official | 157:90e3acc479a2 | 170 | // Configure EXTI line |
mbed_official | 157:90e3acc479a2 | 171 | EXTI_InitTypeDef EXTI_InitStructure; |
mbed_official | 157:90e3acc479a2 | 172 | EXTI_InitStructure.EXTI_Line = pin_index; |
mbed_official | 157:90e3acc479a2 | 173 | EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; |
mbed_official | 157:90e3acc479a2 | 174 | EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling; |
mbed_official | 157:90e3acc479a2 | 175 | EXTI_InitStructure.EXTI_LineCmd = ENABLE; |
mbed_official | 157:90e3acc479a2 | 176 | EXTI_Init(&EXTI_InitStructure); |
mbed_official | 157:90e3acc479a2 | 177 | |
mbed_official | 157:90e3acc479a2 | 178 | // Enable and set EXTI interrupt to the lowest priority |
mbed_official | 157:90e3acc479a2 | 179 | NVIC_InitTypeDef NVIC_InitStructure; |
mbed_official | 157:90e3acc479a2 | 180 | NVIC_InitStructure.NVIC_IRQChannel = irq_n; |
mbed_official | 157:90e3acc479a2 | 181 | NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x0F; |
mbed_official | 157:90e3acc479a2 | 182 | NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0F; |
mbed_official | 157:90e3acc479a2 | 183 | NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; |
mbed_official | 157:90e3acc479a2 | 184 | NVIC_Init(&NVIC_InitStructure); |
mbed_official | 157:90e3acc479a2 | 185 | |
mbed_official | 157:90e3acc479a2 | 186 | NVIC_SetVector(irq_n, vector); |
mbed_official | 157:90e3acc479a2 | 187 | NVIC_EnableIRQ(irq_n); |
mbed_official | 157:90e3acc479a2 | 188 | |
mbed_official | 157:90e3acc479a2 | 189 | // Save informations for future use |
mbed_official | 157:90e3acc479a2 | 190 | obj->irq_n = irq_n; |
mbed_official | 157:90e3acc479a2 | 191 | obj->irq_index = irq_index; |
mbed_official | 157:90e3acc479a2 | 192 | obj->event = EDGE_NONE; |
mbed_official | 157:90e3acc479a2 | 193 | channel_ids[irq_index] = id; |
mbed_official | 157:90e3acc479a2 | 194 | channel_gpio[irq_index] = gpio_add; |
mbed_official | 157:90e3acc479a2 | 195 | channel_pin[irq_index] = pin_index; |
mbed_official | 157:90e3acc479a2 | 196 | |
mbed_official | 157:90e3acc479a2 | 197 | irq_handler = handler; |
mbed_official | 157:90e3acc479a2 | 198 | |
mbed_official | 157:90e3acc479a2 | 199 | return 0; |
mbed_official | 157:90e3acc479a2 | 200 | } |
mbed_official | 157:90e3acc479a2 | 201 | |
mbed_official | 157:90e3acc479a2 | 202 | void gpio_irq_free(gpio_irq_t *obj) { |
mbed_official | 157:90e3acc479a2 | 203 | channel_ids[obj->irq_index] = 0; |
mbed_official | 157:90e3acc479a2 | 204 | channel_gpio[obj->irq_index] = 0; |
mbed_official | 157:90e3acc479a2 | 205 | channel_pin[obj->irq_index] = 0; |
mbed_official | 157:90e3acc479a2 | 206 | // Disable EXTI line |
mbed_official | 157:90e3acc479a2 | 207 | EXTI_InitTypeDef EXTI_InitStructure; |
mbed_official | 157:90e3acc479a2 | 208 | EXTI_StructInit(&EXTI_InitStructure); |
mbed_official | 157:90e3acc479a2 | 209 | EXTI_Init(&EXTI_InitStructure); |
mbed_official | 157:90e3acc479a2 | 210 | obj->event = EDGE_NONE; |
mbed_official | 157:90e3acc479a2 | 211 | } |
mbed_official | 157:90e3acc479a2 | 212 | |
mbed_official | 157:90e3acc479a2 | 213 | void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable) { |
mbed_official | 157:90e3acc479a2 | 214 | EXTI_InitTypeDef EXTI_InitStructure; |
mbed_official | 157:90e3acc479a2 | 215 | |
mbed_official | 157:90e3acc479a2 | 216 | EXTI_InitStructure.EXTI_Line = channel_pin[obj->irq_index]; |
mbed_official | 157:90e3acc479a2 | 217 | EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; |
mbed_official | 157:90e3acc479a2 | 218 | |
mbed_official | 157:90e3acc479a2 | 219 | if (event == IRQ_RISE) { |
mbed_official | 157:90e3acc479a2 | 220 | if ((obj->event == EDGE_FALL) || (obj->event == EDGE_BOTH)) { |
mbed_official | 157:90e3acc479a2 | 221 | EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising_Falling; |
mbed_official | 157:90e3acc479a2 | 222 | obj->event = EDGE_BOTH; |
mbed_official | 157:90e3acc479a2 | 223 | } else { // NONE or RISE |
mbed_official | 157:90e3acc479a2 | 224 | EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising; |
mbed_official | 157:90e3acc479a2 | 225 | obj->event = EDGE_RISE; |
mbed_official | 157:90e3acc479a2 | 226 | } |
mbed_official | 157:90e3acc479a2 | 227 | } |
mbed_official | 157:90e3acc479a2 | 228 | |
mbed_official | 157:90e3acc479a2 | 229 | if (event == IRQ_FALL) { |
mbed_official | 157:90e3acc479a2 | 230 | if ((obj->event == EDGE_RISE) || (obj->event == EDGE_BOTH)) { |
mbed_official | 157:90e3acc479a2 | 231 | EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising_Falling; |
mbed_official | 157:90e3acc479a2 | 232 | obj->event = EDGE_BOTH; |
mbed_official | 157:90e3acc479a2 | 233 | } else { // NONE or FALL |
mbed_official | 157:90e3acc479a2 | 234 | EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling; |
mbed_official | 157:90e3acc479a2 | 235 | obj->event = EDGE_FALL; |
mbed_official | 157:90e3acc479a2 | 236 | } |
mbed_official | 157:90e3acc479a2 | 237 | } |
mbed_official | 157:90e3acc479a2 | 238 | |
mbed_official | 157:90e3acc479a2 | 239 | if (enable) { |
mbed_official | 157:90e3acc479a2 | 240 | EXTI_InitStructure.EXTI_LineCmd = ENABLE; |
mbed_official | 157:90e3acc479a2 | 241 | } else { |
mbed_official | 157:90e3acc479a2 | 242 | EXTI_InitStructure.EXTI_LineCmd = DISABLE; |
mbed_official | 157:90e3acc479a2 | 243 | } |
mbed_official | 157:90e3acc479a2 | 244 | |
mbed_official | 157:90e3acc479a2 | 245 | EXTI_Init(&EXTI_InitStructure); |
mbed_official | 157:90e3acc479a2 | 246 | } |
mbed_official | 157:90e3acc479a2 | 247 | |
mbed_official | 157:90e3acc479a2 | 248 | void gpio_irq_enable(gpio_irq_t *obj) { |
mbed_official | 157:90e3acc479a2 | 249 | NVIC_EnableIRQ(obj->irq_n); |
mbed_official | 157:90e3acc479a2 | 250 | } |
mbed_official | 157:90e3acc479a2 | 251 | |
mbed_official | 157:90e3acc479a2 | 252 | void gpio_irq_disable(gpio_irq_t *obj) { |
mbed_official | 157:90e3acc479a2 | 253 | NVIC_DisableIRQ(obj->irq_n); |
mbed_official | 157:90e3acc479a2 | 254 | obj->event = EDGE_NONE; |
mbed_official | 157:90e3acc479a2 | 255 | } |