Platform drivers for Mbed.
Dependents: EVAL-CN0535-FMCZ EVAL-CN0535-FMCZ EVAL-AD568x-AD569x EVAL-AD7606 ... more
irq_extra.h@17:af1f2416dd26, 2021-07-13 (annotated)
- Committer:
- mahphalke
- Date:
- Tue Jul 13 13:58:07 2021 +0530
- Revision:
- 17:af1f2416dd26
- Child:
- 20:4951ea6abee5
Restructured the directory- Removed inc/ and src/ folders and moved all source/header files at root
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mahphalke |
17:af1f2416dd26 | 1 | /***************************************************************************//** |
mahphalke |
17:af1f2416dd26 | 2 | * @file irq_extra.h |
mahphalke |
17:af1f2416dd26 | 3 | * @brief: Header containing extra types required for IRQ drivers |
mahphalke |
17:af1f2416dd26 | 4 | ******************************************************************************** |
mahphalke |
17:af1f2416dd26 | 5 | * Copyright (c) 2020-2021 Analog Devices, Inc. |
mahphalke |
17:af1f2416dd26 | 6 | * All rights reserved. |
mahphalke |
17:af1f2416dd26 | 7 | * |
mahphalke |
17:af1f2416dd26 | 8 | * This software is proprietary to Analog Devices, Inc. and its licensors. |
mahphalke |
17:af1f2416dd26 | 9 | * By using this software you agree to the terms of the associated |
mahphalke |
17:af1f2416dd26 | 10 | * Analog Devices Software License Agreement. |
mahphalke |
17:af1f2416dd26 | 11 | *******************************************************************************/ |
mahphalke |
17:af1f2416dd26 | 12 | |
mahphalke |
17:af1f2416dd26 | 13 | #ifndef IRQ_EXTRA_H |
mahphalke |
17:af1f2416dd26 | 14 | #define IRQ_EXTRA_H |
mahphalke |
17:af1f2416dd26 | 15 | |
mahphalke |
17:af1f2416dd26 | 16 | |
mahphalke |
17:af1f2416dd26 | 17 | // Platform support needs to be C-compatible to work with other drivers |
mahphalke |
17:af1f2416dd26 | 18 | #ifdef __cplusplus |
mahphalke |
17:af1f2416dd26 | 19 | extern "C" |
mahphalke |
17:af1f2416dd26 | 20 | { |
mahphalke |
17:af1f2416dd26 | 21 | #endif |
mahphalke |
17:af1f2416dd26 | 22 | |
mahphalke |
17:af1f2416dd26 | 23 | /******************************************************************************/ |
mahphalke |
17:af1f2416dd26 | 24 | /***************************** Include Files **********************************/ |
mahphalke |
17:af1f2416dd26 | 25 | /******************************************************************************/ |
mahphalke |
17:af1f2416dd26 | 26 | |
mahphalke |
17:af1f2416dd26 | 27 | #include <stdbool.h> |
mahphalke |
17:af1f2416dd26 | 28 | |
mahphalke |
17:af1f2416dd26 | 29 | /******************************************************************************/ |
mahphalke |
17:af1f2416dd26 | 30 | /********************** Macros and Constants Definitions **********************/ |
mahphalke |
17:af1f2416dd26 | 31 | /******************************************************************************/ |
mahphalke |
17:af1f2416dd26 | 32 | |
mahphalke |
17:af1f2416dd26 | 33 | /******************************************************************************/ |
mahphalke |
17:af1f2416dd26 | 34 | /*************************** Types Declarations *******************************/ |
mahphalke |
17:af1f2416dd26 | 35 | /******************************************************************************/ |
mahphalke |
17:af1f2416dd26 | 36 | |
mahphalke |
17:af1f2416dd26 | 37 | /** |
mahphalke |
17:af1f2416dd26 | 38 | * @enum irq_id |
mahphalke |
17:af1f2416dd26 | 39 | * @brief Interrupts IDs supported by the mbed irq driver |
mahphalke |
17:af1f2416dd26 | 40 | */ |
mahphalke |
17:af1f2416dd26 | 41 | enum irq_id { |
mahphalke |
17:af1f2416dd26 | 42 | /** External interrupt ID1 */ |
mahphalke |
17:af1f2416dd26 | 43 | EXTERNAL_INT_ID1, |
mahphalke |
17:af1f2416dd26 | 44 | /** External interrupt ID2 */ |
mahphalke |
17:af1f2416dd26 | 45 | EXTERNAL_INT_ID2, |
mahphalke |
17:af1f2416dd26 | 46 | /** External interrupt ID3 */ |
mahphalke |
17:af1f2416dd26 | 47 | EXTERNAL_INT_ID3, |
mahphalke |
17:af1f2416dd26 | 48 | /** External interrupt ID4 */ |
mahphalke |
17:af1f2416dd26 | 49 | EXTERNAL_INT_ID4, |
mahphalke |
17:af1f2416dd26 | 50 | /** External interrupt ID5 */ |
mahphalke |
17:af1f2416dd26 | 51 | EXTERNAL_INT_ID5, |
mahphalke |
17:af1f2416dd26 | 52 | /** UART Rx interrupt ID1 */ |
mahphalke |
17:af1f2416dd26 | 53 | UART_RX_INT_ID1, |
mahphalke |
17:af1f2416dd26 | 54 | /** Ticker interrupt ID */ |
mahphalke |
17:af1f2416dd26 | 55 | TICKER_INT_ID, |
mahphalke |
17:af1f2416dd26 | 56 | /* Number of available interrupts */ |
mahphalke |
17:af1f2416dd26 | 57 | NB_INTERRUPTS |
mahphalke |
17:af1f2416dd26 | 58 | }; |
mahphalke |
17:af1f2416dd26 | 59 | |
mahphalke |
17:af1f2416dd26 | 60 | /* |
mahphalke |
17:af1f2416dd26 | 61 | * External IRQ events |
mahphalke |
17:af1f2416dd26 | 62 | * */ |
mahphalke |
17:af1f2416dd26 | 63 | typedef enum { |
mahphalke |
17:af1f2416dd26 | 64 | EXT_IRQ_NONE, |
mahphalke |
17:af1f2416dd26 | 65 | EXT_IRQ_RISE, |
mahphalke |
17:af1f2416dd26 | 66 | EXT_IRQ_FALL |
mahphalke |
17:af1f2416dd26 | 67 | } ext_irq_event; |
mahphalke |
17:af1f2416dd26 | 68 | |
mahphalke |
17:af1f2416dd26 | 69 | /** |
mahphalke |
17:af1f2416dd26 | 70 | * @struct mbed_irq_init_param |
mahphalke |
17:af1f2416dd26 | 71 | * @brief Structure holding the extra parameters for Interrupt Request. |
mahphalke |
17:af1f2416dd26 | 72 | */ |
mahphalke |
17:af1f2416dd26 | 73 | typedef struct { |
mahphalke |
17:af1f2416dd26 | 74 | uint32_t int_mode; // Interrupt mode (falling/rising etc) |
mahphalke |
17:af1f2416dd26 | 75 | uint32_t ext_int_pin; // External Interrupt pin |
mahphalke |
17:af1f2416dd26 | 76 | uint32_t ticker_period_usec; // Time period in usec for ticker event |
mahphalke |
17:af1f2416dd26 | 77 | void *int_obj_type; // Interrupt handling object |
mahphalke |
17:af1f2416dd26 | 78 | } mbed_irq_init_param; |
mahphalke |
17:af1f2416dd26 | 79 | |
mahphalke |
17:af1f2416dd26 | 80 | /** |
mahphalke |
17:af1f2416dd26 | 81 | * @struct mbed_irq_desc |
mahphalke |
17:af1f2416dd26 | 82 | * @brief Structure holding the platform descriptor for Interrupt Request. |
mahphalke |
17:af1f2416dd26 | 83 | */ |
mahphalke |
17:af1f2416dd26 | 84 | typedef struct { |
mahphalke |
17:af1f2416dd26 | 85 | uint32_t int_mode; // Interrupt mode (falling/rising etc) |
mahphalke |
17:af1f2416dd26 | 86 | uint32_t ext_int_pin; // External Interrupt pin |
mahphalke |
17:af1f2416dd26 | 87 | uint32_t ticker_period_usec; // Time period in usec for ticker event |
mahphalke |
17:af1f2416dd26 | 88 | void *int_obj_type; // Interrupt handling object |
mahphalke |
17:af1f2416dd26 | 89 | void *int_obj; // Interrupt object (e.g. InterruptIn) |
mahphalke |
17:af1f2416dd26 | 90 | } mbed_irq_desc; |
mahphalke |
17:af1f2416dd26 | 91 | |
mahphalke |
17:af1f2416dd26 | 92 | #ifdef __cplusplus // Closing extern c |
mahphalke |
17:af1f2416dd26 | 93 | } |
mahphalke |
17:af1f2416dd26 | 94 | #endif |
mahphalke |
17:af1f2416dd26 | 95 | |
mahphalke |
17:af1f2416dd26 | 96 | #endif // IRQ_EXTRA_H_ |