]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blob - rpp/src/drv/_tms570_hdk/port_def.c
d7adfe16d26604270c8fc7ec4f62928a899f9b56
[pes-rpp/rpp-lib.git] / rpp / src / drv / _tms570_hdk / port_def.c
1 /*
2  * Copyright (C) 2015 Czech Technical University in Prague
3  *
4  * Authors:
5  *     - Michal Sojka <sojkam1@fel.cvut.cz>
6  *
7  * This document contains proprietary information belonging to Czech
8  * Technical University in Prague. Passing on and copying of this
9  * document, and communication of its contents is not permitted
10  * without prior written authorization.
11  *
12  */
13
14 #include "drv/port.h"
15 #include "drv/gio_names.h"
16 #include "drv/gio_tab.h"
17 #include "drv/adc.h"
18
19 // Lists of pins assigned to the ports
20 static enum pin_name pins_gioa[] = {
21                 PIN_GIOA0, PIN_GIOA1, PIN_GIOA2, PIN_GIOA3,
22                 PIN_GIOA4, PIN_GIOA5, PIN_GIOA6, PIN_GIOA7
23 };
24 static enum pin_name pins_giob[] = {
25                 PIN_GIOB0, PIN_GIOB1, PIN_GIOB2, PIN_GIOB3,
26                 PIN_GIOB4, PIN_GIOB5, PIN_GIOB6, PIN_GIOB7
27 };
28 static enum pin_name pins_nhet1[] = {
29                 PIN_NHET10, PIN_NHET11, PIN_NHET12,
30                 PIN_NHET13, PIN_NHET14, PIN_NHET15,
31                 PIN_NHET17, PIN_NHET18, PIN_NHET19,
32                 PIN_NHET110, PIN_NHET111, PIN_NHET112,
33                 PIN_NHET114, PIN_NHET115, PIN_NHET116,
34                 PIN_NHET117, PIN_NHET118, PIN_NHET119,
35                 PIN_NHET120, PIN_NHET121, PIN_NHET122,
36                 PIN_NHET123, PIN_NHET124, PIN_NHET125,
37                 PIN_NHET126, PIN_NHET127, PIN_NHET128,
38                 PIN_NHET129, PIN_NHET130, PIN_NHET131
39 };
40
41 // Port descriptors
42 const struct port_desc port_desc[] = {
43         [PORT_ID_GIOA] = {
44                 .name = "GIOA",
45                 .cfg = { .gioset = { .pins = pins_gioa } },
46                 .numchn = ARRAY_SIZE(pins_gioa),
47                 .bpch = 1,
48                 .get = port_gioset_get,
49                 .set = port_gioset_set,
50         },
51         [PORT_ID_GIOB] = {
52                 .name = "GIOB",
53                 .cfg = { .gioset = { .pins = pins_giob } },
54                 .numchn = ARRAY_SIZE(pins_giob),
55                 .bpch = 1,
56                 .get = port_gioset_get,
57                 .set = port_gioset_set,
58         },
59         [PORT_ID_NHET1] = {
60                 .name = "NHET1",
61                 .cfg = { .gioset = { .pins = pins_nhet1 } },
62                 .numchn = ARRAY_SIZE(pins_nhet1),
63                 .bpch = 1,
64                 .get = port_gioset_get,
65                 .set = port_gioset_set,
66         },
67         [PORT_ID_ADC] = {
68                 .name = "ADC",
69                 .cfg = { .adc = { .reg = adcREG1, .group = adcGROUP1 } },
70                 .numchn = PORT_ADC_CHANNELS,
71                 .bpch = 16,
72                 .get = port_adc_get,
73                 .set = NULL,
74         },
75 };