aboutsummaryrefslogtreecommitdiffstats
path: root/tools/templates/board_gpio.tpl
diff options
context:
space:
mode:
authorFabien Poussin <fabien.poussin@gmail.com>2018-03-14 17:56:15 +0100
committerFabien Poussin <fabien.poussin@gmail.com>2018-03-14 17:56:15 +0100
commit1bfe2ef9f7f39d93174b1f62ac4b079aac2dea59 (patch)
tree76871a8a365496711a0c9e9661466000605b10d0 /tools/templates/board_gpio.tpl
parentecbe54cab7f0f3debf79c0fab10ccfbdf4d7d416 (diff)
downloadChibiOS-Contrib-1bfe2ef9f7f39d93174b1f62ac4b079aac2dea59.tar.gz
ChibiOS-Contrib-1bfe2ef9f7f39d93174b1f62ac4b079aac2dea59.tar.bz2
ChibiOS-Contrib-1bfe2ef9f7f39d93174b1f62ac4b079aac2dea59.zip
Adding script to update various config files automaticaly.
Diffstat (limited to 'tools/templates/board_gpio.tpl')
-rw-r--r--tools/templates/board_gpio.tpl55
1 files changed, 55 insertions, 0 deletions
diff --git a/tools/templates/board_gpio.tpl b/tools/templates/board_gpio.tpl
new file mode 100644
index 0000000..07a316d
--- /dev/null
+++ b/tools/templates/board_gpio.tpl
@@ -0,0 +1,55 @@
+#ifndef _BOARD_GPIO_H_
+#define _BOARD_GPIO_H_
+
+/* Generated by mx2board.py */
+
+{% for d, v in defines %}
+#define {{ d }} {{ v }}
+{%- endfor %}
+
+{% for p, v in ports %}
+/* PORT {{p}} */
+#define VAL_GPIO{{p}}_MODER ( \
+ {%- for i in v.MODER %}
+ {{ i }} | \
+ {%- endfor %}
+ 0)
+
+#define VAL_GPIO{{p}}_OTYPER ( \
+ {%- for i in v.OTYPER %}
+ {{ i }} | \
+ {%- endfor %}
+ 0)
+
+#define VAL_GPIO{{p}}_OSPEEDR ( \
+ {%- for i in v.OSPEEDR %}
+ {{ i }} | \
+ {%- endfor %}
+ 0)
+
+#define VAL_GPIO{{p}}_PUPDR ( \
+ {%- for i in v.PUPDR %}
+ {{ i }} | \
+ {%- endfor %}
+ 0)
+
+#define VAL_GPIO{{p}}_ODR ( \
+ {%- for i in v.ODR %}
+ {{ i }} | \
+ {%- endfor %}
+ 0)
+
+#define VAL_GPIO{{p}}_AFRL ( \
+ {%- for i in v.AFRL %}
+ {{ i }} | \
+ {%- endfor %}
+ 0)
+
+#define VAL_GPIO{{p}}_AFRH ( \
+ {%- for i in v.AFRH %}
+ {{ i }} | \
+ {%- endfor %}
+ 0)
+{% endfor %}
+
+#endif \ No newline at end of file