From f0fd24e7baeedb3f841cf59ac76928fa099cb115 Mon Sep 17 00:00:00 2001 From: Wojtek Siudzinski Date: Sun, 16 Feb 2020 16:10:12 +0100 Subject: [PATCH] Add Argon and Boron --- src/machine/board_particle_argon.go | 67 ++++++++++++++++++++++++++ src/machine/board_particle_boron.go | 73 +++++++++++++++++++++++++++++ src/machine/board_particle_xenon.go | 29 ++++++++---- targets/particle-3rd-gen.json | 6 +++ targets/particle-argon.json | 6 +++ targets/particle-boron.json | 6 +++ targets/particle-xenon.json | 2 +- 7 files changed, 180 insertions(+), 9 deletions(-) create mode 100644 src/machine/board_particle_argon.go create mode 100644 src/machine/board_particle_boron.go create mode 100644 targets/particle-3rd-gen.json create mode 100644 targets/particle-argon.json create mode 100644 targets/particle-boron.json diff --git a/src/machine/board_particle_argon.go b/src/machine/board_particle_argon.go new file mode 100644 index 00000000..bdefee68 --- /dev/null +++ b/src/machine/board_particle_argon.go @@ -0,0 +1,67 @@ +// +build particle_argon + +package machine + +const HasLowFrequencyCrystal = true + +// More info: https://docs.particle.io/datasheets/wi-fi/argon-datasheet/ +// Board diagram: https://docs.particle.io/assets/images/xenon/xenon-block-diagram.png + +// LEDs +const ( + LED Pin = 44 + LED_GREEN Pin = 14 + LED_RED Pin = 13 + LED_BLUE Pin = 15 +) + +// UART pins +const ( + UART_TX_PIN Pin = 6 + UART_RX_PIN Pin = 8 +) + +// I2C pins +const ( + SDA_PIN Pin = 26 + SCL_PIN Pin = 27 +) + +// SPI pins +const ( + SPI0_SCK_PIN Pin = 47 + SPI0_MOSI_PIN Pin = 45 + SPI0_MISO_PIN Pin = 46 +) + +// Internal 4MB SPI Flash +const ( + SPI1_SCK_PIN Pin = 19 + SPI1_MOSI_PIN Pin = 20 + SPI1_MISO_PIN Pin = 21 + SPI1_CS_PIN Pin = 17 + SPI1_WP_PIN Pin = 22 + SPI1_HOLD_PIN Pin = 23 +) + +// ESP32 coprocessor +const ( + ESP32_TXD_PIN Pin = 36 + ESP32_RXD_PIN Pin = 37 + ESP32_CTS_PIN Pin = 39 + ESP32_RTS_PIN Pin = 38 + ESP32_BOOT_MODE_PIN Pin = 16 + ESP32_WIFI_EN_PIN Pin = 24 + ESP32_HOST_WK_PIN Pin = 7 +) + +// Other periferals +const ( + MODE_BUTTON_PIN Pin = 11 + CHARGE_STATUS_PIN Pin = 41 + LIPO_VOLTAGE_PIN Pin = 5 + PCB_ANTENNA_PIN Pin = 2 + EXTERNAL_UFL_PIN Pin = 25 + NFC1_PIN Pin = 9 + NFC2_PIN Pin = 10 +) \ No newline at end of file diff --git a/src/machine/board_particle_boron.go b/src/machine/board_particle_boron.go new file mode 100644 index 00000000..099f6a42 --- /dev/null +++ b/src/machine/board_particle_boron.go @@ -0,0 +1,73 @@ +// +build particle_boron + +package machine + +const HasLowFrequencyCrystal = true + +// More info: https://docs.particle.io/datasheets/cellular/boron-datasheet/ +// Board diagram: https://docs.particle.io/assets/images/xenon/xenon-block-diagram.png + +// LEDs +const ( + LED Pin = 44 + LED_GREEN Pin = 14 + LED_RED Pin = 13 + LED_BLUE Pin = 15 +) + +// UART pins +const ( + UART_TX_PIN Pin = 6 + UART_RX_PIN Pin = 8 +) + +// I2C pins +const ( + SDA_PIN = 26 + SCL_PIN = 27 + + // Internal I2C with MAX17043 and BQ24195 chips on it + SDA1_PIN = 24 + SCL1_PIN = 41 + INT1_PIN = 5 +) + +// SPI pins +const ( + SPI0_SCK_PIN = 47 + SPI0_MOSI_PIN = 45 + SPI0_MISO_PIN = 46 +) + +// Internal 4MB SPI Flash +const ( + SPI1_SCK_PIN = 19 + SPI1_MOSI_PIN = 20 + SPI1_MISO_PIN = 21 + SPI1_CS_PIN = 17 + SPI1_WP_PIN = 22 + SPI1_HOLD_PIN = 23 +) + +// u-blox coprocessor +const ( + UBLOX_TXD_PIN = 37 + UBLOX_RXD_PIN = 36 + UBLOX_CTS_PIN = 38 + UBLOX_RTS_PIN = 39 + UBLOX_RESET_PIN = 16 + UBLOX_POWER_ON_PIN = 24 + UBLOX_BUFF_EN_PIN = 25 + UBLOX_VINT_PIN = 2 +) + +// Other periferals +const ( + MODE_BUTTON_PIN = 11 + CHARGE_STATUS_PIN = 41 + LIPO_VOLTAGE_PIN = 5 + PCB_ANTENNA_PIN = 2 + EXTERNAL_UFL_PIN = 25 + NFC1_PIN = 9 + NFC2_PIN = 10 +) \ No newline at end of file diff --git a/src/machine/board_particle_xenon.go b/src/machine/board_particle_xenon.go index 0fb7eab7..89c34a37 100644 --- a/src/machine/board_particle_xenon.go +++ b/src/machine/board_particle_xenon.go @@ -4,7 +4,10 @@ package machine const HasLowFrequencyCrystal = true -// LEDs on the XENON +// More info: https://docs.particle.io/datasheets/discontinued/xenon-datasheet/ +// Board diagram: https://docs.particle.io/assets/images/xenon/xenon-block-diagram.png + +// LEDs const ( LED Pin = 44 LED_GREEN Pin = 14 @@ -31,13 +34,23 @@ const ( SPI0_MISO_PIN = 46 ) +// Internal 4MB SPI Flash +const ( + SPI1_SCK_PIN = 19 + SPI1_MOSI_PIN = 20 + SPI1_MISO_PIN = 21 + SPI1_CS_PIN = 17 + SPI1_WP_PIN = 22 + SPI1_HOLD_PIN = 23 +) + // Other periferals const ( - MODE_BUTTON = 11 - CHARGE_STATUS = 41 - LIPO_VOLTAGE = 5 - PCB_ANTENNA = 24 - EXTERNAL_UFL = 25 - NFC1 = 9 - NFC2 = 10 + MODE_BUTTON_PIN = 11 + CHARGE_STATUS_PIN = 41 + LIPO_VOLTAGE_PIN = 5 + PCB_ANTENNA_PIN = 24 + EXTERNAL_UFL_PIN = 25 + NFC1_PIN = 9 + NFC2_PIN = 10 ) \ No newline at end of file diff --git a/targets/particle-3rd-gen.json b/targets/particle-3rd-gen.json new file mode 100644 index 00000000..2229319e --- /dev/null +++ b/targets/particle-3rd-gen.json @@ -0,0 +1,6 @@ +{ + "inherits": ["nrf52840"], + "build-tags": ["particle_3rd_gen"], + "flash-method": "openocd", + "openocd-interface": "cmsis-dap" +} diff --git a/targets/particle-argon.json b/targets/particle-argon.json new file mode 100644 index 00000000..4fafeb06 --- /dev/null +++ b/targets/particle-argon.json @@ -0,0 +1,6 @@ +{ + "inherits": ["particle-3rd-gen"], + "build-tags": ["particle_argon"], + "flash-method": "openocd", + "openocd-interface": "cmsis-dap" +} diff --git a/targets/particle-boron.json b/targets/particle-boron.json new file mode 100644 index 00000000..3d06d32d --- /dev/null +++ b/targets/particle-boron.json @@ -0,0 +1,6 @@ +{ + "inherits": ["particle-3rd-gen"], + "build-tags": ["particle_boron"], + "flash-method": "openocd", + "openocd-interface": "cmsis-dap" +} diff --git a/targets/particle-xenon.json b/targets/particle-xenon.json index e6566ae7..d787cebb 100644 --- a/targets/particle-xenon.json +++ b/targets/particle-xenon.json @@ -1,5 +1,5 @@ { - "inherits": ["nrf52840_mdk"], + "inherits": ["particle-3rd-gen"], "build-tags": ["particle_xenon"], "flash-method": "openocd", "openocd-interface": "cmsis-dap"