]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/T-HEAD_CB2201_CDK/csi/csi_driver/csky/hobbit3/include/pinmux.h
Introduce a port for T-HEAD CK802. A simple demo for T-HEAD CB2201 is also included.
[freertos] / FreeRTOS / Demo / T-HEAD_CB2201_CDK / csi / csi_driver / csky / hobbit3 / include / pinmux.h
1 /*
2  * Copyright (C) 2017 C-SKY Microsystems Co., Ltd. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *   http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /******************************************************************************
18  * @file     pinmux.h
19  * @brief    Header file for the pinmux
20  * @version  V1.0
21  * @date     02. June 2017
22  ******************************************************************************/
23 #ifndef HOBBIT_PINMUX_H
24 #define HOBBIT_PINMUX_H
25
26 #include <stdint.h>
27 #include "pin_name.h"
28
29 void hobbit_ioreuse_initial(void);
30 int32_t pin_mux(pin_name_t pin, uint16_t function);
31
32 /*IOMUX0L function definition */
33
34
35 /* IOMUX0H function definition */
36 #define PA20_UART1_RX     0x00000000
37 #define PA21_UART1_TX     0x00000000
38
39
40 /* IOMUX1L function definition */
41
42 /* flag as identification */
43 #define GPIO_SET_BIT0  0x00000001
44 #define GPIO_SET_BIT1  0x00000002
45 #define GPIO_SET_BIT2  0x00000004
46 #define GPIO_SET_BIT3  0x00000008
47 #define GPIO_SET_BIT4  0x00000010
48 #define GPIO_SET_BIT5  0x00000020
49 #define GPIO_SET_BIT6  0x00000040
50 #define GPIO_SET_BIT7  0x00000080
51 #define GPIO_SET_BIT8  0x00000100
52 #define GPIO_SET_BIT9  0x00000200
53 #define GPIO_SET_BIT10 0x00000400
54 #define GPIO_SET_BIT11 0x00000800
55 #define GPIO_SET_BIT12 0x00001000
56 #define GPIO_SET_BIT13 0x00002000
57 #define GPIO_SET_BIT14 0x00004000
58 #define GPIO_SET_BIT15 0x00008000
59 #define GPIO_SET_BIT16 0x00010000
60 #define GPIO_SET_BIT17 0x00020000
61 #define GPIO_SET_BIT18 0x00040000
62 #define GPIO_SET_BIT19 0x00080000
63 #define GPIO_SET_BIT20 0x00100000
64 #define GPIO_SET_BIT21 0x00200000
65 #define GPIO_SET_BIT22 0x00400000
66 #define GPIO_SET_BIT23 0x00800000
67 #define GPIO_SET_BIT24 0x01000000
68 #define GPIO_SET_BIT25 0x02000000
69 #define GPIO_SET_BIT26 0x04000000
70 #define GPIO_SET_BIT27 0x08000000
71 #define GPIO_SET_BIT28 0x10000000
72 #define GPIO_SET_BIT29 0x20000000
73 #define GPIO_SET_BIT30 0x40000000
74 #define GPIO_SET_BIT31 0x80000000
75
76 /******************************************************************************
77  * hobbit gpio control and gpio reuse function
78  * selecting regester adddress
79  ******************************************************************************/
80
81 #define HOBBIT_GIPO0_PORTCTL_REG 0x60030000
82 #define HOBBIT_GIPO1_PORTCTL_REG 0x60030004
83 #define HOBBIT_IOMUX0L_REG       0x60030008
84 #define HOBBIT_IOMUX0H_REG       0x6003000C
85 #define HOBBIT_IOMUX1L_REG       0x60030010
86
87
88 /*************basic gpio reuse v1.0********************************************
89  * UART1(PA20,PA21)
90  ******************************************************************************/
91 #define GPIO0_REUSE_EN                (GPIO_SET_BIT20|GPIO_SET_BIT21)
92 #define GPIO1_REUSE_EN                (0x00000000)
93 #define IOMUX0L_FUNCTION_SEL          (0x00000000)
94 #define IOMUX0H_FUNCTION_SEL          (PA20_UART1_RX|PA21_UART1_TX)
95 #define IOMUX1L_FUNCTION_SEL          (0x00000000)
96
97
98 #endif /* HOBBIT_PINMUX_H */
99