1 /* Copyright (C) 2012-2013, 2015 Czech Technical University in Prague
4 * - Michal Horn <hornmich@fel.cvut.cz>
6 * This document contains proprietary information belonging to Czech
7 * Technical University in Prague. Passing on and copying of this
8 * document, and communication of its contents is not permitted
9 * without prior written authorization.
14 * This file contains general ports definitions. Ports are defined according to their names on
16 * Each port is define by port descriptor, which consists of:
17 * - list of its pin (pin descriptors),
19 * - get value function pointer,
20 * - set value function pointer.
21 * Finally each port descriptor is mapped to the port name string.
23 * Get and set value function are defined for each port style (ADC, SPI, GPIO) in separated files.
29 // Lists of pins assigned to the ports
30 static uint32_t port_cfg_dinmcu[] = PORT_CFG_DINMCU;
31 static uint32_t port_cfg_dinspi[] = PORT_CFG_DINSPI;
32 static uint32_t port_cfg_houtdiag[] = PORT_CFG_HOUTDIAG;
33 static uint32_t port_cfg_houtin[] = PORT_CFG_HOUTIN;
34 static uint32_t port_cfg_houtifbk[] = PORT_CFG_HOUTIFBK;
35 static uint32_t port_cfg_adc[] = PORT_CFG_ADC;
36 static uint32_t port_cfg_lout[] = PORT_CFG_LOUT;
37 static uint32_t port_cfg_dac1_2[] = PORT_CFG_DAC1_2;
38 static uint32_t port_cfg_dac3_4[] = PORT_CFG_DAC3_4;
39 static uint32_t port_cfg_dacdref[] = PORT_CFG_DACDREF;
40 static uint32_t port_cfg_hbr[] = PORT_CFG_HBR;
41 static uint32_t port_cfg_fray1[] = PORT_CFG_FRAY1;
42 static uint32_t port_cfg_fray2[] = PORT_CFG_FRAY2;
43 static uint32_t port_cfg_mouten[] = PORT_CFG_MOUTEN;
44 static uint32_t port_cfg_moutin[] = PORT_CFG_MOUTIN;
47 static port_desc_t port_desc_dinmcu = {
48 .config = port_cfg_dinmcu,
49 .numValues = PORT_NV_DINMCU,
50 .interfaceType = PORT_INT_TYPE_DINMCU,
51 .port_getfnc_ptr = PORT_GFC_DINMCU,
52 .port_setfnc_ptr = PORT_SFC_DINMCU,
55 static port_desc_t port_desc_dinspi = {
56 .config = port_cfg_dinspi,
57 .numValues = PORT_NV_DINSPI,
58 .interfaceType = PORT_INT_TYPE_DINSPI,
59 .port_getfnc_ptr = PORT_GFC_DINSPI,
60 .port_setfnc_ptr = PORT_SFC_DINSPI,
63 static port_desc_t port_desc_houtdiag = {
64 .config = port_cfg_houtdiag,
65 .numValues = PORT_NV_HOUTDIAG,
66 .interfaceType = PORT_INT_TYPE_HOUTDIAG,
67 .port_getfnc_ptr = PORT_GFC_HOUTDIAG,
68 .port_setfnc_ptr = PORT_SFC_HOUTDIAG,
71 static port_desc_t port_desc_houtin = {
72 .config = port_cfg_houtin,
73 .numValues = PORT_NV_HOUTIN,
74 .interfaceType = PORT_INT_TYPE_HOUTIN,
75 .port_getfnc_ptr = PORT_GFC_HOUTIN,
76 .port_setfnc_ptr = PORT_SFC_HOUTIN,
79 static port_desc_t port_desc_houtifbk = {
80 .config = port_cfg_houtifbk,
81 .numValues = PORT_NV_HOUTIFBK,
82 .interfaceType = PORT_INT_TYPE_HOUTIFBK,
83 .port_getfnc_ptr = PORT_GFC_HOUTIFBK,
84 .port_setfnc_ptr = PORT_SFC_HOUTIFBK,
87 static port_desc_t port_desc_adc = {
88 .config = port_cfg_adc,
89 .numValues = PORT_NV_ADC,
90 .interfaceType = PORT_INT_TYPE_ADC,
91 .port_getfnc_ptr = PORT_GFC_ADC,
92 .port_setfnc_ptr = PORT_SFC_ADC,
95 static port_desc_t port_desc_lout = {
96 .config = port_cfg_lout,
97 .numValues = PORT_NV_LOUT,
98 .interfaceType = PORT_INT_TYPE_LOUT,
99 .port_getfnc_ptr = PORT_GFC_LOUT,
100 .port_setfnc_ptr = PORT_SFC_LOUT,
103 static port_desc_t port_desc_dac1_2 = {
104 .config = port_cfg_dac1_2,
105 .numValues = PORT_NV_DAC1_2,
106 .interfaceType = PORT_INT_TYPE_DAC1_2,
107 .port_getfnc_ptr = PORT_GFC_DAC1_2,
108 .port_setfnc_ptr = PORT_SFC_DAC1_2,
111 static port_desc_t port_desc_dac3_4 = {
112 .config = port_cfg_dac3_4,
113 .numValues = PORT_NV_DAC3_4,
114 .interfaceType = PORT_INT_TYPE_DAC3_4,
115 .port_getfnc_ptr = PORT_GFC_DAC3_4,
116 .port_setfnc_ptr = PORT_SFC_DAC3_4,
119 static port_desc_t port_desc_dacdref = {
120 .config = port_cfg_dacdref,
121 .numValues = PORT_NV_DACDREF,
122 .interfaceType = PORT_INT_TYPE_DACDREF,
123 .port_getfnc_ptr = PORT_GFC_DACDREF,
124 .port_setfnc_ptr = PORT_SFC_DACDREF,
127 static port_desc_t port_desc_hbr = {
128 .config = port_cfg_hbr,
129 .numValues = PORT_NV_HBR,
130 .interfaceType = PORT_INT_TYPE_HBR,
131 .port_getfnc_ptr = PORT_GFC_HBR,
132 .port_setfnc_ptr = PORT_SFC_HBR,
135 static port_desc_t port_desc_fray1 = {
136 .config = port_cfg_fray1,
137 .numValues = PORT_NV_FRAY1,
138 .interfaceType = PORT_INT_TYPE_FRAY1,
139 .port_getfnc_ptr = PORT_GFC_FRAY1,
140 .port_setfnc_ptr = PORT_SFC_FRAY1,
143 static port_desc_t port_desc_fray2 = {
144 .config = port_cfg_fray2,
145 .numValues = PORT_NV_FRAY2,
146 .interfaceType = PORT_INT_TYPE_FRAY2,
147 .port_getfnc_ptr = PORT_GFC_FRAY2,
148 .port_setfnc_ptr = PORT_SFC_FRAY2,
151 static port_desc_t port_desc_mouten = {
152 .config = port_cfg_mouten,
153 .numValues = PORT_NV_MOUTEN,
154 .interfaceType = PORT_INT_TYPE_MOUTEN,
155 .port_getfnc_ptr = PORT_GFC_MOUTEN,
156 .port_setfnc_ptr = PORT_SFC_MOUTEN,
159 static port_desc_t port_desc_moutin = {
160 .config = port_cfg_moutin,
161 .numValues = PORT_NV_MOUTIN,
162 .interfaceType = PORT_INT_TYPE_MOUTIN,
163 .port_getfnc_ptr = PORT_GFC_MOUTIN,
164 .port_setfnc_ptr = PORT_SFC_MOUTIN,
167 // Maps of port names to port descriptors
168 port_def_t port_definition[PORT_CNT] = {
169 {.name = PORT_NAME_DINMCU, .desc = &port_desc_dinmcu},
170 {.name = PORT_NAME_DINSPI, .desc = &port_desc_dinspi},
171 {.name = PORT_NAME_HOUTDIAG, .desc = &port_desc_houtdiag},
172 {.name = PORT_NAME_HOUTIN, .desc = &port_desc_houtin},
173 {.name = PORT_NAME_HOUTIFBK, .desc = &port_desc_houtifbk},
174 {.name = PORT_NAME_ADC, .desc = &port_desc_adc},
175 {.name = PORT_NAME_LOUT, .desc = &port_desc_lout},
176 {.name = PORT_NAME_DAC1_2, .desc = &port_desc_dac1_2},
177 {.name = PORT_NAME_DAC3_4, .desc = &port_desc_dac3_4},
178 {.name = PORT_NAME_DACDREF, .desc = &port_desc_dacdref},
179 {.name = PORT_NAME_HBR, .desc = &port_desc_hbr},
180 {.name = PORT_NAME_FRAY1, .desc = &port_desc_fray1},
181 {.name = PORT_NAME_FRAY2, .desc = &port_desc_fray2},
182 {.name = PORT_NAME_MOUTEN, .desc = &port_desc_mouten},
183 {.name = PORT_NAME_MOUTIN, .desc = &port_desc_moutin}