Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
platform_drivers/src/gpio_extra.h@8:ca65a811c522, 2021-10-27 (annotated)
- Committer:
- nsheth
- Date:
- Wed Oct 27 07:36:03 2021 +0000
- Revision:
- 8:ca65a811c522
Convert platform drivers away from library
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| nsheth | 8:ca65a811c522 | 1 | /***************************************************************************//** |
| nsheth | 8:ca65a811c522 | 2 | * @file gpio_extra.h |
| nsheth | 8:ca65a811c522 | 3 | * @brief: Header containing extra types required for GPIO interface |
| nsheth | 8:ca65a811c522 | 4 | ******************************************************************************** |
| nsheth | 8:ca65a811c522 | 5 | * Copyright (c) 2020 Analog Devices, Inc. |
| nsheth | 8:ca65a811c522 | 6 | * |
| nsheth | 8:ca65a811c522 | 7 | * All rights reserved. |
| nsheth | 8:ca65a811c522 | 8 | * |
| nsheth | 8:ca65a811c522 | 9 | * This software is proprietary to Analog Devices, Inc. and its licensors. |
| nsheth | 8:ca65a811c522 | 10 | * By using this software you agree to the terms of the associated |
| nsheth | 8:ca65a811c522 | 11 | * Analog Devices Software License Agreement. |
| nsheth | 8:ca65a811c522 | 12 | *******************************************************************************/ |
| nsheth | 8:ca65a811c522 | 13 | |
| nsheth | 8:ca65a811c522 | 14 | #ifndef GPIO_EXTRA_H |
| nsheth | 8:ca65a811c522 | 15 | #define GPIO_EXTRA_H |
| nsheth | 8:ca65a811c522 | 16 | |
| nsheth | 8:ca65a811c522 | 17 | |
| nsheth | 8:ca65a811c522 | 18 | // Platform support needs to be C-compatible to work with other drivers |
| nsheth | 8:ca65a811c522 | 19 | #ifdef __cplusplus |
| nsheth | 8:ca65a811c522 | 20 | extern "C" |
| nsheth | 8:ca65a811c522 | 21 | { |
| nsheth | 8:ca65a811c522 | 22 | #endif |
| nsheth | 8:ca65a811c522 | 23 | |
| nsheth | 8:ca65a811c522 | 24 | /******************************************************************************/ |
| nsheth | 8:ca65a811c522 | 25 | /***************************** Include Files **********************************/ |
| nsheth | 8:ca65a811c522 | 26 | /******************************************************************************/ |
| nsheth | 8:ca65a811c522 | 27 | #include <stdio.h> |
| nsheth | 8:ca65a811c522 | 28 | |
| nsheth | 8:ca65a811c522 | 29 | /******************************************************************************/ |
| nsheth | 8:ca65a811c522 | 30 | /********************** Macros and Constants Definitions **********************/ |
| nsheth | 8:ca65a811c522 | 31 | /******************************************************************************/ |
| nsheth | 8:ca65a811c522 | 32 | |
| nsheth | 8:ca65a811c522 | 33 | /******************************************************************************/ |
| nsheth | 8:ca65a811c522 | 34 | /********************** Variables and User defined data types *****************/ |
| nsheth | 8:ca65a811c522 | 35 | /******************************************************************************/ |
| nsheth | 8:ca65a811c522 | 36 | |
| nsheth | 8:ca65a811c522 | 37 | /* |
| nsheth | 8:ca65a811c522 | 38 | * Note: The structure members are not strongly typed, as this file is included |
| nsheth | 8:ca65a811c522 | 39 | * in application specific '.c' files. The mbed code structure does not |
| nsheth | 8:ca65a811c522 | 40 | * allow inclusion of mbed driver files (e.g. mbed.h) into '.c' files. |
| nsheth | 8:ca65a811c522 | 41 | * All the members are hence typecasted to mbed specific type during |
| nsheth | 8:ca65a811c522 | 42 | * gpio init and read/write operations. |
| nsheth | 8:ca65a811c522 | 43 | **/ |
| nsheth | 8:ca65a811c522 | 44 | |
| nsheth | 8:ca65a811c522 | 45 | /** |
| nsheth | 8:ca65a811c522 | 46 | * @struct mbed_gpio_init_param |
| nsheth | 8:ca65a811c522 | 47 | * @brief Structure holding the GPIO init parameters for mbed platform. |
| nsheth | 8:ca65a811c522 | 48 | */ |
| nsheth | 8:ca65a811c522 | 49 | typedef struct mbed_gpio_init_param { |
| nsheth | 8:ca65a811c522 | 50 | uint8_t pin_mode; // GPIO pin mode (PinMode) |
| nsheth | 8:ca65a811c522 | 51 | } mbed_gpio_init_param; |
| nsheth | 8:ca65a811c522 | 52 | |
| nsheth | 8:ca65a811c522 | 53 | /** |
| nsheth | 8:ca65a811c522 | 54 | * @struct mbed_gpio_desc |
| nsheth | 8:ca65a811c522 | 55 | * @brief GPIO specific descriptor for the mbed platform. |
| nsheth | 8:ca65a811c522 | 56 | */ |
| nsheth | 8:ca65a811c522 | 57 | typedef struct mbed_gpio_desc { |
| nsheth | 8:ca65a811c522 | 58 | void *gpio_pin; // GPIO pin instance (DigitalIn/DigitalOut) |
| nsheth | 8:ca65a811c522 | 59 | } mbed_gpio_desc; |
| nsheth | 8:ca65a811c522 | 60 | |
| nsheth | 8:ca65a811c522 | 61 | |
| nsheth | 8:ca65a811c522 | 62 | /******************************************************************************/ |
| nsheth | 8:ca65a811c522 | 63 | /************************ Functions Declarations ******************************/ |
| nsheth | 8:ca65a811c522 | 64 | /******************************************************************************/ |
| nsheth | 8:ca65a811c522 | 65 | |
| nsheth | 8:ca65a811c522 | 66 | |
| nsheth | 8:ca65a811c522 | 67 | #ifdef __cplusplus // Closing extern c |
| nsheth | 8:ca65a811c522 | 68 | } |
| nsheth | 8:ca65a811c522 | 69 | #endif |
| nsheth | 8:ca65a811c522 | 70 | |
| nsheth | 8:ca65a811c522 | 71 | #endif /* GPIO_EXTRA_H */ |