1 /**************************************************************************//**
2  * @file     lpgpio.h
3  * @version  V1.00
4  * @brief    LPGPIO driver header file
5  *
6  * SPDX-License-Identifier: Apache-2.0
7  * @copyright (C) 2023 Nuvoton Technology Corp. All rights reserved.
8  ******************************************************************************/
9 #ifndef __LPGPIO_H__
10 #define __LPGPIO_H__
11 
12 #ifdef __cplusplus
13 extern "C"
14 {
15 #endif
16 
17 /** @addtogroup Standard_Driver Standard Driver
18   @{
19 */
20 
21 /** @addtogroup LPGPIO_Driver LPGPIO Driver
22   @{
23 */
24 
25 /** @addtogroup LPGPIO_EXPORTED_CONSTANTS LPGPIO Exported Constants
26   @{
27 */
28 
29 #define LPGPIO_PIN_MAX          (8UL)   /*!< Specify Maximum Pins of Each LPGPIO Port \hideinitializer */
30 
31 /*------------------------------------------------------------------*/
32 /*  LPGPIO_MODE Constant Definitions                                */
33 /*------------------------------------------------------------------*/
34 #define LPGPIO_MODE_INPUT       (0x0UL) /*!< Input Mode \hideinitializer */
35 #define LPGPIO_MODE_OUTPUT      (0x1UL) /*!< Output Mode \hideinitializer */
36 
37 /*@}*/ /* end of group LPGPIO_EXPORTED_CONSTANTS */
38 
39 /** @addtogroup LPGPIO_EXPORTED_FUNCTIONS LPGPIO Exported Functions
40   @{
41 */
42 
43 /**
44  * @brief       Get LPGPIO Port IN Data
45  *
46  * @param[in]   port        LPGPIO port. It could be \ref LPGPIO.
47  *
48  * @return      The specified port data
49  *
50  * @details     Get the PIN register of specified LPGPIO port.
51  * \hideinitializer
52  */
53 #define LPGPIO_GET_IN_DATA(port)  ((port)->PIN)
54 
55 /**
56  * @brief       Set LPGPIO Port OUT Data
57  *
58  * @param[in]   port        LPGPIO port. It could be \ref LPGPIO.
59  * @param[in]   u32Data     LPGPIO port data.
60  *
61  * @return      None
62  *
63  * @details     Set the Data into specified LPGPIO port.
64  * \hideinitializer
65  */
66 #define LPGPIO_SET_OUT_DATA(port, u32Data)    ((port)->DOUT = (u32Data))
67 
68 void LPGPIO_SetMode(LPGPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode);
69 
70 /*@}*/ /* end of group LPGPIO_EXPORTED_FUNCTIONS */
71 
72 /*@}*/ /* end of group LPGPIO_Driver */
73 
74 /*@}*/ /* end of group Standard_Driver */
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 
80 #endif  /* __LPGPIO_H__ */
81 
82 /*** (C) COPYRIGHT 2023 Nuvoton Technology Corp. ***/
83