From c27b8909dc425b4c06a12264de77877419a13497 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Mon, 19 Oct 2020 23:31:46 +0300 Subject: spi --- hid/platformio.ini | 170 ++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 130 insertions(+), 40 deletions(-) (limited to 'hid/platformio.ini') diff --git a/hid/platformio.ini b/hid/platformio.ini index c6c7c34b..1bf05d03 100644 --- a/hid/platformio.ini +++ b/hid/platformio.ini @@ -1,59 +1,149 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html - -[common] -lib_deps = - TimerOne@1.1 -build_flags = - -DCMD_SERIAL=Serial1 +# http://docs.platformio.org/page/projectconf.html +[platformio] +core_dir = ./.platformio/ -[env:usb] +[env] platform = atmelavr board = micro framework = arduino -upload_port = /dev/ttyACM0 +extra_scripts = + pre:avrdude.py + post:patch.py +platform_packages = + tool-avrdude + +[_parts_common] +lib_deps = + TimerOne@1.1 + +[_parts_usb_kbd] lib_deps = - ${common.lib_deps} HID-Project@2.6.1 build_flags = - ${common.build_flags} -DHID_USB_KBD + +[_parts_usb_mouse] +lib_deps = + HID-Project@2.6.1 +build_flags = -DHID_USB_MOUSE -extra_scripts = post:patch.py -[env:ps2] -platform = atmelavr -board = micro -framework = arduino -upload_port = /dev/ttyACM0 +[_parts_ps2_kbd] lib_deps = - ${common.lib_deps} git+https://github.com/Harvie/ps2dev#v0.0.3 build_flags = - ${common.build_flags} -DHID_PS2_KBD -DPS2_KBD_CLOCK_PIN=7 -DPS2_KBD_DATA_PIN=5 -[env:mixed] -platform = atmelavr -board = micro -framework = arduino -upload_port = /dev/ttyACM0 +[_usb] lib_deps = - ${common.lib_deps} - HID-Project@2.6.1 - git+https://github.com/Harvie/ps2dev#v0.0.3 + ${_parts_common.lib_deps} + ${_parts_usb_kbd.lib_deps} +# ${_parts_usb_mouse.lib_deps} build_flags = - ${common.build_flags} - -DHID_PS2_KBD - -DHID_USB_MOUSE - -DPS2_KBD_CLOCK_PIN=7 - -DPS2_KBD_DATA_PIN=5 + ${_parts_usb_kbd.build_flags} + ${_parts_usb_mouse.build_flags} + +[_ps2] +lib_deps = + ${_parts_common.lib_deps} + ${_parts_ps2_kbd.lib_deps} +build_flags = + ${_parts_ps2_kbd.build_flags} + +[_mixed] +lib_deps = + ${_parts_common.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 +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_SERIAL=Serial1 + -DCMD_SERIAL_SPEED=115200 +# -DCMD_SPI +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} -- cgit v1.2.3 From e07cdd60f393eb17184afe4ea1730f3c5745ea6f Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Tue, 3 Nov 2020 10:15:54 +0300 Subject: spi firmware --- hid/platformio.ini | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'hid/platformio.ini') diff --git a/hid/platformio.ini b/hid/platformio.ini index 1bf05d03..8b49e0e5 100644 --- a/hid/platformio.ini +++ b/hid/platformio.ini @@ -12,10 +12,6 @@ extra_scripts = platform_packages = tool-avrdude -[_parts_common] -lib_deps = - TimerOne@1.1 - [_parts_usb_kbd] lib_deps = HID-Project@2.6.1 @@ -38,7 +34,6 @@ build_flags = [_usb] lib_deps = - ${_parts_common.lib_deps} ${_parts_usb_kbd.lib_deps} # ${_parts_usb_mouse.lib_deps} build_flags = @@ -47,14 +42,12 @@ build_flags = [_ps2] lib_deps = - ${_parts_common.lib_deps} ${_parts_ps2_kbd.lib_deps} build_flags = ${_parts_ps2_kbd.build_flags} [_mixed] lib_deps = - ${_parts_common.lib_deps} ${_parts_ps2_kbd.lib_deps} ${_parts_usb_mouse.lib_deps} build_flags = @@ -107,9 +100,7 @@ extra_scripts = [_cmd_spi] build_flags = - -DCMD_SERIAL=Serial1 - -DCMD_SERIAL_SPEED=115200 -# -DCMD_SPI + -DCMD_SPI upload_protocol = custom upload_flags = -C -- cgit v1.2.3 From a8a075c203e2a458ff51ce0d4152ab09a4710d65 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Tue, 10 Nov 2020 13:38:55 +0300 Subject: another try --- hid/platformio.ini | 1 + 1 file changed, 1 insertion(+) (limited to 'hid/platformio.ini') diff --git a/hid/platformio.ini b/hid/platformio.ini index 8b49e0e5..3414d1d7 100644 --- a/hid/platformio.ini +++ b/hid/platformio.ini @@ -60,6 +60,7 @@ build_flags = build_flags = -DCMD_SERIAL=Serial1 -DCMD_SERIAL_SPEED=115200 + -DCMD_SERIAL_TIMEOUT=100000 upload_port = /dev/ttyACM0 [env:usb] -- cgit v1.2.3 From 55a682803965af9bc4712cb7485a706bd2b25832 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Wed, 11 Nov 2020 21:32:22 +0300 Subject: disable serial port for spi --- hid/platformio.ini | 1 + 1 file changed, 1 insertion(+) (limited to 'hid/platformio.ini') diff --git a/hid/platformio.ini b/hid/platformio.ini index 3414d1d7..a24c4aca 100644 --- a/hid/platformio.ini +++ b/hid/platformio.ini @@ -102,6 +102,7 @@ extra_scripts = [_cmd_spi] build_flags = -DCMD_SPI + -DNO_SERIAL upload_protocol = custom upload_flags = -C -- cgit v1.2.3