aboutsummaryrefslogtreecommitdiffstats
path: root/tools/board_gpio.tpl
blob: 07a316d4e5aece87c19a7a8a0ad6bb07c22de504 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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