summaryrefslogtreecommitdiff
path: root/hid/platformio.ini
blob: a24c4acae5c9d553042ef5c526787eae680a0f31 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# http://docs.platformio.org/page/projectconf.html
[platformio]
core_dir = ./.platformio/

[env]
platform = atmelavr
board = micro
framework = arduino
extra_scripts =
	pre:avrdude.py
	post:patch.py
platform_packages =
	tool-avrdude

[_parts_usb_kbd]
lib_deps =
	[email protected]
build_flags =
	-DHID_USB_KBD

[_parts_usb_mouse]
lib_deps =
	[email protected]
build_flags =
	-DHID_USB_MOUSE

[_parts_ps2_kbd]
lib_deps =
	git+https://github.com/Harvie/ps2dev#v0.0.3
build_flags =
	-DHID_PS2_KBD
	-DPS2_KBD_CLOCK_PIN=7
	-DPS2_KBD_DATA_PIN=5

[_usb]
lib_deps =
	${_parts_usb_kbd.lib_deps}
#	${_parts_usb_mouse.lib_deps}
build_flags =
	${_parts_usb_kbd.build_flags}
	${_parts_usb_mouse.build_flags}

[_ps2]
lib_deps =
	${_parts_ps2_kbd.lib_deps}
build_flags =
	${_parts_ps2_kbd.build_flags}

[_mixed]
lib_deps =
	${_parts_ps2_kbd.lib_deps}
	${_parts_usb_mouse.lib_deps}
build_flags =
	${_parts_ps2_kbd.build_flags}
	${_parts_usb_mouse.build_flags}


# ===== Serial =====
[_cmd_serial]
build_flags =
	-DCMD_SERIAL=Serial1
	-DCMD_SERIAL_SPEED=115200
	-DCMD_SERIAL_TIMEOUT=100000
upload_port = /dev/ttyACM0

[env:usb]
extends =
	_usb
	_cmd_serial
build_flags =
	${_usb.build_flags}
	${_cmd_serial.build_flags}

[env:ps2]
extends =
	_ps2
	_cmd_serial
build_flags =
	${_ps2.build_flags}
	${_cmd_serial.build_flags}

[env:mixed]
extends =
	_mixed
	_cmd_serial
build_flags =
	${_mixed.build_flags}
	${_cmd_serial.build_flags}


# ===== RPi SPI =====
[env:bootloader_spi]
upload_protocol = rpi
upload_flags =
	-C
	+avrdude-rpi.conf
	-P
	/dev/spidev0.0:/dev/gpiochip0
extra_scripts =
	pre:avrdude.py

[_cmd_spi]
build_flags =
	-DCMD_SPI
	-DNO_SERIAL
upload_protocol = custom
upload_flags =
	-C
	$PROJECT_PACKAGES_DIR/tool-avrdude/avrdude.conf
	-C
	+avrdude-rpi.conf
	-P
	/dev/spidev0.0:/dev/gpiochip0
	-c
	rpi
	-p
	$BOARD_MCU
upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i

[env:usb_spi]
extends =
	_usb
	_cmd_spi
build_flags =
	${_usb.build_flags}
	${_cmd_spi.build_flags}

[env:ps2_spi]
extends =
	_ps2
	_cmd_spi
build_flags =
	${_ps2.build_flags}
	${_cmd_spi.build_flags}

[env:mixed_spi]
extends =
	_mixed
	_cmd_spi
build_flags =
	${_mixed.build_flags}
	${_cmd_spi.build_flags}