Changeset 429 for EcnlProtoTool/trunk/asp3_dcre/mbed/hal/gpio_api.h
- Timestamp:
- Jul 3, 2020, 7:19:17 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/gpio_api.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2006-2013 ARM Limited … … 17 20 #define MBED_GPIO_API_H 18 21 22 #include <stdint.h> 19 23 #include "device.h" 20 24 … … 23 27 #endif 24 28 25 /* Set the given pin as GPIO 29 /** 30 * \defgroup hal_gpio GPIO HAL functions 31 * @{ 32 */ 33 34 /** Set the given pin as GPIO 35 * 26 36 * @param pin The pin to be set as GPIO 27 37 * @return The GPIO port mask for this pin 28 38 **/ 29 39 uint32_t gpio_set(PinName pin); 30 31 40 /* Checks if gpio object is connected (pin was not initialized with NC) 32 41 * @param pin The pin to be set as GPIO … … 35 44 int gpio_is_connected(const gpio_t *obj); 36 45 37 /* GPIO object */ 46 /** Initialize the GPIO pin 47 * 48 * @param obj The GPIO object to initialize 49 * @param pin The GPIO pin to initialize 50 */ 38 51 void gpio_init(gpio_t *obj, PinName pin); 39 52 40 void gpio_mode (gpio_t *obj, PinMode mode); 41 void gpio_dir (gpio_t *obj, PinDirection direction); 53 /** Set the input pin mode 54 * 55 * @param obj The GPIO object 56 * @param mode The pin mode to be set 57 */ 58 void gpio_mode(gpio_t *obj, PinMode mode); 42 59 60 /** Set the pin direction 61 * 62 * @param obj The GPIO object 63 * @param direction The pin direction to be set 64 */ 65 void gpio_dir(gpio_t *obj, PinDirection direction); 66 67 /** Set the output value 68 * 69 * @param obj The GPIO object 70 * @param value The value to be set 71 */ 43 72 void gpio_write(gpio_t *obj, int value); 44 int gpio_read (gpio_t *obj);45 73 46 // the following set of functions are generic and are implemented in the common gpio.c file 74 /** Read the input value 75 * 76 * @param obj The GPIO object 77 * @return An integer value 1 or 0 78 */ 79 int gpio_read(gpio_t *obj); 80 81 // the following functions are generic and implemented in the common gpio.c file 82 // TODO: fix, will be moved to the common gpio header file 83 84 /** Init the input pin and set mode to PullDefault 85 * 86 * @param gpio The GPIO object 87 * @param pin The pin name 88 */ 47 89 void gpio_init_in(gpio_t* gpio, PinName pin); 90 91 /** Init the input pin and set the mode 92 * 93 * @param gpio The GPIO object 94 * @param pin The pin name 95 * @param mode The pin mode to be set 96 */ 48 97 void gpio_init_in_ex(gpio_t* gpio, PinName pin, PinMode mode); 98 99 /** Init the output pin as an output, with predefined output value 0 100 * 101 * @param gpio The GPIO object 102 * @param pin The pin name 103 * @return An integer value 1 or 0 104 */ 49 105 void gpio_init_out(gpio_t* gpio, PinName pin); 106 107 /** Init the pin as an output and set the output value 108 * 109 * @param gpio The GPIO object 110 * @param pin The pin name 111 * @param value The value to be set 112 */ 50 113 void gpio_init_out_ex(gpio_t* gpio, PinName pin, int value); 114 115 /** Init the pin to be in/out 116 * 117 * @param gpio The GPIO object 118 * @param pin The pin name 119 * @param direction The pin direction to be set 120 * @param mode The pin mode to be set 121 * @param value The value to be set for an output pin 122 */ 51 123 void gpio_init_inout(gpio_t* gpio, PinName pin, PinDirection direction, PinMode mode, int value); 124 125 /**@}*/ 52 126 53 127 #ifdef __cplusplus … … 56 130 57 131 #endif 132 133 /** @}*/
Note:
See TracChangeset
for help on using the changeset viewer.