mikroSDK Reference Manual
hal_gpio.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2023 MikroElektronika d.o.o.
4 ** Contact: https://www.mikroe.com/contact
5 **
6 ** This file is part of the mikroSDK package
7 **
8 ** Commercial License Usage
9 **
10 ** Licensees holding valid commercial NECTO compilers AI licenses may use this
11 ** file in accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The MikroElektronika Company.
14 ** For licensing terms and conditions see
15 ** https://www.mikroe.com/legal/software-license-agreement.
16 ** For further information use the contact form at
17 ** https://www.mikroe.com/contact.
18 **
19 **
20 ** GNU Lesser General Public License Usage
21 **
22 ** Alternatively, this file may be used for
23 ** non-commercial projects under the terms of the GNU Lesser
24 ** General Public License version 3 as published by the Free Software
25 ** Foundation: https://www.gnu.org/licenses/lgpl-3.0.html.
26 **
27 ** The above copyright notice and this permission notice shall be
28 ** included in all copies or substantial portions of the Software.
29 **
30 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
31 ** OF MERCHANTABILITY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
32 ** TO THE WARRANTIES FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
33 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
34 ** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
35 ** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
36 ** OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37 **
38 ****************************************************************************/
44 #ifndef _HAL_GPIO_H_
45 #define _HAL_GPIO_H_
46 
47 #ifdef __cplusplus
48 extern "C"{
49 #endif
50 
51 #include "hal_target.h"
52 #include "hal_ll_gpio.h"
53 
57 typedef enum
58 {
62 
63 typedef handle_t hal_gpio_base_t;
64 typedef hal_ll_gpio_mask_t hal_gpio_mask_t;
75 typedef struct hal_gpio_t
76 {
79 };
80 
81 typedef struct hal_gpio_t hal_gpio_pin_t;
82 typedef struct hal_gpio_t hal_gpio_port_t;
132 
152 
172 
191 void hal_gpio_write_pin_output( hal_gpio_pin_t *pin, uint8_t value );
192 
211 
230 
249 
283 
303 
323 
344  // halgpiogroup // halgroup // pergroup
348 
349 #ifdef __cplusplus
350 }
351 #endif
352 
353 #endif // _HAL_GPIO_H_
354 // ------------------------------------------------------------------------- END
hal_gpio_read_port_output
hal_port_size_t hal_gpio_read_port_output(hal_gpio_port_t *port)
Read port.
hal_gpio_t::base
hal_gpio_base_t base
Definition: hal_gpio.h:76
hal_gpio_write_pin_output
void hal_gpio_write_pin_output(hal_gpio_pin_t *pin, uint8_t value)
Sets pin state.
hal_gpio_direction_t
hal_gpio_direction_t
Definition: hal_gpio.h:56
hal_gpio_t::mask
hal_gpio_mask_t mask
Definition: hal_gpio.h:77
hal_gpio_base_t
handle_t hal_gpio_base_t
Definition: hal_gpio.h:62
hal_target.h
HAL target macros and typedefs.
hal_gpio_read_pin_output
uint8_t hal_gpio_read_pin_output(hal_gpio_pin_t *pin)
Read pin.
hal_port_name_t
hal_ll_port_name_t hal_port_name_t
Definition: hal_target.h:60
hal_gpio_mask_t
hal_ll_gpio_mask_t hal_gpio_mask_t
Definition: hal_gpio.h:63
HAL_GPIO_DIGITAL_OUTPUT
Definition: hal_gpio.h:59
hal_pin_name_t
hal_ll_pin_name_t hal_pin_name_t
Definition: hal_target.h:59
hal_gpio_read_port_input
hal_port_size_t hal_gpio_read_port_input(hal_gpio_port_t *port)
Read port.
hal_gpio_write_port_output
void hal_gpio_write_port_output(hal_gpio_port_t *port, hal_port_size_t value)
Sets port state.
hal_gpio_read_pin_input
uint8_t hal_gpio_read_pin_input(hal_gpio_pin_t *pin)
Read pin.
hal_gpio_configure_port
void hal_gpio_configure_port(hal_gpio_port_t *port, hal_port_name_t name, hal_gpio_mask_t mask, hal_gpio_direction_t direction)
Configure port.
hal_gpio_configure_pin
void hal_gpio_configure_pin(hal_gpio_pin_t *pin, hal_pin_name_t name, hal_gpio_direction_t direction)
Configure pin.
hal_gpio_toggle_pin_output
void hal_gpio_toggle_pin_output(hal_gpio_pin_t *pin)
Toggle pin state.
hal_gpio_clear_pin_output
void hal_gpio_clear_pin_output(hal_gpio_pin_t *pin)
Set pin state low.
hal_gpio_set_pin_output
void hal_gpio_set_pin_output(hal_gpio_pin_t *pin)
Set pin state high.
hal_gpio_t
GPIO HAL context structure, consisted of the following fields :
Definition: hal_gpio.h:74
HAL_GPIO_DIGITAL_INPUT
Definition: hal_gpio.h:58
hal_port_size_t
hal_ll_port_size_t hal_port_size_t
Definition: hal_target.h:61