]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blobdiff - rpp/src/drv/_tms570_hydctr/port_def.c
Change target-specific pin and port definitions to match the new interface
[pes-rpp/rpp-lib.git] / rpp / src / drv / _tms570_hydctr / port_def.c
diff --git a/rpp/src/drv/_tms570_hydctr/port_def.c b/rpp/src/drv/_tms570_hydctr/port_def.c
new file mode 100644 (file)
index 0000000..a5e8012
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2015 Czech Technical University in Prague
+ *
+ * Authors:
+ *     - Michal Sojka <sojkam1@fel.cvut.cz>
+ *
+ * This document contains proprietary information belonging to Czech
+ * Technical University in Prague. Passing on and copying of this
+ * document, and communication of its contents is not permitted
+ * without prior written authorization.
+ *
+ */
+
+#include "drv/port.h"
+#include "drv/gio_names.h"
+#include "drv/gio_tab.h"
+#include "drv/adc.h"
+
+// Lists of pins assigned to the ports
+static enum pin_name pins_gioa[] = {
+               PIN_GIOA0, PIN_GIOA1, PIN_GIOA2, PIN_GIOA3,
+               PIN_GIOA4, PIN_GIOA5, PIN_GIOA6, PIN_GIOA7
+};
+static enum pin_name pins_giob[] = {
+               PIN_GIOB0, PIN_GIOB1, PIN_GIOB2, PIN_GIOB3,
+               PIN_GIOB4, PIN_GIOB5, PIN_GIOB6, PIN_GIOB7
+};
+static enum pin_name pins_nhet1[] = {
+               PIN_NHET10, PIN_NHET11, PIN_NHET12,
+               PIN_NHET13, PIN_NHET14, PIN_NHET15,
+               PIN_NHET17, PIN_NHET18, PIN_NHET19,
+               PIN_NHET110, PIN_NHET111, PIN_NHET112,
+               PIN_NHET114, PIN_NHET115, PIN_NHET116,
+               PIN_NHET117, PIN_NHET118, PIN_NHET119,
+               PIN_NHET120, PIN_NHET121, PIN_NHET122,
+               PIN_NHET123, PIN_NHET124, PIN_NHET125,
+               PIN_NHET126, PIN_NHET127, PIN_NHET128,
+               PIN_NHET129, PIN_NHET130, PIN_NHET131
+};
+
+// Port descriptors
+const struct port_desc port_desc[] = {
+       [PORT_ID_GIOA] = {
+               .name = "GIOA",
+               .cfg = { .gioset = { .pins = pins_gioa } },
+               .numchn = ARRAY_SIZE(pins_gioa),
+               .bpch = 1,
+               .get = port_gioset_get,
+               .set = port_gioset_set,
+       },
+       [PORT_ID_GIOB] = {
+               .name = "GIOB",
+               .cfg = { .gioset = { .pins = pins_giob } },
+               .numchn = ARRAY_SIZE(pins_giob),
+               .bpch = 1,
+               .get = port_gioset_get,
+               .set = port_gioset_set,
+       },
+       [PORT_ID_NHET1] = {
+               .name = "NHET1",
+               .cfg = { .gioset = { .pins = pins_nhet1 } },
+               .numchn = ARRAY_SIZE(pins_nhet1),
+               .bpch = 1,
+               .get = port_gioset_get,
+               .set = port_gioset_set,
+       },
+       [PORT_ID_ADC] = {
+               .name = "ADC",
+               .cfg = { .adc = { .reg = adcREG1, .group = adcGROUP1, .sem = 1 } },
+               .numchn = 16,
+               .bpch = 16,
+               .get = port_adc_get,
+               .set = NULL,
+       },
+};