-
Notifications
You must be signed in to change notification settings - Fork 0
/
GPIO_ex.h
executable file
·57 lines (45 loc) · 1.59 KB
/
GPIO_ex.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*!\file GPIO_ex.h
** \author SMFSW
** \copyright MIT (c) 2017-2024, SMFSW
** \brief Extensions for GPIOs (R/W)
**/
/****************************************************************/
#ifndef __GPIO_EX_H
#define __GPIO_EX_H
#ifdef __cplusplus
extern "C" {
#endif
#include "sarmfsw.h"
#include "GPIO_in.h"
#include "GPIO_out.h"
#if defined(HAL_GPIO_MODULE_ENABLED)
/****************************************************************/
// *****************************************************************************
// Section: Interface Routines
// *****************************************************************************
/*!\brief Write GPIO
** \param[in] GPIOx - port to write to
** \param[in] GPIO_Pin - pin to write to
** \param[in] action - action to perform on output port pin
**/
void NONNULL__ write_GPIO(GPIO_TypeDef * const GPIOx, const uint16_t GPIO_Pin, const eGPIOState action);
/*!\brief Read GPIO
** \param[in] GPIOx - port to read from
** \param[in] GPIO_Pin - pin to read from
** \return Pin state
**/
GPIO_PinState NONNULL__ read_GPIO(GPIO_TypeDef * const GPIOx, const uint16_t GPIO_Pin);
/*!\brief Get name from Port, Pin
** \param[in,out] name - pointer to string for name
** \param[in] GPIOx - port
** \param[in] GPIO_Pin - pin
** \return Error code
**/
FctERR NONNULL__ str_GPIO_name(char * name, const GPIO_TypeDef * const GPIOx, const uint16_t GPIO_Pin);
/****************************************************************/
#ifdef __cplusplus
}
#endif
#endif /* defined(HAL_GPIO_MODULE_ENABLED) */
#endif /* __GPIO_EX_H */
/****************************************************************/