1 /*
2  * Copyright (c) 2023 ENE Technology Inc.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef ENE_KB1200_GPIO_H
8 #define ENE_KB1200_GPIO_H
9 
10 /**
11  *  Structure type to access General Purpose Input/Output (GPIO).
12  */
13 struct gpio_regs {
14 	volatile uint32_t GPIOFS; /*Function Selection Register */
15 	volatile uint32_t Reserved1[3];
16 	volatile uint32_t GPIOOE; /*Output Enable Register */
17 	volatile uint32_t Reserved2[3];
18 	volatile uint32_t GPIOD; /*Output Data Register */
19 	volatile uint32_t Reserved3[3];
20 	volatile uint32_t GPIOIN; /*Input Data Register */
21 	volatile uint32_t Reserved4[3];
22 	volatile uint32_t GPIOPU; /*Pull Up Register */
23 	volatile uint32_t Reserved5[3];
24 	volatile uint32_t GPIOOD; /*Open Drain Register */
25 	volatile uint32_t Reserved6[3];
26 	volatile uint32_t GPIOIE; /*Input Enable Register */
27 	volatile uint32_t Reserved7[3];
28 	volatile uint32_t GPIODC; /*Driving Control Register */
29 	volatile uint32_t Reserved8[3];
30 	volatile uint32_t GPIOLV; /*Low Voltage Mode Enable Register */
31 	volatile uint32_t Reserved9[3];
32 	volatile uint32_t GPIOPD; /*Pull Down Register */
33 	volatile uint32_t Reserved10[3];
34 	volatile uint32_t GPIOFL; /*Function Lock Register */
35 	volatile uint32_t Reserved11[3];
36 };
37 
38 #define NUM_KB1200_GPIO_PORTS 4
39 
40 /*-- Constant Define --------------------------------------------*/
41 #define GPIO00_PWMLED0_PWM8     0x00
42 #define GPIO01_SERRXD1_UARTSIN  0x01
43 #define GPIO03_SERTXD1_UARTSOUT 0x03
44 #define GPIO22_ESBDAT_PWM9      0x22
45 #define GPIO28_32KOUT_SERCLK2   0x28
46 #define GPIO36_UARTSOUT_SERTXD2 0x36
47 #define GPIO5C_KSO6_P80DAT      0x5C
48 #define GPIO5D_KSO7_P80CLK      0x5D
49 #define GPIO5E_KSO8_SERRXD1     0x5E
50 #define GPIO5F_KSO9_SERTXD1     0x5F
51 #define GPIO71_SDA8_UARTRTS     0x71
52 #define GPIO38_SCL4_PWM1        0x38
53 
54 
55 #endif /* ENE_KB1200_GPIO_H */
56