diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..4df910ee --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,25 @@ +# Agent Instructions + +## Style +- Follow the repo `.clang-format` when making changes. + +## Build / Verify +- Prefer CMake for testing/verification. +- Always build both boards during verification: + - `feather_nrf52832` + - `feather_nrf52840_express` + +### CMake (preferred) +```bash +cmake -S . -B cmake-build-feather_nrf52832 -DBOARD=feather_nrf52832 +cmake --build cmake-build-feather_nrf52832 + +cmake -S . -B cmake-build-feather_nrf52840_express -DBOARD=feather_nrf52840_express +cmake --build cmake-build-feather_nrf52840_express +``` + +### Make (alternate) +```bash +make BOARD=feather_nrf52832 all +make BOARD=feather_nrf52840_express all +``` diff --git a/README.md b/README.md index 8d16b37b..e66eb64b 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,8 @@ Officially supported boards are: - Adafruit Metro nRF52840 Express - [Raytac MDBT50Q-RX Dongle](https://www.adafruit.com/product/5199) -In addition, there is also lots of other 3rd-party boards which are added by other makers, users and community. Check out the [complete list of all boards here](/src/boards). +In addition, there is also lots of other 3rd-party boards which are added by other makers, users and community. Check +out the [complete list of all boards here](/supported_boards.md). ## Features diff --git a/src/boards/adm_b_nrf52840_1/board.h b/src/boards/adm_b_nrf52840_1/board.h index 49ea04bf..34dfa54f 100644 --- a/src/boards/adm_b_nrf52840_1/board.h +++ b/src/boards/adm_b_nrf52840_1/board.h @@ -25,43 +25,40 @@ #ifndef ADM_B_NRF52840_1_H #define ADM_B_NRF52840_1_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(0, 19) // Red -//#define LED_SECONDARY_PIN 12 // Blue -#define LED_STATE_ON 0 +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(0, 19) // Red +// #define LED_SECONDARY_PIN 12 // Blue +#define LED_STATE_ON 0 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(0, 11) -#define BUTTON_2 _PINNUM(0, 12) +#define BUTTON_DFU PINNUM(0, 11) +#define BUTTON_DFU_OTA PINNUM(0, 12) #define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Atelier-Du-Maker" -#define BLEDIS_MODEL "ADM_B_NRF52840_1" +#define BLEDIS_MANUFACTURER "Atelier-Du-Maker" +#define BLEDIS_MODEL "ADM_B_NRF52840_1" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x009F -#define USB_DESC_CDC_ONLY_PID 0x009F +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x009F +#define USB_DESC_CDC_ONLY_PID 0x009F //------------- UF2 -------------// -#define UF2_PRODUCT_NAME "AtelierDuMaker NRF52840 Breakout" -#define UF2_VOLUME_LABEL "ADM840BOOT" -#define UF2_BOARD_ID "ADM_B_NRF52840_1" -#define UF2_INDEX_URL "https://github.com/Atelier-Du-Maker/HolyIoT_NRF52840" +#define UF2_PRODUCT_NAME "AtelierDuMaker NRF52840 Breakout" +#define UF2_VOLUME_LABEL "ADM840BOOT" +#define UF2_BOARD_ID "ADM_B_NRF52840_1" +#define UF2_INDEX_URL "https://github.com/Atelier-Du-Maker/HolyIoT_NRF52840" #endif // ADM_B_NRF52840_1_H diff --git a/src/boards/ae_bl652_bo/board.h b/src/boards/ae_bl652_bo/board.h index c4b78dbd..77232d89 100644 --- a/src/boards/ae_bl652_bo/board.h +++ b/src/boards/ae_bl652_bo/board.h @@ -28,27 +28,26 @@ /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 2 -#define LED_PRIMARY_PIN 17 // LED1 -#define LED_SECONDARY_PIN 19 // LED2 -#define LED_STATE_ON 1 +#define LEDS_NUMBER 2 +#define LED_PRIMARY_PIN 17 // LED1 +#define LED_SECONDARY_PIN 19 // LED2 +#define LED_STATE_ON 1 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 11 // BTN1 -#define BUTTON_2 15 // BTN2 -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU 11 // BTN1 +#define BUTTON_DFU_OTA 15 // BTN2 +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP /*------------------------------------------------------------------*/ /* UART (only used by nRF52832) *------------------------------------------------------------------*/ -#define RX_PIN_NUMBER 8 -#define TX_PIN_NUMBER 6 -#define CTS_PIN_NUMBER 0 -#define RTS_PIN_NUMBER 0 -#define HWFC false +#define RX_PIN_NUMBER 8 +#define TX_PIN_NUMBER 6 +#define CTS_PIN_NUMBER 0 +#define RTS_PIN_NUMBER 0 +#define HWFC false //--------------------------------------------------------------------+ // BLE OTA diff --git a/src/boards/aramcon2_badge/board.h b/src/boards/aramcon2_badge/board.h index f651915f..cf61be98 100644 --- a/src/boards/aramcon2_badge/board.h +++ b/src/boards/aramcon2_badge/board.h @@ -25,41 +25,38 @@ #ifndef _ARAMCON2_BADGE_H #define _ARAMCON2_BADGE_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(1, 11) // Red +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(1, 11) // Red -#define LED_NEOPIXEL _PINNUM(0, 8) -#define NEOPIXELS_NUMBER 2 -#define BOARD_RGB_BRIGHTNESS 0x040404 +#define LED_NEOPIXEL PINNUM(0, 8) +#define NEOPIXELS_NUMBER 2 +#define BOARD_RGB_BRIGHTNESS 0x040404 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(0, 2) // left Button -#define BUTTON_2 _PINNUM(0, 29) // middle button -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(0, 2) // left Button +#define BUTTON_DFU_OTA PINNUM(0, 29) // middle button +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP // Used as model string in OTA mode -#define BLEDIS_MANUFACTURER "ARAMCON Badge Team" -#define BLEDIS_MODEL "ARAMCON2 Badge" +#define BLEDIS_MANUFACTURER "ARAMCON Badge Team" +#define BLEDIS_MODEL "ARAMCON2 Badge" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x007B -#define USB_DESC_CDC_ONLY_PID 0x007B +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x007B +#define USB_DESC_CDC_ONLY_PID 0x007B //------------- UF2 -------------// -#define UF2_PRODUCT_NAME "ARAMCON2 Badge" -#define UF2_VOLUME_LABEL "ARAMBOOT" -#define UF2_BOARD_ID "nrf52840-ARAMCON2-Badge" -#define UF2_INDEX_URL "https://github.com/aramcon-badge" +#define UF2_PRODUCT_NAME "ARAMCON2 Badge" +#define UF2_VOLUME_LABEL "ARAMBOOT" +#define UF2_BOARD_ID "nrf52840-ARAMCON2-Badge" +#define UF2_INDEX_URL "https://github.com/aramcon-badge" #endif // _ARAMCON2_BADGE_H diff --git a/src/boards/aramcon_badge_2019/board.h b/src/boards/aramcon_badge_2019/board.h index 3dc666d0..b81fdbd9 100644 --- a/src/boards/aramcon_badge_2019/board.h +++ b/src/boards/aramcon_badge_2019/board.h @@ -26,43 +26,40 @@ #ifndef _ARAMCON_BADGE_2019_H #define _ARAMCON_BADGE_2019_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(1, 11) // Red +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(1, 11) // Red -#define LED_NEOPIXEL _PINNUM(0, 8) -#define NEOPIXELS_NUMBER 4 -#define BOARD_RGB_BRIGHTNESS 0x040404 +#define LED_NEOPIXEL PINNUM(0, 8) +#define NEOPIXELS_NUMBER 4 +#define BOARD_RGB_BRIGHTNESS 0x040404 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(0, 2) // left Button -#define BUTTON_2 _PINNUM(0, 29) // middle button -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(0, 2) // left Button +#define BUTTON_DFU_OTA PINNUM(0, 29) // middle button +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "ARAMCON Badge Team" -#define BLEDIS_MODEL "ARAMCON Badge 2019" +#define BLEDIS_MANUFACTURER "ARAMCON Badge Team" +#define BLEDIS_MODEL "ARAMCON Badge 2019" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x0079 -#define USB_DESC_CDC_ONLY_PID 0x0079 +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x0079 +#define USB_DESC_CDC_ONLY_PID 0x0079 //------------- UF2 -------------// -#define UF2_PRODUCT_NAME "ARAMCON Badge 2019" -#define UF2_VOLUME_LABEL "ARAMBOOT" -#define UF2_BOARD_ID "nrf52840-ARAMCON-Badge-2019" -#define UF2_INDEX_URL "https://github.com/aramcon-badge" +#define UF2_PRODUCT_NAME "ARAMCON Badge 2019" +#define UF2_VOLUME_LABEL "ARAMBOOT" +#define UF2_BOARD_ID "nrf52840-ARAMCON-Badge-2019" +#define UF2_INDEX_URL "https://github.com/aramcon-badge" #endif // _ARAMCON_BADGE_2019_H diff --git a/src/boards/arcade_feather_nrf52840_express/board.cmake b/src/boards/arcade_feather_nrf52840_express/board.cmake deleted file mode 100644 index 25daf71d..00000000 --- a/src/boards/arcade_feather_nrf52840_express/board.cmake +++ /dev/null @@ -1 +0,0 @@ -set(MCU_VARIANT nrf52840) diff --git a/src/boards/arcade_feather_nrf52840_express/board.h b/src/boards/arcade_feather_nrf52840_express/board.h deleted file mode 100644 index aed04edb..00000000 --- a/src/boards/arcade_feather_nrf52840_express/board.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2018 Ha Thach for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef _ARCARDE_FEATHER_NRF52840_H -#define _ARCARDE_FEATHER_NRF52840_H - -#define _PINNUM(port, pin) ((port)*32 + (pin)) - -/*------------------------------------------------------------------*/ -/* LED - *------------------------------------------------------------------*/ -#define LEDS_NUMBER 2 -#define LED_PRIMARY_PIN _PINNUM(1, 15) -#define LED_SECONDARY_PIN _PINNUM(1, 10) -#define LED_STATE_ON 1 - -#define LED_NEOPIXEL _PINNUM(0, 16) -#define NEOPIXELS_NUMBER 1 -#define BOARD_RGB_BRIGHTNESS 0x040404 - -/*------------------------------------------------------------------*/ -/* BUTTON - *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(1, 02) -#define BUTTON_2 _PINNUM(0, 10) -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP - -//--------------------------------------------------------------------+ -// BLE OTA -//--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Adafruit Industries" -#define BLEDIS_MODEL "Feather nRF52840 Express" - -//--------------------------------------------------------------------+ -// USB -//--------------------------------------------------------------------+ -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x0029 -#define USB_DESC_CDC_ONLY_PID 0x002A - -//------------- UF2 -------------// -#define UF2_PRODUCT_NAME "Adafruit Feather nRF52840 Express" -#define UF2_VOLUME_LABEL "ARCADE-N4" -#define UF2_BOARD_ID "nRF52840-Feather-revD" -#define UF2_INDEX_URL "https://www.adafruit.com/product/4062" - -#endif // _ARCARDE_FEATHER_NRF52840_H - diff --git a/src/boards/arcade_feather_nrf52840_express/board.mk b/src/boards/arcade_feather_nrf52840_express/board.mk deleted file mode 100644 index 9d29ac69..00000000 --- a/src/boards/arcade_feather_nrf52840_express/board.mk +++ /dev/null @@ -1 +0,0 @@ -MCU_SUB_VARIANT = nrf52840 diff --git a/src/boards/arcade_feather_nrf52840_express/pinconfig.c b/src/boards/arcade_feather_nrf52840_express/pinconfig.c deleted file mode 100644 index 5424d86e..00000000 --- a/src/boards/arcade_feather_nrf52840_express/pinconfig.c +++ /dev/null @@ -1,62 +0,0 @@ -#include "boards.h" - -__attribute__((used, section(".bootloaderConfig"))) -const uint32_t bootloaderConfig[] = { - /* CF2 START */ - 513675505, 539130489, // magic - 49, 100, // used entries, total entries - 4, 0x18, // PIN_BTN_A = PIN_RX - 5, 0xa, // PIN_BTN_B = PIN_D2 - 13, 0x29, // PIN_LED = PIN_D13 - 18, 0xf, // PIN_MISO = PA15 - 19, 0xd, // PIN_MOSI = PA13 - 20, 0x23, // PIN_NEOPIXEL = PB03 - 21, 0x18, // PIN_RX = PA24 - 23, 0xe, // PIN_SCK = PA14 - 24, 0xb, // PIN_SCL = PA11 - 25, 0xc, // PIN_SDA = PA12 - 28, 0x19, // PIN_TX = PA25 - 32, 0xe, // PIN_DISPLAY_SCK = PIN_SCK - 34, 0xd, // PIN_DISPLAY_MOSI = PIN_MOSI - 35, 0x1e, // PIN_DISPLAY_CS = PIN_A2 - 36, 0x1c, // PIN_DISPLAY_DC = PIN_A3 - 37, 0xa0, // DISPLAY_WIDTH = 160 - 38, 0x80, // DISPLAY_HEIGHT = 128 - 39, 0x80, // DISPLAY_CFG0 = 0x80 - 40, 0x603, // DISPLAY_CFG1 = 0x603 - 41, 0x20, // DISPLAY_CFG2 = 0x20 - 43, 0x2, // PIN_DISPLAY_RST = PIN_A4 - 44, 0x3, // PIN_DISPLAY_BL = PIN_A5 - 47, 0x6, // PIN_BTN_LEFT = PIN_D11 - 48, 0x1a, // PIN_BTN_RIGHT = PIN_D9 - 49, 0x1b, // PIN_BTN_UP = PIN_D10 - 50, 0x7, // PIN_BTN_DOWN = PIN_D6 - 51, 0x8, // PIN_BTN_MENU = PIN_D12 - 56, 0x2a, // PIN_LED2 = PB10 - 60, 0x19, // PIN_JACK_TX = PIN_TX - 100, 0x4, // PIN_A0 = PA04 - 101, 0x5, // PIN_A1 = PA05 - 102, 0x1e, // PIN_A2 = PA30 - 103, 0x1c, // PIN_A3 = PA28 - 104, 0x2, // PIN_A4 = PA02 - 105, 0x3, // PIN_A5 = PA03 - 152, 0xa, // PIN_D2 = PA10 - 155, 0x28, // PIN_D5 = PB08 - 156, 0x7, // PIN_D6 = PA07 - 159, 0x1a, // PIN_D9 = PA26 - 160, 0x1b, // PIN_D10 = PA27 - 161, 0x6, // PIN_D11 = PA06 - 162, 0x8, // PIN_D12 = PA08 - 163, 0x29, // PIN_D13 = PB09 - 200, 0x1, // NUM_NEOPIXELS = 1 - 204, 0x100000, // FLASH_BYTES = 0x100000 - 205, 0x40000, // RAM_BYTES = 0x40000 - 208, 0xd7688ea1, // BOOTLOADER_BOARD_ID = 0xd7688ea1 - 209, 0xada52840, // UF2_FAMILY = 0xada52840 - 210, 0x20, // PINS_PORT_SIZE = PA_32 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - /* CF2 END */ -}; diff --git a/src/boards/arduino_nano_33_ble/board.h b/src/boards/arduino_nano_33_ble/board.h index 00fb2ef3..79e32fce 100644 --- a/src/boards/arduino_nano_33_ble/board.h +++ b/src/boards/arduino_nano_33_ble/board.h @@ -25,40 +25,37 @@ #ifndef _ARDUINOBLE33_NRF52840_H #define _ARDUINOBLE33_NRF52840_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 // red LED -#define LED_PRIMARY_PIN _PINNUM(0, 24) -#define LED_STATE_ON 0 +#define LEDS_NUMBER 1 // red LED +#define LED_PRIMARY_PIN PINNUM(0, 24) +#define LED_STATE_ON 0 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(1, 11) // D2 switch -#define BUTTON_2 _PINNUM(1, 12) // D3 switch -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(1, 11) // D2 switch +#define BUTTON_DFU_OTA PINNUM(1, 12) // D3 switch +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Arduino" -#define BLEDIS_MODEL "Nano 33 BLE" +#define BLEDIS_MANUFACTURER "Arduino" +#define BLEDIS_MODEL "Nano 33 BLE" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x0063 -#define USB_DESC_CDC_ONLY_PID 0x0064 +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x0063 +#define USB_DESC_CDC_ONLY_PID 0x0064 //------------- UF2 -------------// -#define UF2_PRODUCT_NAME "Arduino Nano 33 BLE" -#define UF2_VOLUME_LABEL "NANO33BOOT" -#define UF2_BOARD_ID "nRF52840-Nano-33" -#define UF2_INDEX_URL "https://www.arduino.cc/" +#define UF2_PRODUCT_NAME "Arduino Nano 33 BLE" +#define UF2_VOLUME_LABEL "NANO33BOOT" +#define UF2_BOARD_ID "nRF52840-Nano-33" +#define UF2_INDEX_URL "https://www.arduino.cc/" #endif // _ITSY_NRF52840_H diff --git a/src/boards/bast_ble/board.h b/src/boards/bast_ble/board.h index fb6e8cb5..68a1ea76 100644 --- a/src/boards/bast_ble/board.h +++ b/src/boards/bast_ble/board.h @@ -25,40 +25,38 @@ #ifndef _BASTBLE_NRF52840_H #define _BASTBLE_NRF52840_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 // red LED -#define LED_PRIMARY_PIN _PINNUM(0, 24) -#define LED_STATE_ON 0 +#define LEDS_NUMBER 1 // red LED +#define LED_PRIMARY_PIN PINNUM(0, 24) +#define LED_STATE_ON 0 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(0, 05) -#define BUTTON_2 _PINNUM(0, 10) -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(0, 05) +#define BUTTON_DFU_OTA PINNUM(0, 10) +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "ElectronicCats" -#define BLEDIS_MODEL "BastBLE" +#define BLEDIS_MANUFACTURER "ElectronicCats" +#define BLEDIS_MODEL "BastBLE" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ // Shared VID/PID with Feather nRF52840, will be disabled for building in the future -#define USB_DESC_VID 0x1209 -#define USB_DESC_UF2_PID 0x805A -#define USB_DESC_CDC_ONLY_PID 0x805A - -#define UF2_PRODUCT_NAME "Bast BLE" -#define UF2_VOLUME_LABEL "BASTBLE" -#define UF2_BOARD_ID "Bast-ble-v1" -#define UF2_INDEX_URL "https://www.electroniccats.com" +#define USB_DESC_VID 0x1209 +#define USB_DESC_UF2_PID 0x805A +#define USB_DESC_CDC_ONLY_PID 0x805A + +#define UF2_PRODUCT_NAME "Bast BLE" +#define UF2_VOLUME_LABEL "BASTBLE" +#define UF2_BOARD_ID "Bast-ble-v1" +#define UF2_INDEX_URL "https://www.electroniccats.com" #endif // _BASTBLE_NRF52840_H diff --git a/src/boards/bluemicro_nrf52833/board.h b/src/boards/bluemicro_nrf52833/board.h index 9b647c38..454d3409 100644 --- a/src/boards/bluemicro_nrf52833/board.h +++ b/src/boards/bluemicro_nrf52833/board.h @@ -25,45 +25,42 @@ #ifndef _BLUEMICRO_NRF52833_H #define _BLUEMICRO_NRF52833_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 2 -#define LED_PRIMARY_PIN _PINNUM(1, 4) -#define LED_SECONDARY_PIN _PINNUM(0, 25) -#define LED_STATE_ON 1 +#define LEDS_NUMBER 2 +#define LED_PRIMARY_PIN PINNUM(1, 4) +#define LED_SECONDARY_PIN PINNUM(0, 25) +#define LED_STATE_ON 1 -#define LED_NEOPIXEL _PINNUM(0, 7) -#define NEOPIXELS_NUMBER 1 -#define BOARD_RGB_BRIGHTNESS 0x040404 +#define LED_NEOPIXEL PINNUM(0, 7) +#define NEOPIXELS_NUMBER 1 +#define BOARD_RGB_BRIGHTNESS 0x040404 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 // none connected at all -#define BUTTON_1 _PINNUM(0, 18) // unusable: RESET -#define BUTTON_2 _PINNUM(1, 1) // no connection on E73-2G4M08S1E Module -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(0, 18) // unusable: RESET +#define BUTTON_DFU_OTA PINNUM(1, 1) // no connection on E73-2G4M08S1E Module +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "BlueMicro" -#define BLEDIS_MODEL "BlueMicro 833" +#define BLEDIS_MANUFACTURER "BlueMicro" +#define BLEDIS_MODEL "BlueMicro 833" //--------------------------------------------------------------------+ // USB PID from openmoko: // PR https://github.com/openmoko/openmoko-usb-oui/pull/34 //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x1d50 -#define USB_DESC_UF2_PID 0x616f -#define USB_DESC_CDC_ONLY_PID 0x616f +#define USB_DESC_VID 0x1d50 +#define USB_DESC_UF2_PID 0x616f +#define USB_DESC_CDC_ONLY_PID 0x616f -#define UF2_PRODUCT_NAME "BlueMicro" -#define UF2_VOLUME_LABEL "BLUEMICRO" -#define UF2_BOARD_ID "nRF52833-BlueMicro-v1" -#define UF2_INDEX_URL "http://bluemicro.jpconstantineau.com/" +#define UF2_PRODUCT_NAME "BlueMicro" +#define UF2_VOLUME_LABEL "BLUEMICRO" +#define UF2_BOARD_ID "nRF52833-BlueMicro-v1" +#define UF2_INDEX_URL "http://bluemicro.jpconstantineau.com/" #endif // _BLUEMICRO_H diff --git a/src/boards/bluemicro_nrf52840/board.h b/src/boards/bluemicro_nrf52840/board.h index 393e538c..46a2ef0e 100644 --- a/src/boards/bluemicro_nrf52840/board.h +++ b/src/boards/bluemicro_nrf52840/board.h @@ -25,41 +25,38 @@ #ifndef _BLUEMICRO_NRF52840_H #define _BLUEMICRO_NRF52840_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 2 -#define LED_PRIMARY_PIN _PINNUM(1, 4) -#define LED_SECONDARY_PIN _PINNUM(1, 10) -#define LED_STATE_ON 1 +#define LEDS_NUMBER 2 +#define LED_PRIMARY_PIN PINNUM(1, 4) +#define LED_SECONDARY_PIN PINNUM(1, 10) +#define LED_STATE_ON 1 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 // none connected at all -#define BUTTON_1 _PINNUM(0, 18) // unusable: RESET -#define BUTTON_2 _PINNUM(1, 1) // no connection on E73-2G4M08S1C Module -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(0, 18) // unusable: RESET +#define BUTTON_DFU_OTA PINNUM(1, 1) // no connection on E73-2G4M08S1C Module +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "BlueMicro" -#define BLEDIS_MODEL "BlueMicro 840" +#define BLEDIS_MANUFACTURER "BlueMicro" +#define BLEDIS_MODEL "BlueMicro 840" //--------------------------------------------------------------------+ // USB PID from openmoko: // Approved PR https://github.com/openmoko/openmoko-usb-oui/pull/20 //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x1d50 -#define USB_DESC_UF2_PID 0x6160 -#define USB_DESC_CDC_ONLY_PID 0x6160 - -#define UF2_PRODUCT_NAME "BlueMicro" -#define UF2_VOLUME_LABEL "BLUEMICRO" -#define UF2_BOARD_ID "nRF52840-BlueMicro-v1" -#define UF2_INDEX_URL "http://bluemicro.jpconstantineau.com/" +#define USB_DESC_VID 0x1d50 +#define USB_DESC_UF2_PID 0x6160 +#define USB_DESC_CDC_ONLY_PID 0x6160 + +#define UF2_PRODUCT_NAME "BlueMicro" +#define UF2_VOLUME_LABEL "BLUEMICRO" +#define UF2_BOARD_ID "nRF52840-BlueMicro-v1" +#define UF2_INDEX_URL "http://bluemicro.jpconstantineau.com/" #endif // _BLUEMICRO_H diff --git a/src/boards/boards.c b/src/boards/boards.c index 9f986324..c02a2786 100644 --- a/src/boards/boards.c +++ b/src/boards/boards.c @@ -50,7 +50,7 @@ void SysTick_Handler(void) { led_tick(); } -#if defined(BUTTON_DFU) || defined(BUTTON_FRESET) +#if defined(BUTTON_DFU) || defined(BUTTON_DFU_OTA) void button_init(uint32_t pin) { if (BUTTON_PULL == NRF_GPIO_PIN_PULLDOWN) { nrf_gpio_cfg_sense_input(pin, BUTTON_PULL, NRF_GPIO_PIN_SENSE_HIGH); @@ -79,8 +79,8 @@ void board_init(void) { #ifdef BUTTON_DFU button_init(BUTTON_DFU); #endif -#ifdef BUTTON_FRESET - button_init(BUTTON_FRESET); +#ifdef BUTTON_DFU_OTA + button_init(BUTTON_DFU_OTA); #endif NRFX_DELAY_US(100); // wait for the pin state is stable diff --git a/src/boards/boards.h b/src/boards/boards.h index 583e044f..8600119e 100644 --- a/src/boards/boards.h +++ b/src/boards/boards.h @@ -31,20 +31,13 @@ #include "nrf.h" #include "nrf_gpio.h" +#define PINNUM(port, pin) ((port) * 32 + (pin)) #include "board.h" #ifndef UF2_VOLUME_LABEL #define UF2_VOLUME_LABEL "NRF52BOOT " #endif -#if !defined(BUTTON_DFU) && defined(BUTTON_1) -#define BUTTON_DFU BUTTON_1 -#endif - -#if !defined(BUTTON_FRESET) && defined(BUTTON_2) -#define BUTTON_FRESET BUTTON_2 -#endif - // The primary LED is usually Red but not in all cases. #define LED_PRIMARY 0 // The secondary LED, when available, is usually blue. @@ -104,7 +97,7 @@ void led_tick(void); //--------------------------------------------------------------------+ // BUTTONS //--------------------------------------------------------------------+ -#if defined(BUTTON_DFU) || defined(BUTTON_FRESET) +#if defined(BUTTON_DFU) || defined(BUTTON_DFU_OTA) void button_init(uint32_t pin); bool button_pressed(uint32_t pin); #endif diff --git a/src/boards/challenger_840_ble/board.h b/src/boards/challenger_840_ble/board.h index 371be084..7be348c1 100644 --- a/src/boards/challenger_840_ble/board.h +++ b/src/boards/challenger_840_ble/board.h @@ -1,73 +1,70 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2018 Ha Thach for Adafruit Industries, 2022 Invector Labs - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef _CHALLENGER_840_BLE_H -#define _CHALLENGER_840_BLE_H - -#define _PINNUM(port, pin) ((port)*32 + (pin)) - -/*------------------------------------------------------------------*/ -/* LED - *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(0, 12) -#define LED_STATE_ON 1 - -#define LED_NEOPIXEL _PINNUM(1, 8) -#define NEOPIXELS_NUMBER 1 -#define BOARD_RGB_BRIGHTNESS 0x040404 - -/*------------------------------------------------------------------*/ -/* BUTTON - *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(0, 19) -#define BUTTON_2 _PINNUM(0, 8) // Pulls flash cs high -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP - -/*------------------------------------------------------------------*/ -/* On board LDO control - *------------------------------------------------------------------*/ -#define LDO_CONTROL_PIN _PINNUM(1, 9) // Enables external pwr - -//--------------------------------------------------------------------+ -// BLE OTA -//--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Invector Labs" -#define BLEDIS_MODEL "Challenger 840 BLE" - -//--------------------------------------------------------------------+ -// USB -//--------------------------------------------------------------------+ -#define USB_DESC_VID 0x1209 -#define USB_DESC_UF2_PID 0x7380 -#define USB_DESC_CDC_ONLY_PID 0x7381 - -//------------- UF2 -------------// -#define UF2_PRODUCT_NAME "ILabs Challenger 840" -#define UF2_VOLUME_LABEL "CH840BOOT" -#define UF2_BOARD_ID "nRF52840-Challenger-840" -#define UF2_INDEX_URL "https://www.ilabs.se" - -#endif // _CHALLENGER_840_BLE_H +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries, 2022 Invector Labs + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef _CHALLENGER_840_BLE_H +#define _CHALLENGER_840_BLE_H + +/*------------------------------------------------------------------*/ +/* LED + *------------------------------------------------------------------*/ +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(0, 12) +#define LED_STATE_ON 1 + +#define LED_NEOPIXEL PINNUM(1, 8) +#define NEOPIXELS_NUMBER 1 +#define BOARD_RGB_BRIGHTNESS 0x040404 + +/*------------------------------------------------------------------*/ +/* BUTTON + *------------------------------------------------------------------*/ +#define BUTTON_DFU PINNUM(0, 19) +#define BUTTON_DFU_OTA PINNUM(0, 8) // Pulls flash cs high +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP + +/*------------------------------------------------------------------*/ +/* On board LDO control + *------------------------------------------------------------------*/ +#define LDO_CONTROL_PIN PINNUM(1, 9) // Enables external pwr + +//--------------------------------------------------------------------+ +// BLE OTA +//--------------------------------------------------------------------+ +#define BLEDIS_MANUFACTURER "Invector Labs" +#define BLEDIS_MODEL "Challenger 840 BLE" + +//--------------------------------------------------------------------+ +// USB +//--------------------------------------------------------------------+ +#define USB_DESC_VID 0x1209 +#define USB_DESC_UF2_PID 0x7380 +#define USB_DESC_CDC_ONLY_PID 0x7381 + +//------------- UF2 -------------// +#define UF2_PRODUCT_NAME "ILabs Challenger 840" +#define UF2_VOLUME_LABEL "CH840BOOT" +#define UF2_BOARD_ID "nRF52840-Challenger-840" +#define UF2_INDEX_URL "https://www.ilabs.se" + +#endif // _CHALLENGER_840_BLE_H diff --git a/src/boards/circuitplayground_nrf52840/board.h b/src/boards/circuitplayground_nrf52840/board.h index 5544502c..82a9bbf7 100644 --- a/src/boards/circuitplayground_nrf52840/board.h +++ b/src/boards/circuitplayground_nrf52840/board.h @@ -25,44 +25,41 @@ #ifndef _CPLAY_NRF52840_H #define _CPLAY_NRF52840_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(1, 14) -#define LED_STATE_ON 1 +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(1, 14) +#define LED_STATE_ON 1 -#define LED_NEOPIXEL _PINNUM(0, 13) -#define NEOPIXELS_NUMBER 10 -#define BOARD_RGB_BRIGHTNESS 0x040404 +#define LED_NEOPIXEL PINNUM(0, 13) +#define NEOPIXELS_NUMBER 10 +#define BOARD_RGB_BRIGHTNESS 0x040404 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(1, 02) // left button -#define BUTTON_2 _PINNUM(1, 15) // right button -#define BUTTON_PULL NRF_GPIO_PIN_PULLDOWN +#define BUTTON_DFU PINNUM(1, 02) // left button +#define BUTTON_DFU_OTA PINNUM(1, 15) // right button +#define BUTTON_PULL NRF_GPIO_PIN_PULLDOWN //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Adafruit Industries" -#define BLEDIS_MODEL "Circuit Playground nRF52840" +#define BLEDIS_MANUFACTURER "Adafruit Industries" +#define BLEDIS_MODEL "Circuit Playground nRF52840" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x0045 -#define USB_DESC_CDC_ONLY_PID 0x0045 +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x0045 +#define USB_DESC_CDC_ONLY_PID 0x0045 //------------- UF2 -------------// -#define UF2_PRODUCT_NAME "Adafruit Circuit Playground nRF52840" -#define UF2_VOLUME_LABEL "CPLAYBTBOOT" -#define UF2_BOARD_ID "nRF52840-CircuitPlayground-revD" -#define UF2_INDEX_URL "https://www.adafruit.com/product/4333" +#define UF2_PRODUCT_NAME "Adafruit Circuit Playground nRF52840" +#define UF2_VOLUME_LABEL "CPLAYBTBOOT" +#define UF2_BOARD_ID "nRF52840-CircuitPlayground-revD" +#define UF2_INDEX_URL "https://www.adafruit.com/product/4333" #endif // _CPLAY_NRF52840_H diff --git a/src/boards/clue_nrf52840/board.h b/src/boards/clue_nrf52840/board.h index 818f2f4d..91b8f568 100644 --- a/src/boards/clue_nrf52840/board.h +++ b/src/boards/clue_nrf52840/board.h @@ -25,70 +25,67 @@ #ifndef _CLUE_NRF52840_H #define _CLUE_NRF52840_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(1, 01) -#define LED_STATE_ON 1 +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(1, 01) +#define LED_STATE_ON 1 -#define LED_NEOPIXEL _PINNUM(0, 16) -#define NEOPIXELS_NUMBER 1 -#define BOARD_RGB_BRIGHTNESS 0x040404 +#define LED_NEOPIXEL PINNUM(0, 16) +#define NEOPIXELS_NUMBER 1 +#define BOARD_RGB_BRIGHTNESS 0x040404 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(1, 02) // left button -#define BUTTON_2 _PINNUM(1, 10) // right button -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(1, 02) // left button +#define BUTTON_DFU_OTA PINNUM(1, 10) // right button +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // Display //--------------------------------------------------------------------+ #define DISPLAY_CONTROLLER_ST7789 -#define DISPLAY_PIN_SCK _PINNUM(0, 14) -#define DISPLAY_PIN_MOSI _PINNUM(0, 15) +#define DISPLAY_PIN_SCK PINNUM(0, 14) +#define DISPLAY_PIN_MOSI PINNUM(0, 15) -#define DISPLAY_PIN_CS _PINNUM(0, 12) -#define DISPLAY_PIN_DC _PINNUM(0, 13) -#define DISPLAY_PIN_RST _PINNUM(1, 3) -#define DISPLAY_PIN_BL _PINNUM(1, 5) -#define DISPLAY_BL_ON 1 // GPIO state to enable back light +#define DISPLAY_PIN_CS PINNUM(0, 12) +#define DISPLAY_PIN_DC PINNUM(0, 13) +#define DISPLAY_PIN_RST PINNUM(1, 3) +#define DISPLAY_PIN_BL PINNUM(1, 5) +#define DISPLAY_BL_ON 1 // GPIO state to enable back light -#define DISPLAY_WIDTH 240 -#define DISPLAY_HEIGHT 240 +#define DISPLAY_WIDTH 240 +#define DISPLAY_HEIGHT 240 -#define DISPLAY_COL_OFFSET 0 -#define DISPLAY_ROW_OFFSET 80 +#define DISPLAY_COL_OFFSET 0 +#define DISPLAY_ROW_OFFSET 80 // Memory Data Access Control & // Vertical Scroll Start Address -#define DISPLAY_MADCTL (TFT_MADCTL_MY) -#define DISPLAY_VSCSAD 0 +#define DISPLAY_MADCTL (TFT_MADCTL_MY) +#define DISPLAY_VSCSAD 0 -#define DISPLAY_TITLE "CLUE" +#define DISPLAY_TITLE "CLUE" //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Adafruit Industries" -#define BLEDIS_MODEL "CLUE nRF52840" +#define BLEDIS_MANUFACTURER "Adafruit Industries" +#define BLEDIS_MODEL "CLUE nRF52840" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x0071 -#define USB_DESC_CDC_ONLY_PID 0x0071 +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x0071 +#define USB_DESC_CDC_ONLY_PID 0x0071 //------------- UF2 -------------// -#define UF2_PRODUCT_NAME "Adafruit CLUE nRF52840" -#define UF2_VOLUME_LABEL "CLUEBOOT" -#define UF2_BOARD_ID "nRF52840-CLUE-revA" -#define UF2_INDEX_URL "https://www.adafruit.com/product/4500" +#define UF2_PRODUCT_NAME "Adafruit CLUE nRF52840" +#define UF2_VOLUME_LABEL "CLUEBOOT" +#define UF2_BOARD_ID "nRF52840-CLUE-revA" +#define UF2_INDEX_URL "https://www.adafruit.com/product/4500" #endif // _CLUE_NRF52840_H diff --git a/src/boards/ebyte_e104_bt5032a/board.h b/src/boards/ebyte_e104_bt5032a/board.h index da20812f..983f5ffa 100644 --- a/src/boards/ebyte_e104_bt5032a/board.h +++ b/src/boards/ebyte_e104_bt5032a/board.h @@ -1,66 +1,66 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2021 Pierre Constantineau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef _EBYTE_E104_BT5032A_H -#define _EBYTE_E104_BT5032A_H - -/*------------------------------------------------------------------*/ -/* LED - *------------------------------------------------------------------*/ -#define LEDS_NUMBER 2 -#define LED_PRIMARY_PIN 31 // Red - named "Data" -#define LED_SECONDARY_PIN 30 // Blue - named "Link" (also a red one on the Test Board) -#define LED_STATE_ON 0 - -/*------------------------------------------------------------------*/ -/* BUTTON - *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 29 // DISC Button on E104-BT5032A-TB Test Board - // BUTTON_1 is DFU. The module does not have reset circuitry. - // The Test Board from Ebyte (E104-BT5032A-TB) also does not have reset circuitry - // To be able to upload using the Arduino IDE, (To enter DFU mode) - // Press "DISC", press and release "RST", then release "DISC" -#define BUTTON_2 28 // No button - WKP pin -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP - -/*------------------------------------------------------------------*/ -/* UART (only used by nRF52832) - *------------------------------------------------------------------*/ -#define RX_PIN_NUMBER 14 -#define TX_PIN_NUMBER 18 -#define CTS_PIN_NUMBER 20 -#define RTS_PIN_NUMBER 19 -#define HWFC false // leaving it false to make GPIO available - -//--------------------------------------------------------------------+ -// BLE OTA -//--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "CDEBYTE" -#define BLEDIS_MODEL "E104-BT5032A" - -#define UF2_PRODUCT_NAME "Ebyte E104-BT5032A nRF52832" -#define UF2_INDEX_URL "https://www.ebyte.com/en/product-view-news.html?id=756" - -#endif // _EBYTE_E104_BT5032A_H +/* + * The MIT License (MIT) + * + * Copyright (c) 2021 Pierre Constantineau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef _EBYTE_E104_BT5032A_H +#define _EBYTE_E104_BT5032A_H + +/*------------------------------------------------------------------*/ +/* LED + *------------------------------------------------------------------*/ +#define LEDS_NUMBER 2 +#define LED_PRIMARY_PIN 31 // Red - named "Data" +#define LED_SECONDARY_PIN 30 // Blue - named "Link" (also a red one on the Test Board) +#define LED_STATE_ON 0 + +/*------------------------------------------------------------------*/ +/* BUTTON + *------------------------------------------------------------------*/ +#define BUTTON_DFU \ + 29 // DISC Button on E104-BT5032A-TB Test Board + // BUTTON_DFU is DFU. The module does not have reset circuitry. + // The Test Board from Ebyte (E104-BT5032A-TB) also does not have reset circuitry + // To be able to upload using the Arduino IDE, (To enter DFU mode) + // Press "DISC", press and release "RST", then release "DISC" +#define BUTTON_DFU_OTA 28 // No button - WKP pin +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP + +/*------------------------------------------------------------------*/ +/* UART (only used by nRF52832) + *------------------------------------------------------------------*/ +#define RX_PIN_NUMBER 14 +#define TX_PIN_NUMBER 18 +#define CTS_PIN_NUMBER 20 +#define RTS_PIN_NUMBER 19 +#define HWFC false // leaving it false to make GPIO available + +//--------------------------------------------------------------------+ +// BLE OTA +//--------------------------------------------------------------------+ +#define BLEDIS_MANUFACTURER "CDEBYTE" +#define BLEDIS_MODEL "E104-BT5032A" + +#define UF2_PRODUCT_NAME "Ebyte E104-BT5032A nRF52832" +#define UF2_INDEX_URL "https://www.ebyte.com/en/product-view-news.html?id=756" + +#endif // _EBYTE_E104_BT5032A_H diff --git a/src/boards/ebyte_e73_tbb/board.h b/src/boards/ebyte_e73_tbb/board.h index 30976e60..bd522c56 100644 --- a/src/boards/ebyte_e73_tbb/board.h +++ b/src/boards/ebyte_e73_tbb/board.h @@ -1,67 +1,67 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2021 Pierre Constantineau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef _EBYTE_E73_TBB_H -#define _EBYTE_E73_TBB_H - -/*------------------------------------------------------------------*/ -/* LED - *------------------------------------------------------------------*/ -#define LEDS_NUMBER 2 -#define LED_PRIMARY_PIN 17 // Red - named "LED1" -#define LED_SECONDARY_PIN 18 // Blue - named "LED2" (also a red one on the Test Board) -#define LED_STATE_ON 0 - -/*------------------------------------------------------------------*/ -/* BUTTON - *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 14 // BUTTON_1 is DFU. SW1 on E73-TBB Test Board. - // This Test board uses the E73-2G4M04S1B module which contains a nrf52832. - // The module does not have reset circuitry. - // The Test Board from Ebyte (E73-TBB) also does not have reset circuitry - // To be able to upload using the Arduino IDE, (To enter DFU mode) - // Press "SW1", momentarily ground "RST/P0.21", then release "SW1" -#define BUTTON_2 13 // SW2 on board -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP - -/*------------------------------------------------------------------*/ -/* UART (only used by nRF52832) - *------------------------------------------------------------------*/ -#define RX_PIN_NUMBER 8 -#define TX_PIN_NUMBER 6 -#define CTS_PIN_NUMBER 5 -#define RTS_PIN_NUMBER 7 -#define HWFC false // leaving it false to make GPIO available - -//--------------------------------------------------------------------+ -// BLE OTA -//--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "CDEBYTE" -#define BLEDIS_MODEL "E73-TBB" - -#define UF2_PRODUCT_NAME "Ebyte E73-TBB nRF52832" -#define UF2_INDEX_URL "https://www.ebyte.com/en/product-view-news.aspx?id=889" - -#endif // _EBYTE_E73_TBB_H +/* + * The MIT License (MIT) + * + * Copyright (c) 2021 Pierre Constantineau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef _EBYTE_E73_TBB_H +#define _EBYTE_E73_TBB_H + +/*------------------------------------------------------------------*/ +/* LED + *------------------------------------------------------------------*/ +#define LEDS_NUMBER 2 +#define LED_PRIMARY_PIN 17 // Red - named "LED1" +#define LED_SECONDARY_PIN 18 // Blue - named "LED2" (also a red one on the Test Board) +#define LED_STATE_ON 0 + +/*------------------------------------------------------------------*/ +/* BUTTON + *------------------------------------------------------------------*/ +#define BUTTON_DFU \ + 14 // BUTTON_DFU is DFU. SW1 on E73-TBB Test Board. + // This Test board uses the E73-2G4M04S1B module which contains a nrf52832. + // The module does not have reset circuitry. + // The Test Board from Ebyte (E73-TBB) also does not have reset circuitry + // To be able to upload using the Arduino IDE, (To enter DFU mode) + // Press "SW1", momentarily ground "RST/P0.21", then release "SW1" +#define BUTTON_DFU_OTA 13 // SW2 on board +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP + +/*------------------------------------------------------------------*/ +/* UART (only used by nRF52832) + *------------------------------------------------------------------*/ +#define RX_PIN_NUMBER 8 +#define TX_PIN_NUMBER 6 +#define CTS_PIN_NUMBER 5 +#define RTS_PIN_NUMBER 7 +#define HWFC false // leaving it false to make GPIO available + +//--------------------------------------------------------------------+ +// BLE OTA +//--------------------------------------------------------------------+ +#define BLEDIS_MANUFACTURER "CDEBYTE" +#define BLEDIS_MODEL "E73-TBB" + +#define UF2_PRODUCT_NAME "Ebyte E73-TBB nRF52832" +#define UF2_INDEX_URL "https://www.ebyte.com/en/product-view-news.aspx?id=889" + +#endif // _EBYTE_E73_TBB_H diff --git a/src/boards/electronut_labs_papyr/board.h b/src/boards/electronut_labs_papyr/board.h index 2dd931c8..69ce72fb 100644 --- a/src/boards/electronut_labs_papyr/board.h +++ b/src/boards/electronut_labs_papyr/board.h @@ -30,10 +30,10 @@ /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 2 -#define LED_PRIMARY_PIN 13 -#define LED_SECONDARY_PIN 14 -#define LED_STATE_ON 0 +#define LEDS_NUMBER 2 +#define LED_PRIMARY_PIN 13 +#define LED_SECONDARY_PIN 14 +#define LED_STATE_ON 0 /*------------------------------------------------------------------*/ /* BUTTON @@ -42,26 +42,25 @@ // App can trigger OTA bootloader by writing DFU_MAGIC_OTA_APPJUM to // GPREGRET register if softdevice is not initialized; or by // writing DFU_MAGIC_OTA_RESET in case softdevice is initialized. -#define BUTTONS_NUMBER 2 -#define BUTTON_1 18 // RESET also by default -#define BUTTON_2 1 // P0.1 not exposed anywhere, FRST n/a -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU 18 // RESET also by default +#define BUTTON_DFU_OTA 1 // P0.1 not exposed anywhere, FRST n/a +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Electronut Labs" -#define BLEDIS_MODEL "Papyr" +#define BLEDIS_MANUFACTURER "Electronut Labs" +#define BLEDIS_MODEL "Papyr" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define UF2_PRODUCT_NAME "Electronut Labs Papyr" -#define UF2_BOARD_ID "nRF52840-Papyr-v1" -#define UF2_INDEX_URL "https://docs.electronut.in/papyr" +#define UF2_PRODUCT_NAME "Electronut Labs Papyr" +#define UF2_BOARD_ID "nRF52840-Papyr-v1" +#define UF2_INDEX_URL "https://docs.electronut.in/papyr" -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x003B -#define USB_DESC_CDC_ONLY_PID 0x003B +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x003B +#define USB_DESC_CDC_ONLY_PID 0x003B #endif // PPAPYR_H diff --git a/src/boards/feather_nrf52832/board.h b/src/boards/feather_nrf52832/board.h index a31bafa8..5e280a1f 100644 --- a/src/boards/feather_nrf52832/board.h +++ b/src/boards/feather_nrf52832/board.h @@ -1,62 +1,61 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2018 Ha Thach for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef _FEATHER_NRF52832_H -#define _FEATHER_NRF52832_H - -/*------------------------------------------------------------------*/ -/* LED - *------------------------------------------------------------------*/ -#define LEDS_NUMBER 2 -#define LED_PRIMARY_PIN 17 // Red -#define LED_SECONDARY_PIN 19 // Blue -#define LED_STATE_ON 1 - -/*------------------------------------------------------------------*/ -/* BUTTON - *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 20 -#define BUTTON_2 22 -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP - -/*------------------------------------------------------------------*/ -/* UART (only used by nRF52832) - *------------------------------------------------------------------*/ -#define RX_PIN_NUMBER 8 -#define TX_PIN_NUMBER 6 -#define CTS_PIN_NUMBER 0 -#define RTS_PIN_NUMBER 0 -#define HWFC false - -//--------------------------------------------------------------------+ -// BLE OTA -//--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Adafruit Industries" -#define BLEDIS_MODEL "Feather nRF52832" - -#define UF2_PRODUCT_NAME "Adafruit Feather nRF52832" -#define UF2_INDEX_URL "https://www.adafruit.com/product/3406" - -#endif // _FEATHER_NRF52832_H +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef _FEATHER_NRF52832_H +#define _FEATHER_NRF52832_H + +/*------------------------------------------------------------------*/ +/* LED + *------------------------------------------------------------------*/ +#define LEDS_NUMBER 2 +#define LED_PRIMARY_PIN 17 // Red +#define LED_SECONDARY_PIN 19 // Blue +#define LED_STATE_ON 1 + +/*------------------------------------------------------------------*/ +/* BUTTON + *------------------------------------------------------------------*/ +#define BUTTON_DFU 20 +#define BUTTON_DFU_OTA 22 +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP + +/*------------------------------------------------------------------*/ +/* UART (only used by nRF52832) + *------------------------------------------------------------------*/ +#define RX_PIN_NUMBER 8 +#define TX_PIN_NUMBER 6 +#define CTS_PIN_NUMBER 0 +#define RTS_PIN_NUMBER 0 +#define HWFC false + +//--------------------------------------------------------------------+ +// BLE OTA +//--------------------------------------------------------------------+ +#define BLEDIS_MANUFACTURER "Adafruit Industries" +#define BLEDIS_MODEL "Feather nRF52832" + +#define UF2_PRODUCT_NAME "Adafruit Feather nRF52832" +#define UF2_INDEX_URL "https://www.adafruit.com/product/3406" + +#endif // _FEATHER_NRF52832_H diff --git a/src/boards/feather_nrf52833_express/board.cmake b/src/boards/feather_nrf52833_express/board.cmake deleted file mode 100644 index cb4f2f9e..00000000 --- a/src/boards/feather_nrf52833_express/board.cmake +++ /dev/null @@ -1 +0,0 @@ -set(MCU_VARIANT nrf52833) diff --git a/src/boards/feather_nrf52833_express/board.h b/src/boards/feather_nrf52833_express/board.h deleted file mode 100644 index af0e1ec4..00000000 --- a/src/boards/feather_nrf52833_express/board.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2018 Ha Thach for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef _FEATHER_NRF52833_H -#define _FEATHER_NRF52833_H - -#define _PINNUM(port, pin) ((port)*32 + (pin)) - -/*------------------------------------------------------------------*/ -/* LED - *------------------------------------------------------------------*/ -#define LEDS_NUMBER 2 -#define LED_PRIMARY_PIN _PINNUM(1, 15) -#define LED_SECONDARY_PIN _PINNUM(1, 10) -#define LED_STATE_ON 1 - -#define LED_NEOPIXEL _PINNUM(0, 16) -#define NEOPIXELS_NUMBER 1 -#define BOARD_RGB_BRIGHTNESS 0x040404 - -/*------------------------------------------------------------------*/ -/* BUTTON - *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(1, 02) -#define BUTTON_2 _PINNUM(0, 10) -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP - -//--------------------------------------------------------------------+ -// BLE OTA -//--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Adafruit Industries" -#define BLEDIS_MODEL "Feather nRF52833 Express" - -//--------------------------------------------------------------------+ -// USB -//--------------------------------------------------------------------+ -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x0029 // TODO change later -#define USB_DESC_CDC_ONLY_PID 0x002A // TODO change later - -//------------- UF2 -------------// -#define UF2_PRODUCT_NAME "Adafruit Feather nRF52833 Express" -#define UF2_VOLUME_LABEL "FTHR833BOOT" -#define UF2_BOARD_ID "nRF52833-Feather-revD" -#define UF2_INDEX_URL "https://www.adafruit.com/product/4062" // TODO change later - -#endif diff --git a/src/boards/feather_nrf52833_express/board.mk b/src/boards/feather_nrf52833_express/board.mk deleted file mode 100644 index d60ac481..00000000 --- a/src/boards/feather_nrf52833_express/board.mk +++ /dev/null @@ -1 +0,0 @@ -MCU_SUB_VARIANT = nrf52833 diff --git a/src/boards/feather_nrf52833_express/pinconfig.c b/src/boards/feather_nrf52833_express/pinconfig.c deleted file mode 100644 index 72308c4a..00000000 --- a/src/boards/feather_nrf52833_express/pinconfig.c +++ /dev/null @@ -1,19 +0,0 @@ -#include "boards.h" -#include "uf2/configkeys.h" - -__attribute__((used, section(".bootloaderConfig"))) -const uint32_t bootloaderConfig[] = -{ - /* CF2 START */ - CFG_MAGIC0, CFG_MAGIC1, // magic - 5, 100, // used entries, total entries - - 204, 0x80000, // FLASH_BYTES - 205, 0x20000, // RAM_BYTES - 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 - 209, 0x621e937a, // UF2_FAMILY - 210, 0x20, // PINS_PORT_SIZE = PA_32 - - 0, 0, 0, 0, 0, 0, 0, 0 - /* CF2 END */ -}; diff --git a/src/boards/feather_nrf52840_express/board.h b/src/boards/feather_nrf52840_express/board.h index 49994f0c..4fa7c98b 100644 --- a/src/boards/feather_nrf52840_express/board.h +++ b/src/boards/feather_nrf52840_express/board.h @@ -1,70 +1,68 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2018 Ha Thach for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef _FEATHER_NRF52840_H -#define _FEATHER_NRF52840_H - -#define _PINNUM(port, pin) ((port)*32 + (pin)) - -/*------------------------------------------------------------------*/ -/* LED - *------------------------------------------------------------------*/ -#define LEDS_NUMBER 2 -#define LED_PRIMARY_PIN _PINNUM(1, 15) -#define LED_SECONDARY_PIN _PINNUM(1, 10) -#define LED_STATE_ON 1 - -#define LED_NEOPIXEL _PINNUM(0, 16) -#define NEOPIXEL_POWER_PIN _PINNUM(1, 14) -#define NEOPIXELS_NUMBER 1 -#define BOARD_RGB_BRIGHTNESS 0x040404 - -/*------------------------------------------------------------------*/ -/* BUTTON - *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(1, 02) -#define BUTTON_2 _PINNUM(0, 10) -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP - -//--------------------------------------------------------------------+ -// BLE OTA -//--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Adafruit Industries" -#define BLEDIS_MODEL "Feather nRF52840 Express" - -//--------------------------------------------------------------------+ -// USB -//--------------------------------------------------------------------+ -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x0029 -#define USB_DESC_CDC_ONLY_PID 0x002A - -//------------- UF2 -------------// -#define UF2_PRODUCT_NAME "Adafruit Feather nRF52840 Express" -#define UF2_VOLUME_LABEL "FTHR840BOOT" -#define UF2_BOARD_ID "nRF52840-Feather-revE" -#define UF2_INDEX_URL "https://www.adafruit.com/product/4062" - -#endif // _FEATHER_NRF52840_H +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef _FEATHER_NRF52840_H +#define _FEATHER_NRF52840_H + + +/*------------------------------------------------------------------*/ +/* LED + *------------------------------------------------------------------*/ +#define LEDS_NUMBER 2 +#define LED_PRIMARY_PIN PINNUM(1, 15) +#define LED_SECONDARY_PIN PINNUM(1, 10) +#define LED_STATE_ON 1 + +#define LED_NEOPIXEL PINNUM(0, 16) +#define NEOPIXEL_POWER_PIN PINNUM(1, 14) +#define NEOPIXELS_NUMBER 1 +#define BOARD_RGB_BRIGHTNESS 0x040404 + +/*------------------------------------------------------------------*/ +/* BUTTON + *------------------------------------------------------------------*/ +#define BUTTON_DFU PINNUM(1, 02) +#define BUTTON_DFU_OTA PINNUM(0, 10) +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP + +//--------------------------------------------------------------------+ +// BLE OTA +//--------------------------------------------------------------------+ +#define BLEDIS_MANUFACTURER "Adafruit Industries" +#define BLEDIS_MODEL "Feather nRF52840 Express" + +//--------------------------------------------------------------------+ +// USB +//--------------------------------------------------------------------+ +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x0029 +#define USB_DESC_CDC_ONLY_PID 0x002A + +//------------- UF2 -------------// +#define UF2_PRODUCT_NAME "Adafruit Feather nRF52840 Express" +#define UF2_VOLUME_LABEL "FTHR840BOOT" +#define UF2_BOARD_ID "nRF52840-Feather-revE" +#define UF2_INDEX_URL "https://www.adafruit.com/product/4062" + +#endif // _FEATHER_NRF52840_H diff --git a/src/boards/feather_nrf52840_sense/board.h b/src/boards/feather_nrf52840_sense/board.h index fbaf9bc8..e0740fd9 100644 --- a/src/boards/feather_nrf52840_sense/board.h +++ b/src/boards/feather_nrf52840_sense/board.h @@ -25,45 +25,42 @@ #ifndef _FEATHER_NRF52840_SENSE_H #define _FEATHER_NRF52840_SENSE_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 2 -#define LED_PRIMARY_PIN _PINNUM(1, 9) -#define LED_SECONDARY_PIN _PINNUM(1, 10) -#define LED_STATE_ON 1 +#define LEDS_NUMBER 2 +#define LED_PRIMARY_PIN PINNUM(1, 9) +#define LED_SECONDARY_PIN PINNUM(1, 10) +#define LED_STATE_ON 1 -#define LED_NEOPIXEL _PINNUM(0, 16) -#define NEOPIXELS_NUMBER 1 -#define BOARD_RGB_BRIGHTNESS 0x040404 +#define LED_NEOPIXEL PINNUM(0, 16) +#define NEOPIXELS_NUMBER 1 +#define BOARD_RGB_BRIGHTNESS 0x040404 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(1, 02) -#define BUTTON_2 _PINNUM(0, 10) -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(1, 02) +#define BUTTON_DFU_OTA PINNUM(0, 10) +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Adafruit Industries" -#define BLEDIS_MODEL "Feather nRF52840 Sense" +#define BLEDIS_MANUFACTURER "Adafruit Industries" +#define BLEDIS_MODEL "Feather nRF52840 Sense" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x0087 -#define USB_DESC_CDC_ONLY_PID 0x0088 +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x0087 +#define USB_DESC_CDC_ONLY_PID 0x0088 //------------- UF2 -------------// -#define UF2_PRODUCT_NAME "Adafruit Feather nRF52840 Sense" -#define UF2_VOLUME_LABEL "FTHRSNSBOOT" -#define UF2_BOARD_ID "nRF52840-Feather-Sense" -#define UF2_INDEX_URL "https://www.adafruit.com/product/4516" +#define UF2_PRODUCT_NAME "Adafruit Feather nRF52840 Sense" +#define UF2_VOLUME_LABEL "FTHRSNSBOOT" +#define UF2_BOARD_ID "nRF52840-Feather-Sense" +#define UF2_INDEX_URL "https://www.adafruit.com/product/4516" #endif // _FEATHER_NRF52840_SENSE_H diff --git a/src/boards/feather_nrf52840_sense_tft/board.h b/src/boards/feather_nrf52840_sense_tft/board.h index 1fa03bd3..2e97e02d 100644 --- a/src/boards/feather_nrf52840_sense_tft/board.h +++ b/src/boards/feather_nrf52840_sense_tft/board.h @@ -25,76 +25,73 @@ #ifndef _FEATHER_NRF52840_SENSE_TFT_H #define _FEATHER_NRF52840_SENSE_TFT_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(0, 11) -#define LED_STATE_ON 1 +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(0, 11) +#define LED_STATE_ON 1 -#define LED_NEOPIXEL _PINNUM(1, 8) -#define NEOPIXEL_POWER_PIN _PINNUM(1, 2) -#define NEOPIXELS_NUMBER 1 -#define BOARD_RGB_BRIGHTNESS 0x040404 +#define LED_NEOPIXEL PINNUM(1, 8) +#define NEOPIXEL_POWER_PIN PINNUM(1, 2) +#define NEOPIXELS_NUMBER 1 +#define BOARD_RGB_BRIGHTNESS 0x040404 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(1, 6) -#define BUTTON_2 _PINNUM(1, 10) // DFU pin -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(1, 6) +#define BUTTON_DFU_OTA PINNUM(1, 10) // DFU pin +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // Display //--------------------------------------------------------------------+ // VSensor required to power the display -#define DISPLAY_VSENSOR_PIN _PINNUM(1, 7) -#define DISPLAY_VSENSOR_ON 1 +#define DISPLAY_VSENSOR_PIN PINNUM(1, 7) +#define DISPLAY_VSENSOR_ON 1 #define DISPLAY_CONTROLLER_ST7789 -#define DISPLAY_PIN_SCK _PINNUM(0, 26) -#define DISPLAY_PIN_MOSI _PINNUM(0, 5) +#define DISPLAY_PIN_SCK PINNUM(0, 26) +#define DISPLAY_PIN_MOSI PINNUM(0, 5) -#define DISPLAY_PIN_CS _PINNUM(1, 5) -#define DISPLAY_PIN_DC _PINNUM(1, 1) -#define DISPLAY_PIN_RST _PINNUM(1, 3) -#define DISPLAY_PIN_BL _PINNUM(0, 27) -#define DISPLAY_BL_ON 1 // GPIO state to enable back light +#define DISPLAY_PIN_CS PINNUM(1, 5) +#define DISPLAY_PIN_DC PINNUM(1, 1) +#define DISPLAY_PIN_RST PINNUM(1, 3) +#define DISPLAY_PIN_BL PINNUM(0, 27) +#define DISPLAY_BL_ON 1 // GPIO state to enable back light -#define DISPLAY_WIDTH 240 -#define DISPLAY_HEIGHT 135 +#define DISPLAY_WIDTH 240 +#define DISPLAY_HEIGHT 135 -#define DISPLAY_COL_OFFSET 53 -#define DISPLAY_ROW_OFFSET 40 +#define DISPLAY_COL_OFFSET 53 +#define DISPLAY_ROW_OFFSET 40 // Memory Data Access Control & // Vertical Scroll Start Address -#define DISPLAY_MADCTL (TFT_MADCTL_MX) -#define DISPLAY_VSCSAD 0 +#define DISPLAY_MADCTL (TFT_MADCTL_MX) +#define DISPLAY_VSCSAD 0 -#define DISPLAY_TITLE "Sense TFT" +#define DISPLAY_TITLE "Sense TFT" //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Adafruit Industries" -#define BLEDIS_MODEL "Feather nRF52840 Sense TFT" +#define BLEDIS_MANUFACTURER "Adafruit Industries" +#define BLEDIS_MODEL "Feather nRF52840 Sense TFT" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x0087 -#define USB_DESC_CDC_ONLY_PID 0x0088 +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x0087 +#define USB_DESC_CDC_ONLY_PID 0x0088 //------------- UF2 -------------// -#define UF2_PRODUCT_NAME "Adafruit Feather nRF52840 Sense TFT" -#define UF2_VOLUME_LABEL "SENSTFTBOOT" -#define UF2_BOARD_ID "nRF52840-FeatherSenseTFT-revA" -#define UF2_INDEX_URL "https://www.adafruit.com/product/" +#define UF2_PRODUCT_NAME "Adafruit Feather nRF52840 Sense TFT" +#define UF2_VOLUME_LABEL "SENSTFTBOOT" +#define UF2_BOARD_ID "nRF52840-FeatherSenseTFT-revA" +#define UF2_INDEX_URL "https://www.adafruit.com/product/" #endif diff --git a/src/boards/ikigaisense_vita/board.h b/src/boards/ikigaisense_vita/board.h index dab28e38..1c953474 100644 --- a/src/boards/ikigaisense_vita/board.h +++ b/src/boards/ikigaisense_vita/board.h @@ -1,69 +1,66 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2018 Ha Thach for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef _IKIGAISENSE_VITA_NRF52840_H -#define _IKIGAISENSE_VITA_NRF52840_H - -#define _PINNUM(port, pin) ((port)*32 + (pin)) - -/*------------------------------------------------------------------*/ -/* LED - *------------------------------------------------------------------*/ -#define LEDS_NUMBER 2 -#define LED_PRIMARY_PIN _PINNUM(1, 15) -#define LED_SECONDARY_PIN _PINNUM(1, 10) -#define LED_STATE_ON 1 - -#define LED_NEOPIXEL _PINNUM(0, 16) -#define NEOPIXELS_NUMBER 1 -#define BOARD_RGB_BRIGHTNESS 0x040404 - -/*------------------------------------------------------------------*/ -/* BUTTON - *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(1, 02) -#define BUTTON_2 _PINNUM(0, 10) -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP - -//--------------------------------------------------------------------+ -// BLE OTA -//--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "IkigaiSense Technologies" -#define BLEDIS_MODEL "Vita nRF52840" - -//--------------------------------------------------------------------+ -// USB -//--------------------------------------------------------------------+ -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x0093 -#define USB_DESC_CDC_ONLY_PID 0x0093 - -//------------- UF2 -------------// -#define UF2_PRODUCT_NAME "IkigaiSense Vita nRF52840" -#define UF2_VOLUME_LABEL "ISVITABoot" -#define UF2_BOARD_ID "nRF52840-isVITA-revA" -#define UF2_INDEX_URL "https://github.com/ikigaisense/vita" - -#endif // _IKIGAISENSE_VITA_NRF52840_H +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef _IKIGAISENSE_VITA_NRF52840_H +#define _IKIGAISENSE_VITA_NRF52840_H + +/*------------------------------------------------------------------*/ +/* LED + *------------------------------------------------------------------*/ +#define LEDS_NUMBER 2 +#define LED_PRIMARY_PIN PINNUM(1, 15) +#define LED_SECONDARY_PIN PINNUM(1, 10) +#define LED_STATE_ON 1 + +#define LED_NEOPIXEL PINNUM(0, 16) +#define NEOPIXELS_NUMBER 1 +#define BOARD_RGB_BRIGHTNESS 0x040404 + +/*------------------------------------------------------------------*/ +/* BUTTON + *------------------------------------------------------------------*/ +#define BUTTON_DFU PINNUM(1, 02) +#define BUTTON_DFU_OTA PINNUM(0, 10) +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP + +//--------------------------------------------------------------------+ +// BLE OTA +//--------------------------------------------------------------------+ +#define BLEDIS_MANUFACTURER "IkigaiSense Technologies" +#define BLEDIS_MODEL "Vita nRF52840" + +//--------------------------------------------------------------------+ +// USB +//--------------------------------------------------------------------+ +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x0093 +#define USB_DESC_CDC_ONLY_PID 0x0093 + +//------------- UF2 -------------// +#define UF2_PRODUCT_NAME "IkigaiSense Vita nRF52840" +#define UF2_VOLUME_LABEL "ISVITABoot" +#define UF2_BOARD_ID "nRF52840-isVITA-revA" +#define UF2_INDEX_URL "https://github.com/ikigaisense/vita" + +#endif // _IKIGAISENSE_VITA_NRF52840_H diff --git a/src/boards/itsybitsy_nrf52840_express/board.h b/src/boards/itsybitsy_nrf52840_express/board.h index a3b6c08b..563d5d59 100644 --- a/src/boards/itsybitsy_nrf52840_express/board.h +++ b/src/boards/itsybitsy_nrf52840_express/board.h @@ -25,30 +25,26 @@ #ifndef _ITSYBITSY_NRF52840_H #define _ITSYBITSY_NRF52840_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ #define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(0, 6) +#define LED_PRIMARY_PIN PINNUM(0, 6) #define LED_STATE_ON 1 -#define LED_APA102_CLK _PINNUM(1, 9) -#define LED_APA102_DATA _PINNUM(0, 8) +#define LED_APA102_CLK PINNUM(1, 9) +#define LED_APA102_DATA PINNUM(0, 8) #define LED_APA102_BRIGHTNESS 0x1 #define APA102_NUMBER 1 // For dotstart set to max for colour information is not masked off #define BOARD_RGB_BRIGHTNESS 0xffffffff - /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(0, 29) // user switch -#define BUTTON_2 _PINNUM(1, 02) // D2 breakout +#define BUTTON_DFU PINNUM(0, 29) // user switch +#define BUTTON_DFU_OTA PINNUM(1, 02) // D2 breakout #define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ @@ -68,6 +64,6 @@ #define UF2_PRODUCT_NAME "Adafruit ItsyBitsy nRF52840 Express" #define UF2_VOLUME_LABEL "ITSY840BOOT" #define UF2_BOARD_ID "nRF52840-ItsyBitsy-revA" -#define UF2_INDEX_URL "https://www.adafruit.com/" +#define UF2_INDEX_URL "https://www.adafruit.com/product/4481" -#endif // _ITSY_NRF52840_H +#endif diff --git a/src/boards/ledglasses_nrf52840/board.h b/src/boards/ledglasses_nrf52840/board.h index dd676d71..714fe94a 100644 --- a/src/boards/ledglasses_nrf52840/board.h +++ b/src/boards/ledglasses_nrf52840/board.h @@ -25,44 +25,41 @@ #ifndef _LEDGLASSES_NRF52840_H #define _LEDGLASSES_NRF52840_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(0, 31) -#define LED_STATE_ON 1 +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(0, 31) +#define LED_STATE_ON 1 -#define LED_NEOPIXEL _PINNUM(1, 15) -#define NEOPIXELS_NUMBER 1 -#define BOARD_RGB_BRIGHTNESS 0x040404 +#define LED_NEOPIXEL PINNUM(1, 15) +#define NEOPIXELS_NUMBER 1 +#define BOARD_RGB_BRIGHTNESS 0x040404 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(0, 30) // user switch -#define BUTTON_2 _PINNUM(0, 28) // NC -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(0, 30) // user switch +#define BUTTON_DFU_OTA PINNUM(0, 28) // NC +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Adafruit Industries" -#define BLEDIS_MODEL "LED Glasses Driver nRF52840" +#define BLEDIS_MANUFACTURER "Adafruit Industries" +#define BLEDIS_MODEL "LED Glasses Driver nRF52840" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x010D -#define USB_DESC_CDC_ONLY_PID 0x010E +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x010D +#define USB_DESC_CDC_ONLY_PID 0x010E //------------- UF2 -------------// -#define UF2_PRODUCT_NAME "Adafruit LED Glasses Driver nRF52840" -#define UF2_VOLUME_LABEL "GLASSESBOOT" -#define UF2_BOARD_ID "nRF52840-LedGlasses-revA" -#define UF2_INDEX_URL "https://www.adafruit.com/product/5217" +#define UF2_PRODUCT_NAME "Adafruit LED Glasses Driver nRF52840" +#define UF2_VOLUME_LABEL "GLASSESBOOT" +#define UF2_BOARD_ID "nRF52840-LedGlasses-revA" +#define UF2_INDEX_URL "https://www.adafruit.com/product/5217" #endif // _LEDGLASSES_NRF52840_H diff --git a/src/boards/m60_keyboard/board.h b/src/boards/m60_keyboard/board.h index 77371b14..057f1e35 100644 --- a/src/boards/m60_keyboard/board.h +++ b/src/boards/m60_keyboard/board.h @@ -25,52 +25,49 @@ #ifndef _MAKERDIARY_M60_KEYBOARD_H_ #define _MAKERDIARY_M60_KEYBOARD_H_ -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(0, 30) // Red -#define LED_STATE_ON 0 +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(0, 30) // Red +#define LED_STATE_ON 0 -#define LED_RGB_RED_PIN _PINNUM(0, 30) -#define LED_RGB_GREEN_PIN _PINNUM(0, 29) -#define LED_RGB_BLUE_PIN _PINNUM(0, 31) -#define BOARD_RGB_BRIGHTNESS 0x404040 +#define LED_RGB_RED_PIN PINNUM(0, 30) +#define LED_RGB_GREEN_PIN PINNUM(0, 29) +#define LED_RGB_BLUE_PIN PINNUM(0, 31) +#define BOARD_RGB_BRIGHTNESS 0x404040 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(0, 27) -#define BUTTON_2 _PINNUM(0, 19) // ESC -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(0, 27) +#define BUTTON_DFU_OTA PINNUM(0, 19) // ESC +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP /*------------------------------------------------------------------*/ /* On board regulator control *------------------------------------------------------------------*/ -#define LDO_CONTROL_PIN _PINNUM(0, 28) // Enables external pwr +#define LDO_CONTROL_PIN PINNUM(0, 28) // Enables external pwr //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Makerdiary" -#define BLEDIS_MODEL "M60 Mechanical Keyboard" +#define BLEDIS_MANUFACTURER "Makerdiary" +#define BLEDIS_MODEL "M60 Mechanical Keyboard" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x2886 -#define USB_DESC_UF2_PID 0xF00F -#define USB_DESC_CDC_ONLY_PID 0xF00F +#define USB_DESC_VID 0x2886 +#define USB_DESC_UF2_PID 0xF00F +#define USB_DESC_CDC_ONLY_PID 0xF00F //--------------------------------------------------------------------+ // UF2 //--------------------------------------------------------------------+ -#define UF2_PRODUCT_NAME "MakerDiary M60 Mechanical Keyboard" -#define UF2_VOLUME_LABEL "M60KEYBOARD" -#define UF2_BOARD_ID "M60KEYBOARD" -#define UF2_INDEX_URL "https://wiki.makerdiary.com/m60/" +#define UF2_PRODUCT_NAME "MakerDiary M60 Mechanical Keyboard" +#define UF2_VOLUME_LABEL "M60KEYBOARD" +#define UF2_BOARD_ID "M60KEYBOARD" +#define UF2_INDEX_URL "https://wiki.makerdiary.com/m60/" #endif /* _MAKERDIARY_M60_KEYBOARD_H_ */ diff --git a/src/boards/m60_keyboard/pinconfig.c b/src/boards/m60_keyboard/pinconfig.c index 1df7a6f8..d831386e 100644 --- a/src/boards/m60_keyboard/pinconfig.c +++ b/src/boards/m60_keyboard/pinconfig.c @@ -2,56 +2,60 @@ #include "board.h" #include "uf2/configkeys.h" -__attribute__((used, section(".bootloaderConfig"))) -const uint32_t bootloaderConfig[] = -{ +__attribute__((used, section(".bootloaderConfig"))) const uint32_t bootloaderConfig[] = { /* CF2 START */ - CFG_MAGIC0, CFG_MAGIC1, // magic - 5, 100, // used entries, total entries - - 204, 0x100000, // FLASH_BYTES = 0x100000 - 205, 0x40000, // RAM_BYTES = 0x40000 - 208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 - 209, 0xada52840, // UF2_FAMILY = 0xada52840 - 210, 0x20, // PINS_PORT_SIZE = PA_32 - - 0, 0, 0, 0, 0, 0, 0, 0 + CFG_MAGIC0, + CFG_MAGIC1, // magic + 5, + 100, // used entries, total entries + + 204, + 0x100000, // FLASH_BYTES = 0x100000 + 205, + 0x40000, // RAM_BYTES = 0x40000 + 208, + (USB_DESC_VID << 16) | + USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2 + 209, + 0xada52840, // UF2_FAMILY = 0xada52840 + 210, + 0x20, // PINS_PORT_SIZE = PA_32 + + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 /* CF2 END */ }; -static void power_on(void) -{ +static void power_on(void) { // Turn on the regulator nrf_gpio_cfg_output(LDO_CONTROL_PIN); nrf_gpio_pin_write(LDO_CONTROL_PIN, 1); } -void board_init2(void) -{ +void board_init2(void) { power_on(); - // configure P0.05 for ESC/BUTTON_2 + // configure P0.05 for ESC/BUTTON_DFU_OTA // P0.05 --- |<- --- / --- P0.19 // diode sw(esc) // mode: output, push-pull, low - nrf_gpio_cfg( - _PINNUM(0, 5), - NRF_GPIO_PIN_DIR_OUTPUT, - NRF_GPIO_PIN_INPUT_DISCONNECT, - NRF_GPIO_PIN_NOPULL, - NRF_GPIO_PIN_H0D1, - NRF_GPIO_PIN_NOSENSE - ); - nrf_gpio_pin_write(_PINNUM(0, 5), 0); + nrf_gpio_cfg(PINNUM(0, 5), NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT, NRF_GPIO_PIN_NOPULL, + NRF_GPIO_PIN_H0D1, NRF_GPIO_PIN_NOSENSE); + nrf_gpio_pin_write(PINNUM(0, 5), 0); // Wait the buttons stable. // This is mandatory, or the keyboard will enter bootloader whenever - // booted by pressing the button at back (same with BUTTON_1) + // booted by pressing the button at back (same with BUTTON_DFU) NRFX_DELAY_MS(300); } -void board_teardown2(void) -{ +void board_teardown2(void) { // re-enable the battery power_on(); -} \ No newline at end of file +} diff --git a/src/boards/mbn52832dk/board.h b/src/boards/mbn52832dk/board.h index c9fda306..0e38c192 100644 --- a/src/boards/mbn52832dk/board.h +++ b/src/boards/mbn52832dk/board.h @@ -1,63 +1,62 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2018 Ha Thach for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef _MBN52832DK_H -#define _MBN52832DK_H - -/*------------------------------------------------------------------*/ -/* LED - *------------------------------------------------------------------*/ -#define LEDS_NUMBER 2 -#define LED_PRIMARY_PIN 17 // LED1 -#define LED_SECONDARY_PIN 18 // LED2 -#define LED_STATE_ON 1 - -/*------------------------------------------------------------------*/ -/* BUTTON - *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 13 -#define BUTTON_2 14 -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP - -/*------------------------------------------------------------------*/ -/* UART (only used by nRF52832) - *------------------------------------------------------------------*/ -#define RX_PIN_NUMBER 8 -#define TX_PIN_NUMBER 6 -#define CTS_PIN_NUMBER 0 -#define RTS_PIN_NUMBER 0 -#define HWFC false - -//--------------------------------------------------------------------+ -// BLE OTA -//--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Murata" -#define BLEDIS_MODEL "MBN52832DK" - -#define UF2_BOARD_ID "nRF52832-MBN52832DK-v1" -#define UF2_PRODUCT_NAME "Murata MBN52832DK" -#define UF2_INDEX_URL "https://www.murata.com/ja-jp/products/connectivitymodule/bluetooth/overview/lineup/mbn52832" - -#endif // _MBN52832DK_H +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef _MBN52832DK_H +#define _MBN52832DK_H + +/*------------------------------------------------------------------*/ +/* LED + *------------------------------------------------------------------*/ +#define LEDS_NUMBER 2 +#define LED_PRIMARY_PIN 17 // LED1 +#define LED_SECONDARY_PIN 18 // LED2 +#define LED_STATE_ON 1 + +/*------------------------------------------------------------------*/ +/* BUTTON + *------------------------------------------------------------------*/ +#define BUTTON_DFU 13 +#define BUTTON_DFU_OTA 14 +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP + +/*------------------------------------------------------------------*/ +/* UART (only used by nRF52832) + *------------------------------------------------------------------*/ +#define RX_PIN_NUMBER 8 +#define TX_PIN_NUMBER 6 +#define CTS_PIN_NUMBER 0 +#define RTS_PIN_NUMBER 0 +#define HWFC false + +//--------------------------------------------------------------------+ +// BLE OTA +//--------------------------------------------------------------------+ +#define BLEDIS_MANUFACTURER "Murata" +#define BLEDIS_MODEL "MBN52832DK" + +#define UF2_BOARD_ID "nRF52832-MBN52832DK-v1" +#define UF2_PRODUCT_NAME "Murata MBN52832DK" +#define UF2_INDEX_URL "https://www.murata.com/ja-jp/products/connectivitymodule/bluetooth/overview/lineup/mbn52832" + +#endif // _MBN52832DK_H diff --git a/src/boards/mdk_nrf52840_dongle/board.h b/src/boards/mdk_nrf52840_dongle/board.h index 65284516..ab5d0e14 100644 --- a/src/boards/mdk_nrf52840_dongle/board.h +++ b/src/boards/mdk_nrf52840_dongle/board.h @@ -25,48 +25,45 @@ #ifndef _MDK_NRF52840_DONGLE_H_ #define _MDK_NRF52840_DONGLE_H_ -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 2 // TODO(gpshead): support 0. -#define LED_PRIMARY_PIN _PINNUM(0, 23) // Red -#define LED_SECONDARY_PIN _PINNUM(0, 24) // Blue -#define LED_STATE_ON 0 +#define LEDS_NUMBER 2 // TODO(gpshead): support 0. +#define LED_PRIMARY_PIN PINNUM(0, 23) // Red +#define LED_SECONDARY_PIN PINNUM(0, 24) // Blue +#define LED_STATE_ON 0 -//#define LED_RGB_RED_PIN _PINNUM(0, 23) -//#define LED_RGB_GREEN_PIN _PINNUM(0, 22) -//#define LED_RGB_BLUE_PIN _PINNUM(0, 24) -#define BOARD_RGB_BRIGHTNESS 0x404040 +// #define LED_RGB_RED_PIN PINNUM(0, 23) +// #define LED_RGB_GREEN_PIN PINNUM(0, 22) +// #define LED_RGB_BLUE_PIN PINNUM(0, 24) +#define BOARD_RGB_BRIGHTNESS 0x404040 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ // TODO(gpshead): simplify, have code support 0. double reset only. -#define BUTTONS_NUMBER 2 // none connected at all -#define BUTTON_1 _PINNUM(0, 18) // unusable: RESET -#define BUTTON_2 _PINNUM(0, 19) // no connection -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(0, 18) // unusable: RESET +#define BUTTON_DFU_OTA PINNUM(0, 19) // no connection +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "MakerDiary" -#define BLEDIS_MODEL "nRF52840 Micro Dev Kit USB Dongle" +#define BLEDIS_MANUFACTURER "MakerDiary" +#define BLEDIS_MODEL "nRF52840 Micro Dev Kit USB Dongle" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ // Shared VID/PID with Feather nRF52840, will be disabled for building in the future -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x0029 -#define USB_DESC_CDC_ONLY_PID 0x0029 +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x0029 +#define USB_DESC_CDC_ONLY_PID 0x0029 -#define UF2_PRODUCT_NAME "MDK nRF52840 USB Dongle" -#define UF2_VOLUME_LABEL "MDK840DONGL" -#define UF2_BOARD_ID "nRF52840-Dongle-v1" -#define UF2_INDEX_URL "https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/" +#define UF2_PRODUCT_NAME "MDK nRF52840 USB Dongle" +#define UF2_VOLUME_LABEL "MDK840DONGL" +#define UF2_BOARD_ID "nRF52840-Dongle-v1" +#define UF2_INDEX_URL "https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/" #endif /* _MDK_NRF52840_DONGLE_H_ */ diff --git a/src/boards/metro_nrf52840_express/board.h b/src/boards/metro_nrf52840_express/board.h index 0b47a1c6..0c058384 100644 --- a/src/boards/metro_nrf52840_express/board.h +++ b/src/boards/metro_nrf52840_express/board.h @@ -25,46 +25,43 @@ #ifndef _METRO_NRF52840_H_ #define _METRO_NRF52840_H_ -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 2 -#define LED_PRIMARY_PIN _PINNUM(1, 13) -#define LED_SECONDARY_PIN _PINNUM(1, 15) -#define LED_STATE_ON 1 +#define LEDS_NUMBER 2 +#define LED_PRIMARY_PIN PINNUM(1, 13) +#define LED_SECONDARY_PIN PINNUM(1, 15) +#define LED_STATE_ON 1 -#define LED_NEOPIXEL _PINNUM(0, 13) -#define NEOPIXELS_NUMBER 1 -#define BOARD_RGB_BRIGHTNESS 0x040404 +#define LED_NEOPIXEL PINNUM(0, 13) +#define NEOPIXELS_NUMBER 1 +#define BOARD_RGB_BRIGHTNESS 0x040404 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(1, 0) -#define BUTTON_2 _PINNUM(2, 2) -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(1, 0) +#define BUTTON_DFU_OTA PINNUM(2, 2) +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Adafruit Industries" -#define BLEDIS_MODEL "Metro nRF52840 Express" +#define BLEDIS_MANUFACTURER "Adafruit Industries" +#define BLEDIS_MODEL "Metro nRF52840 Express" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x003F -#define USB_DESC_CDC_ONLY_PID 0x0040 +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x003F +#define USB_DESC_CDC_ONLY_PID 0x0040 //------------- UF2 -------------// -#define UF2_PRODUCT_NAME "Adafruit Metro nRF52840 Express" -#define UF2_VOLUME_LABEL "METR840BOOT" -#define UF2_BOARD_ID "nRF52840-Metro-revA" +#define UF2_PRODUCT_NAME "Adafruit Metro nRF52840 Express" +#define UF2_VOLUME_LABEL "METR840BOOT" +#define UF2_BOARD_ID "nRF52840-Metro-revA" -#define UF2_INDEX_URL "https://www.adafruit.com/" +#define UF2_INDEX_URL "https://www.adafruit.com/" #endif /* _METRO_NRF52840_H_ */ diff --git a/src/boards/mikoto/board.h b/src/boards/mikoto/board.h index 6431f67c..9882893d 100644 --- a/src/boards/mikoto/board.h +++ b/src/boards/mikoto/board.h @@ -25,41 +25,38 @@ #ifndef _MIKOTO_H #define _MIKOTO_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - #define UICR_REGOUT0_VALUE UICR_REGOUT0_VOUT_3V3 /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(0, 15) // Blue -#define LED_STATE_ON 1 +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(0, 15) // Blue +#define LED_STATE_ON 1 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 // none connected at all -#define BUTTON_1 _PINNUM(0, 18) // unusable: RESET -#define BUTTON_2 _PINNUM(0, 19) // no connection -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(0, 18) // unusable: RESET +#define BUTTON_DFU_OTA PINNUM(0, 19) // no connection +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "zhiayang" -#define BLEDIS_MODEL "mikoto" +#define BLEDIS_MANUFACTURER "zhiayang" +#define BLEDIS_MODEL "mikoto" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x1209 -#define USB_DESC_UF2_PID 0x7A01 -#define USB_DESC_CDC_ONLY_PID 0x7A01 - -#define UF2_PRODUCT_NAME "Mikoto nRF52840" -#define UF2_VOLUME_LABEL "MIKOTO-BOOT" -#define UF2_BOARD_ID "nRF52840-mikoto-rev520" -#define UF2_INDEX_URL "https://github.com/zhiayang/mikoto" +#define USB_DESC_VID 0x1209 +#define USB_DESC_UF2_PID 0x7A01 +#define USB_DESC_CDC_ONLY_PID 0x7A01 + +#define UF2_PRODUCT_NAME "Mikoto nRF52840" +#define UF2_VOLUME_LABEL "MIKOTO-BOOT" +#define UF2_BOARD_ID "nRF52840-mikoto-rev520" +#define UF2_INDEX_URL "https://github.com/zhiayang/mikoto" #endif // _MIKOTO_H diff --git a/src/boards/nRF52840_connect_kit/board.h b/src/boards/nRF52840_connect_kit/board.h index 37409284..9bb02ab9 100644 --- a/src/boards/nRF52840_connect_kit/board.h +++ b/src/boards/nRF52840_connect_kit/board.h @@ -25,47 +25,44 @@ #ifndef _MAKERDIARY_NRF82540_CONNECT_KIT_H_ #define _MAKERDIARY_NRF82540_CONNECT_KIT_H_ -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(1, 15) // Green -#define LED_STATE_ON 0 +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(1, 15) // Green +#define LED_STATE_ON 0 -#define LED_RGB_RED_PIN _PINNUM(1, 10) -#define LED_RGB_GREEN_PIN _PINNUM(1, 11) -#define LED_RGB_BLUE_PIN _PINNUM(1, 12) -#define BOARD_RGB_BRIGHTNESS 0x404040 +#define LED_RGB_RED_PIN PINNUM(1, 10) +#define LED_RGB_GREEN_PIN PINNUM(1, 11) +#define LED_RGB_BLUE_PIN PINNUM(1, 12) +#define BOARD_RGB_BRIGHTNESS 0x404040 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(1, 0) // P1.00: User Button -#define BUTTON_2 _PINNUM(1, 7) // P1.07: NC -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(1, 0) // P1.00: User Button +#define BUTTON_DFU_OTA PINNUM(1, 7) // P1.07: NC +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Makerdiary" -#define BLEDIS_MODEL "nRF52840 Connect Kit" +#define BLEDIS_MANUFACTURER "Makerdiary" +#define BLEDIS_MODEL "nRF52840 Connect Kit" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x2886 -#define USB_DESC_UF2_PID 0xF00F -#define USB_DESC_CDC_ONLY_PID 0xF00F +#define USB_DESC_VID 0x2886 +#define USB_DESC_UF2_PID 0xF00F +#define USB_DESC_CDC_ONLY_PID 0xF00F //--------------------------------------------------------------------+ // UF2 //--------------------------------------------------------------------+ -#define UF2_PRODUCT_NAME "nRF52840 Connect Kit" -#define UF2_VOLUME_LABEL "CONNECTKIT" -#define UF2_BOARD_ID "nRF52840-Connect-Kit" -#define UF2_INDEX_URL "https://wiki.makerdiary.com/nrf52840-connectkit/" +#define UF2_PRODUCT_NAME "nRF52840 Connect Kit" +#define UF2_VOLUME_LABEL "CONNECTKIT" +#define UF2_BOARD_ID "nRF52840-Connect-Kit" +#define UF2_INDEX_URL "https://wiki.makerdiary.com/nrf52840-connectkit/" #endif /* _MAKERDIARY_NRF82540_CONNECT_KIT_H_ */ diff --git a/src/boards/nice_nano/board.h b/src/boards/nice_nano/board.h index d70dc535..3196ae1f 100644 --- a/src/boards/nice_nano/board.h +++ b/src/boards/nice_nano/board.h @@ -25,39 +25,36 @@ #ifndef _NICENANO_H #define _NICENANO_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - #define UICR_REGOUT0_VALUE UICR_REGOUT0_VOUT_3V3 /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(0, 15) // Blue -#define LED_STATE_ON 1 +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(0, 15) // Blue +#define LED_STATE_ON 1 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 0 // none connected at all -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +// This board has no buttons //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Nice Keyboards" -#define BLEDIS_MODEL "nice!nano" +#define BLEDIS_MANUFACTURER "Nice Keyboards" +#define BLEDIS_MODEL "nice!nano" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x00B3 -#define USB_DESC_CDC_ONLY_PID 0x00B3 - -#define UF2_PRODUCT_NAME "nice!nano" -#define UF2_VOLUME_LABEL "NICENANO" -#define UF2_BOARD_ID "nRF52840-nicenano" -#define UF2_INDEX_URL "https://nicekeyboards.com/docs/nice-nano" +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x00B3 +#define USB_DESC_CDC_ONLY_PID 0x00B3 + +#define UF2_PRODUCT_NAME "nice!nano" +#define UF2_VOLUME_LABEL "NICENANO" +#define UF2_BOARD_ID "nRF52840-nicenano" +#define UF2_INDEX_URL "https://nicekeyboards.com/docs/nice-nano" #endif // _NICENANO_H diff --git a/src/boards/nrf52840_bboard/board.h b/src/boards/nrf52840_bboard/board.h index 515201d0..2c1977ed 100644 --- a/src/boards/nrf52840_bboard/board.h +++ b/src/boards/nrf52840_bboard/board.h @@ -25,14 +25,12 @@ #ifndef _NRF52840_BBOARD_H #define _NRF52840_BBOARD_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(0, 7) -#define LED_STATE_ON 1 +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(0, 7) +#define LED_STATE_ON 1 /*------------------------------------------------------------------*/ /* BUTTON @@ -41,28 +39,27 @@ // App can trigger OTA bootloader by writing DFU_MAGIC_OTA_APPJUM to // GPREGRET register if softdevice is not initialized; or by // writing DFU_MAGIC_OTA_RESET in case softdevice is initialized. -#define BUTTONS_NUMBER 2 -#define BUTTON_1 18 // RESET also by default -#define BUTTON_2 1 // P0.1 not exposed anywhere, FRST n/a -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU 18 // RESET also by default +#define BUTTON_DFU_OTA 1 // P0.1 not exposed anywhere, FRST n/a +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "ddB0515" -#define BLEDIS_MODEL "nRF52840 BBoard" +#define BLEDIS_MANUFACTURER "ddB0515" +#define BLEDIS_MODEL "nRF52840 BBoard" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x1d50 -#define USB_DESC_UF2_PID 0x6157 -#define USB_DESC_CDC_ONLY_PID 0x6157 +#define USB_DESC_VID 0x1d50 +#define USB_DESC_UF2_PID 0x6157 +#define USB_DESC_CDC_ONLY_PID 0x6157 //------------- UF2 -------------// -#define UF2_PRODUCT_NAME "nRF52840 BBoard" -#define UF2_VOLUME_LABEL "BBOARDBOOT" -#define UF2_BOARD_ID "nRF52840-BBoard-rev2" -#define UF2_INDEX_URL "https://github.com/ddB0515/nRF52840-BBoard" +#define UF2_PRODUCT_NAME "nRF52840 BBoard" +#define UF2_VOLUME_LABEL "BBOARDBOOT" +#define UF2_BOARD_ID "nRF52840-BBoard-rev2" +#define UF2_INDEX_URL "https://github.com/ddB0515/nRF52840-BBoard" #endif // _NRF52840_BBOARD_H diff --git a/src/boards/nrf52840_m2/board.h b/src/boards/nrf52840_m2/board.h index 57265abe..c093f5dc 100644 --- a/src/boards/nrf52840_m2/board.h +++ b/src/boards/nrf52840_m2/board.h @@ -25,48 +25,45 @@ #ifndef _MAKERDIARY_NRF52840_M2_H_ #define _MAKERDIARY_NRF52840_M2_H_ -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(0, 30) // Red -#define LED_DOCK_GREEN_PIN _PINNUM(1, 7) // Only available on the M.2 Dock -#define LED_STATE_ON 0 +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(0, 30) // Red +#define LED_DOCK_GREEN_PIN PINNUM(1, 7) // Only available on the M.2 Dock +#define LED_STATE_ON 0 -#define LED_RGB_RED_PIN _PINNUM(0, 30) -#define LED_RGB_GREEN_PIN _PINNUM(0, 29) -#define LED_RGB_BLUE_PIN _PINNUM(0, 31) -#define BOARD_RGB_BRIGHTNESS 0x404040 +#define LED_RGB_RED_PIN PINNUM(0, 30) +#define LED_RGB_GREEN_PIN PINNUM(0, 29) +#define LED_RGB_BLUE_PIN PINNUM(0, 31) +#define BOARD_RGB_BRIGHTNESS 0x404040 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(0, 19) -#define BUTTON_2 _PINNUM(1, 7) -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(0, 19) +#define BUTTON_DFU_OTA PINNUM(1, 7) +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Makerdiary" -#define BLEDIS_MODEL "nRF52840 M.2" +#define BLEDIS_MANUFACTURER "Makerdiary" +#define BLEDIS_MODEL "nRF52840 M.2" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x2886 -#define USB_DESC_UF2_PID 0xF00F -#define USB_DESC_CDC_ONLY_PID 0xF00F +#define USB_DESC_VID 0x2886 +#define USB_DESC_UF2_PID 0xF00F +#define USB_DESC_CDC_ONLY_PID 0xF00F //--------------------------------------------------------------------+ // UF2 //--------------------------------------------------------------------+ -#define UF2_PRODUCT_NAME "MakerDiary nRF52840 M.2 Module" -#define UF2_VOLUME_LABEL "nRF52840M2" -#define UF2_BOARD_ID "nRF52840M2" -#define UF2_INDEX_URL "https://wiki.makerdiary.com/nrf52840-m2" +#define UF2_PRODUCT_NAME "MakerDiary nRF52840 M.2 Module" +#define UF2_VOLUME_LABEL "nRF52840M2" +#define UF2_BOARD_ID "nRF52840M2" +#define UF2_INDEX_URL "https://wiki.makerdiary.com/nrf52840-m2" #endif /* _MAKERDIARY_NRF52840_M2_H_ */ diff --git a/src/boards/nrfmicro/board.h b/src/boards/nrfmicro/board.h index c6b25288..78507e30 100644 --- a/src/boards/nrfmicro/board.h +++ b/src/boards/nrfmicro/board.h @@ -1,66 +1,63 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2018 Ha Thach for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef _NRFMICRO_NRF52840 -#define _NRFMICRO_NRF52840 - -#define _PINNUM(port, pin) ((port)*32 + (pin)) - -/*------------------------------------------------------------------*/ -/* LED - *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(1, 10) -#define LED_STATE_ON 1 // State when LED is lit (active HIGH) - -#define NEOPIXELS_NUMBER 0 - -/*------------------------------------------------------------------*/ -/* BUTTON - *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(1, 2) // DFU -#define BUTTON_2 _PINNUM(0, 12) // FRST -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP - -//--------------------------------------------------------------------+ -// BLE OTA -//--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "nRFMicro" -#define BLEDIS_MODEL "nRFMicro nRF52840" - -//--------------------------------------------------------------------+ -// USB -//--------------------------------------------------------------------+ -#define USB_DESC_VID 0x1209 -#define USB_DESC_UF2_PID 0x5284 -#define USB_DESC_CDC_ONLY_PID 0x5284 - -//------------- UF2 -------------// -#define UF2_PRODUCT_NAME "nRFMicro" -#define UF2_VOLUME_LABEL "NRFMICRO" -#define UF2_BOARD_ID "nRF52840-nRFMicro-v0" -#define UF2_INDEX_URL "https://github.com/joric/nrfmicro/wiki" - -#endif // _NRFMICRO_NRF52840 +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef _NRFMICRO_NRF52840 +#define _NRFMICRO_NRF52840 + +/*------------------------------------------------------------------*/ +/* LED + *------------------------------------------------------------------*/ +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(1, 10) +#define LED_STATE_ON 1 // State when LED is lit (active HIGH) + +#define NEOPIXELS_NUMBER 0 + +/*------------------------------------------------------------------*/ +/* BUTTON + *------------------------------------------------------------------*/ +#define BUTTON_DFU PINNUM(1, 2) // DFU +#define BUTTON_DFU_OTA PINNUM(0, 12) // FRST +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP + +//--------------------------------------------------------------------+ +// BLE OTA +//--------------------------------------------------------------------+ +#define BLEDIS_MANUFACTURER "nRFMicro" +#define BLEDIS_MODEL "nRFMicro nRF52840" + +//--------------------------------------------------------------------+ +// USB +//--------------------------------------------------------------------+ +#define USB_DESC_VID 0x1209 +#define USB_DESC_UF2_PID 0x5284 +#define USB_DESC_CDC_ONLY_PID 0x5284 + +//------------- UF2 -------------// +#define UF2_PRODUCT_NAME "nRFMicro" +#define UF2_VOLUME_LABEL "NRFMICRO" +#define UF2_BOARD_ID "nRF52840-nRFMicro-v0" +#define UF2_INDEX_URL "https://github.com/joric/nrfmicro/wiki" + +#endif // _NRFMICRO_NRF52840 diff --git a/src/boards/ohs2020_badge/board.h b/src/boards/ohs2020_badge/board.h index 1a628111..a6cc9430 100644 --- a/src/boards/ohs2020_badge/board.h +++ b/src/boards/ohs2020_badge/board.h @@ -26,40 +26,37 @@ #ifndef _OHS2020_BADGE_H #define _OHS2020_BADGE_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(0, 04) // fake LED since we have none -#define LED_STATE_ON 1 +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(0, 04) // fake LED since we have none +#define LED_STATE_ON 1 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(0, 29) // SW2 -#define BUTTON_2 _PINNUM(0, 03) // SW1 -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(0, 29) // SW2 +#define BUTTON_DFU_OTA PINNUM(0, 03) // SW1 +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "OSHWA" -#define BLEDIS_MODEL "OHS2020 Badge" +#define BLEDIS_MANUFACTURER "OSHWA" +#define BLEDIS_MODEL "OHS2020 Badge" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x007F -#define USB_DESC_CDC_ONLY_PID 0x007F +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x007F +#define USB_DESC_CDC_ONLY_PID 0x007F //------------- UF2 -------------// -#define UF2_PRODUCT_NAME "OHS2020 Badge" -#define UF2_VOLUME_LABEL "BADGEBOOT" -#define UF2_BOARD_ID "OHS2020-Badge-revA" -#define UF2_INDEX_URL "https://2020.oshwa.org/" +#define UF2_PRODUCT_NAME "OHS2020 Badge" +#define UF2_VOLUME_LABEL "BADGEBOOT" +#define UF2_BOARD_ID "OHS2020-Badge-revA" +#define UF2_INDEX_URL "https://2020.oshwa.org/" #endif // _OHS2020_BADGE_H diff --git a/src/boards/omnimo_nrf52840/board.h b/src/boards/omnimo_nrf52840/board.h index 0a3b710f..c26c811a 100644 --- a/src/boards/omnimo_nrf52840/board.h +++ b/src/boards/omnimo_nrf52840/board.h @@ -1,72 +1,69 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2018 Ha Thach for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef _OMNIMO_NRF52840_H -#define _OMNIMO_NRF52840_H - -#define _PINNUM(port, pin) ((port)*32 + (pin)) - -/*------------------------------------------------------------------*/ -/* LED - *------------------------------------------------------------------*/ -#define LEDS_NUMBER 2 -#define LED_PRIMARY_PIN _PINNUM(1, 15) -#define LED_SECONDARY_PIN _PINNUM(1, 10) -#define LED_STATE_ON 1 - -#define LED_NEOPIXEL _PINNUM(0, 16) - -#define NEOPIXELS_NUMBER 1 -#define BOARD_RGB_BRIGHTNESS 0x040404 - -/*------------------------------------------------------------------*/ -/* BUTTON - *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(1, 02) -#define BUTTON_2 _PINNUM(1, 07) -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP - -//--------------------------------------------------------------------+ -// BLE OTA -//--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "eAFAQ" -#define BLEDIS_MODEL "OMNIMO nRF52840" - -//--------------------------------------------------------------------+ -// USB -//--------------------------------------------------------------------+ - -//Shared VID/PID with pca10056 -#define USB_DESC_VID 0x1209 -#define USB_DESC_UF2_PID 0xCECE -#define USB_DESC_CDC_ONLY_PID 0xCECE - -//------------- UF2 -------------// -#define UF2_PRODUCT_NAME "Omnimo nRF52840" -#define UF2_VOLUME_LABEL "OMNIn52BOOT" -#define UF2_BOARD_ID "nRF52840-Omnimo" -#define UF2_INDEX_URL "https://www.crowdsupply.com/eafaq/omnimo-nrf52840" - -#endif // _OMNIMO_NRF52840_H +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef _OMNIMO_NRF52840_H +#define _OMNIMO_NRF52840_H + +/*------------------------------------------------------------------*/ +/* LED + *------------------------------------------------------------------*/ +#define LEDS_NUMBER 2 +#define LED_PRIMARY_PIN PINNUM(1, 15) +#define LED_SECONDARY_PIN PINNUM(1, 10) +#define LED_STATE_ON 1 + +#define LED_NEOPIXEL PINNUM(0, 16) + +#define NEOPIXELS_NUMBER 1 +#define BOARD_RGB_BRIGHTNESS 0x040404 + +/*------------------------------------------------------------------*/ +/* BUTTON + *------------------------------------------------------------------*/ +#define BUTTON_DFU PINNUM(1, 02) +#define BUTTON_DFU_OTA PINNUM(1, 07) +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP + +//--------------------------------------------------------------------+ +// BLE OTA +//--------------------------------------------------------------------+ +#define BLEDIS_MANUFACTURER "eAFAQ" +#define BLEDIS_MODEL "OMNIMO nRF52840" + +//--------------------------------------------------------------------+ +// USB +//--------------------------------------------------------------------+ + +// Shared VID/PID with pca10056 +#define USB_DESC_VID 0x1209 +#define USB_DESC_UF2_PID 0xCECE +#define USB_DESC_CDC_ONLY_PID 0xCECE + +//------------- UF2 -------------// +#define UF2_PRODUCT_NAME "Omnimo nRF52840" +#define UF2_VOLUME_LABEL "OMNIn52BOOT" +#define UF2_BOARD_ID "nRF52840-Omnimo" +#define UF2_INDEX_URL "https://www.crowdsupply.com/eafaq/omnimo-nrf52840" + +#endif // _OMNIMO_NRF52840_H diff --git a/src/boards/particle_argon/board.h b/src/boards/particle_argon/board.h index 1f31d931..b210606c 100644 --- a/src/boards/particle_argon/board.h +++ b/src/boards/particle_argon/board.h @@ -1,70 +1,67 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef _PARTICLE_ARGON_H -#define _PARTICLE_ARGON_H - -#define _PINNUM(port, pin) ((port)*32 + (pin)) - -/*------------------------------------------------------------------*/ -/* LED - *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(1, 12) -#define LED_STATE_ON 1 - -#define LED_RGB_RED_PIN _PINNUM(0, 13) -#define LED_RGB_GREEN_PIN _PINNUM(0, 14) -#define LED_RGB_BLUE_PIN _PINNUM(0, 15) -#define BOARD_RGB_BRIGHTNESS 0x202020 - -/*------------------------------------------------------------------*/ -/* BUTTON - *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_DFU _PINNUM(0, 11) -#define BUTTON_FRESET _PINNUM(0, 03) // A0 -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP - -//--------------------------------------------------------------------+ -// BLE OTA -//--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Particle Industries" -#define BLEDIS_MODEL "Argon" - -//--------------------------------------------------------------------+ -// USB -//--------------------------------------------------------------------+ - -// Shared VID/PID with pca10056 -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x00DA -#define USB_DESC_CDC_ONLY_PID 0x00DA - -#define UF2_PRODUCT_NAME "Particle Argon" -#define UF2_VOLUME_LABEL "ARGONBOOT " -#define UF2_BOARD_ID "nRF52840-Argon-v1" -#define UF2_INDEX_URL "https://www.particle.io/mesh/" - -#endif // _PARTICLE_ARGON_H +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef _PARTICLE_ARGON_H +#define _PARTICLE_ARGON_H + +/*------------------------------------------------------------------*/ +/* LED + *------------------------------------------------------------------*/ +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(1, 12) +#define LED_STATE_ON 1 + +#define LED_RGB_RED_PIN PINNUM(0, 13) +#define LED_RGB_GREEN_PIN PINNUM(0, 14) +#define LED_RGB_BLUE_PIN PINNUM(0, 15) +#define BOARD_RGB_BRIGHTNESS 0x202020 + +/*------------------------------------------------------------------*/ +/* BUTTON + *------------------------------------------------------------------*/ +#define BUTTON_DFU PINNUM(0, 11) +#define BUTTON_DFU_OTA PINNUM(0, 03) // A0 +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP + +//--------------------------------------------------------------------+ +// BLE OTA +//--------------------------------------------------------------------+ +#define BLEDIS_MANUFACTURER "Particle Industries" +#define BLEDIS_MODEL "Argon" + +//--------------------------------------------------------------------+ +// USB +//--------------------------------------------------------------------+ + +// Shared VID/PID with pca10056 +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x00DA +#define USB_DESC_CDC_ONLY_PID 0x00DA + +#define UF2_PRODUCT_NAME "Particle Argon" +#define UF2_VOLUME_LABEL "ARGONBOOT " +#define UF2_BOARD_ID "nRF52840-Argon-v1" +#define UF2_INDEX_URL "https://www.particle.io/mesh/" + +#endif // _PARTICLE_ARGON_H diff --git a/src/boards/particle_boron/board.h b/src/boards/particle_boron/board.h index ee5236af..49cc6d50 100644 --- a/src/boards/particle_boron/board.h +++ b/src/boards/particle_boron/board.h @@ -1,70 +1,67 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef _PARTICLE_BORON_H -#define _PARTICLE_BORON_H - -#define _PINNUM(port, pin) ((port)*32 + (pin)) - -/*------------------------------------------------------------------*/ -/* LED - *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(1, 12) -#define LED_STATE_ON 1 - -#define LED_RGB_RED_PIN _PINNUM(0, 13) -#define LED_RGB_GREEN_PIN _PINNUM(0, 14) -#define LED_RGB_BLUE_PIN _PINNUM(0, 15) -#define BOARD_RGB_BRIGHTNESS 0x202020 - -/*------------------------------------------------------------------*/ -/* BUTTON - *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_DFU _PINNUM(0, 11) -#define BUTTON_FRESET _PINNUM(0, 03) // A0 -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP - -//--------------------------------------------------------------------+ -// BLE OTA -//--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Particle Industries" -#define BLEDIS_MODEL "Boron" - -//--------------------------------------------------------------------+ -// USB -//--------------------------------------------------------------------+ - -// Shared VID/PID with pca10056 -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x00DA -#define USB_DESC_CDC_ONLY_PID 0x00DA - -#define UF2_PRODUCT_NAME "Particle Boron" -#define UF2_VOLUME_LABEL "BORONBOOT " -#define UF2_BOARD_ID "nRF52840-Boron-v1" -#define UF2_INDEX_URL "https://www.particle.io/mesh/" - -#endif // _PARTICLE_BORON_H +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef _PARTICLE_BORON_H +#define _PARTICLE_BORON_H + +/*------------------------------------------------------------------*/ +/* LED + *------------------------------------------------------------------*/ +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(1, 12) +#define LED_STATE_ON 1 + +#define LED_RGB_RED_PIN PINNUM(0, 13) +#define LED_RGB_GREEN_PIN PINNUM(0, 14) +#define LED_RGB_BLUE_PIN PINNUM(0, 15) +#define BOARD_RGB_BRIGHTNESS 0x202020 + +/*------------------------------------------------------------------*/ +/* BUTTON + *------------------------------------------------------------------*/ +#define BUTTON_DFU PINNUM(0, 11) +#define BUTTON_DFU_OTA PINNUM(0, 03) // A0 +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP + +//--------------------------------------------------------------------+ +// BLE OTA +//--------------------------------------------------------------------+ +#define BLEDIS_MANUFACTURER "Particle Industries" +#define BLEDIS_MODEL "Boron" + +//--------------------------------------------------------------------+ +// USB +//--------------------------------------------------------------------+ + +// Shared VID/PID with pca10056 +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x00DA +#define USB_DESC_CDC_ONLY_PID 0x00DA + +#define UF2_PRODUCT_NAME "Particle Boron" +#define UF2_VOLUME_LABEL "BORONBOOT " +#define UF2_BOARD_ID "nRF52840-Boron-v1" +#define UF2_INDEX_URL "https://www.particle.io/mesh/" + +#endif // _PARTICLE_BORON_H diff --git a/src/boards/particle_xenon/board.h b/src/boards/particle_xenon/board.h index 3c778281..5584bad4 100644 --- a/src/boards/particle_xenon/board.h +++ b/src/boards/particle_xenon/board.h @@ -1,70 +1,67 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef _PARTICLE_XENON_H -#define _PARTICLE_XENON_H - -#define _PINNUM(port, pin) ((port)*32 + (pin)) - -/*------------------------------------------------------------------*/ -/* LED - *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(1, 12) -#define LED_STATE_ON 1 - -#define LED_RGB_RED_PIN _PINNUM(0, 13) -#define LED_RGB_GREEN_PIN _PINNUM(0, 14) -#define LED_RGB_BLUE_PIN _PINNUM(0, 15) -#define BOARD_RGB_BRIGHTNESS 0x202020 - -/*------------------------------------------------------------------*/ -/* BUTTON - *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_DFU _PINNUM(0, 11) -#define BUTTON_FRESET _PINNUM(0, 03) // A0 -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP - -//--------------------------------------------------------------------+ -// BLE OTA -//--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Particle Industries" -#define BLEDIS_MODEL "Xenon" - -//--------------------------------------------------------------------+ -// USB -//--------------------------------------------------------------------+ - -// Shared VID/PID with pca10056 -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x00DA -#define USB_DESC_CDC_ONLY_PID 0x00DA - -#define UF2_PRODUCT_NAME "Particle Xenon" -#define UF2_VOLUME_LABEL "XENONBOOT " -#define UF2_BOARD_ID "nRF52840-Xenon-v1" -#define UF2_INDEX_URL "https://www.particle.io/mesh/" - -#endif // _PARTICLE_XENON_H +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef _PARTICLE_XENON_H +#define _PARTICLE_XENON_H + +/*------------------------------------------------------------------*/ +/* LED + *------------------------------------------------------------------*/ +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(1, 12) +#define LED_STATE_ON 1 + +#define LED_RGB_RED_PIN PINNUM(0, 13) +#define LED_RGB_GREEN_PIN PINNUM(0, 14) +#define LED_RGB_BLUE_PIN PINNUM(0, 15) +#define BOARD_RGB_BRIGHTNESS 0x202020 + +/*------------------------------------------------------------------*/ +/* BUTTON + *------------------------------------------------------------------*/ +#define BUTTON_DFU PINNUM(0, 11) +#define BUTTON_DFU_OTA PINNUM(0, 03) // A0 +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP + +//--------------------------------------------------------------------+ +// BLE OTA +//--------------------------------------------------------------------+ +#define BLEDIS_MANUFACTURER "Particle Industries" +#define BLEDIS_MODEL "Xenon" + +//--------------------------------------------------------------------+ +// USB +//--------------------------------------------------------------------+ + +// Shared VID/PID with pca10056 +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x00DA +#define USB_DESC_CDC_ONLY_PID 0x00DA + +#define UF2_PRODUCT_NAME "Particle Xenon" +#define UF2_VOLUME_LABEL "XENONBOOT " +#define UF2_BOARD_ID "nRF52840-Xenon-v1" +#define UF2_INDEX_URL "https://www.particle.io/mesh/" + +#endif // _PARTICLE_XENON_H diff --git a/src/boards/pca10056/board.h b/src/boards/pca10056/board.h index 51dc2fb2..08269bf6 100644 --- a/src/boards/pca10056/board.h +++ b/src/boards/pca10056/board.h @@ -28,36 +28,35 @@ /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 2 -#define LED_PRIMARY_PIN 13 -#define LED_SECONDARY_PIN 14 -#define LED_STATE_ON 0 +#define LEDS_NUMBER 2 +#define LED_PRIMARY_PIN 13 +#define LED_SECONDARY_PIN 14 +#define LED_STATE_ON 0 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 11 -#define BUTTON_2 12 -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU 11 +#define BUTTON_DFU_OTA 12 +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Nordic" -#define BLEDIS_MODEL "PCA10056" +#define BLEDIS_MANUFACTURER "Nordic" +#define BLEDIS_MODEL "PCA10056" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ // Shared VID/PID with Feather nRF52840, will be disabled for building in the future -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x00DA -#define USB_DESC_CDC_ONLY_PID 0x00DA +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x00DA +#define USB_DESC_CDC_ONLY_PID 0x00DA -#define UF2_PRODUCT_NAME "Nordic nRF52840 DK" -#define UF2_BOARD_ID "nRF52840-pca10056-v1" -#define UF2_INDEX_URL "https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-DK" +#define UF2_PRODUCT_NAME "Nordic nRF52840 DK" +#define UF2_BOARD_ID "nRF52840-pca10056-v1" +#define UF2_INDEX_URL "https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-DK" #endif // PCA10056_H diff --git a/src/boards/pca10059/board.h b/src/boards/pca10059/board.h index 8b2d89d9..88c2f41a 100644 --- a/src/boards/pca10059/board.h +++ b/src/boards/pca10059/board.h @@ -25,42 +25,39 @@ #ifndef PCA10059_H #define PCA10059_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ #define LEDS_NUMBER 2 -#define LED_PRIMARY_PIN 6 // Red +#define LED_PRIMARY_PIN 6 // Red #define LED_SECONDARY_PIN 12 // Blue #define LED_STATE_ON 0 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(1, 6) -#define BUTTON_2 _PINNUM(1, 10) +#define BUTTON_DFU PINNUM(1, 6) +#define BUTTON_DFU_OTA PINNUM(1, 10) #define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Nordic" -#define BLEDIS_MODEL "PCA10059" +#define BLEDIS_MANUFACTURER "Nordic" +#define BLEDIS_MODEL "PCA10059" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ // Shared VID/PID with Feather nRF52840, will be disabled for building in the future -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x0029 -#define USB_DESC_CDC_ONLY_PID 0x0029 +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x0029 +#define USB_DESC_CDC_ONLY_PID 0x0029 -#define UF2_PRODUCT_NAME "Nordic nRF52840 Dongle" -#define UF2_BOARD_ID "nRF52840-pca10059-v1" -#define UF2_INDEX_URL "https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-Dongle" +#define UF2_PRODUCT_NAME "Nordic nRF52840 Dongle" +#define UF2_BOARD_ID "nRF52840-pca10059-v1" +#define UF2_INDEX_URL "https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-Dongle" #endif // PCA10059_H diff --git a/src/boards/pca10100/board.h b/src/boards/pca10100/board.h index e96b11c8..5be1366e 100644 --- a/src/boards/pca10100/board.h +++ b/src/boards/pca10100/board.h @@ -28,35 +28,34 @@ /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 2 -#define LED_PRIMARY_PIN 13 -#define LED_SECONDARY_PIN 14 -#define LED_STATE_ON 0 +#define LEDS_NUMBER 2 +#define LED_PRIMARY_PIN 13 +#define LED_SECONDARY_PIN 14 +#define LED_STATE_ON 0 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 11 -#define BUTTON_2 12 -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU 11 +#define BUTTON_DFU_OTA 12 +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Nordic" -#define BLEDIS_MODEL "PCA10100" +#define BLEDIS_MANUFACTURER "Nordic" +#define BLEDIS_MODEL "PCA10100" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x00D8 -#define USB_DESC_CDC_ONLY_PID 0x00D8 +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x00D8 +#define USB_DESC_CDC_ONLY_PID 0x00D8 -#define UF2_PRODUCT_NAME "Nordic nRF52833 DK" -#define UF2_VOLUME_LABEL "NRF833BOOT" -#define UF2_BOARD_ID "nRF52833-pca10100-v1" -#define UF2_INDEX_URL "https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52833-DK" +#define UF2_PRODUCT_NAME "Nordic nRF52833 DK" +#define UF2_VOLUME_LABEL "NRF833BOOT" +#define UF2_BOARD_ID "nRF52833-pca10100-v1" +#define UF2_INDEX_URL "https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52833-DK" #endif // PCA10100_H diff --git a/src/boards/pillbug/board.h b/src/boards/pillbug/board.h index 7acb62cb..1d442c5c 100644 --- a/src/boards/pillbug/board.h +++ b/src/boards/pillbug/board.h @@ -25,41 +25,38 @@ #ifndef _PillBug_H #define _PillBug_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - #define UICR_REGOUT0_VALUE UICR_REGOUT0_VOUT_3V3 /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(0, 20) // Blue -#define LED_STATE_ON 1 +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(0, 20) // Blue +#define LED_STATE_ON 1 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 // none connected at all -#define BUTTON_1 _PINNUM(0, 18) // unusable: RESET -#define BUTTON_2 _PINNUM(0, 21) // no connection -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(0, 18) // unusable: RESET +#define BUTTON_DFU_OTA PINNUM(0, 21) // no connection +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "MechWild" -#define BLEDIS_MODEL "PillBug" +#define BLEDIS_MANUFACTURER "MechWild" +#define BLEDIS_MODEL "PillBug" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x16D0 -#define USB_DESC_UF2_PID 0x10ED -#define USB_DESC_CDC_ONLY_PID 0x10ED - -#define UF2_PRODUCT_NAME "PillBug" -#define UF2_VOLUME_LABEL "PillBug" -#define UF2_BOARD_ID "nRF52840-PillBug" -#define UF2_INDEX_URL "https://mechwild.com" +#define USB_DESC_VID 0x16D0 +#define USB_DESC_UF2_PID 0x10ED +#define USB_DESC_CDC_ONLY_PID 0x10ED + +#define UF2_PRODUCT_NAME "PillBug" +#define UF2_VOLUME_LABEL "PillBug" +#define UF2_BOARD_ID "nRF52840-PillBug" +#define UF2_INDEX_URL "https://mechwild.com" #endif // _PillBug_H diff --git a/src/boards/pitaya_go/board.h b/src/boards/pitaya_go/board.h index 9480a933..fd0b9944 100644 --- a/src/boards/pitaya_go/board.h +++ b/src/boards/pitaya_go/board.h @@ -25,47 +25,44 @@ #ifndef _MAKERDIARY_PITAYA_GO_H_ #define _MAKERDIARY_PITAYA_GO_H_ -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(1, 10) // Red -#define LED_STATE_ON 0 +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(1, 10) // Red +#define LED_STATE_ON 0 -#define LED_RGB_RED_PIN _PINNUM(1, 10) -#define LED_RGB_GREEN_PIN _PINNUM(1, 11) -#define LED_RGB_BLUE_PIN _PINNUM(1, 12) -#define BOARD_RGB_BRIGHTNESS 0x404040 +#define LED_RGB_RED_PIN PINNUM(1, 10) +#define LED_RGB_GREEN_PIN PINNUM(1, 11) +#define LED_RGB_BLUE_PIN PINNUM(1, 12) +#define BOARD_RGB_BRIGHTNESS 0x404040 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(1, 0) // P1.00: User Button -#define BUTTON_2 _PINNUM(1, 7) // P1.07: NC -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(1, 0) // P1.00: User Button +#define BUTTON_DFU_OTA PINNUM(1, 7) // P1.07: NC +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Makerdiary" -#define BLEDIS_MODEL "Pitaya Go" +#define BLEDIS_MANUFACTURER "Makerdiary" +#define BLEDIS_MODEL "Pitaya Go" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x2886 -#define USB_DESC_UF2_PID 0xF00E -#define USB_DESC_CDC_ONLY_PID 0xF00E +#define USB_DESC_VID 0x2886 +#define USB_DESC_UF2_PID 0xF00E +#define USB_DESC_CDC_ONLY_PID 0xF00E //--------------------------------------------------------------------+ // UF2 //--------------------------------------------------------------------+ -#define UF2_PRODUCT_NAME "Pitaya Go" -#define UF2_VOLUME_LABEL "PITAYAGO" -#define UF2_BOARD_ID "PITAYAGO" -#define UF2_INDEX_URL "https://wiki.makerdiary.com/pitaya-go" +#define UF2_PRODUCT_NAME "Pitaya Go" +#define UF2_VOLUME_LABEL "PITAYAGO" +#define UF2_BOARD_ID "PITAYAGO" +#define UF2_INDEX_URL "https://wiki.makerdiary.com/pitaya-go" #endif /* _MAKERDIARY_PITAYA_GO_H_ */ diff --git a/src/boards/raytac_mdbt50q_db_40/board.h b/src/boards/raytac_mdbt50q_db_40/board.h index 81e07dba..2d26a3c6 100644 --- a/src/boards/raytac_mdbt50q_db_40/board.h +++ b/src/boards/raytac_mdbt50q_db_40/board.h @@ -25,31 +25,25 @@ #ifndef RAYTAC_MDBT50Q_DB_40_H #define RAYTAC_MDBT50Q_DB_40_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ #define LEDS_NUMBER 3 -/* This is the Green led marked D1 on the board */ -#define LED_PRIMARY_PIN _PINNUM(1, 13) -/* This is the Red led marked D2 on the board */ -#define LED_SECONDARY_PIN _PINNUM(1, 14) -/* This is the Blue led marked D3 on the board */ -#define LED_TERTIARY_PIN _PINNUM(1, 15) -/* There are one more unpopulated LEDs, but for the purposes of bootloader that - * doesn't matter. */ +#define LED_PRIMARY_PIN PINNUM(1, 13) /* Green led marked D1 on the board */ +#define LED_SECONDARY_PIN PINNUM(1, 14) /* Red led marked D2 on the board */ +#define LED_TERTIARY_PIN PINNUM(1, 15) /* Blue led marked D3 on the board */ + +/* There are one more unpopulated LEDs, but for the purposes of bootloader that doesn't matter. */ #define LED_STATE_ON 0 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 4 -#define BUTTON_1 _PINNUM(0, 11) -#define BUTTON_2 _PINNUM(0, 12) -#define BUTTON_3 _PINNUM(0, 24) -#define BUTTON_4 _PINNUM(0, 25) +#define BUTTON_DFU PINNUM(0, 11) +#define BUTTON_DFU_OTA PINNUM(0, 12) +#define BUTTON_3 PINNUM(0, 24) +#define BUTTON_4 PINNUM(0, 25) #define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ diff --git a/src/boards/raytac_mdbt50q_rx/board.h b/src/boards/raytac_mdbt50q_rx/board.h index 1436d8b3..76a178bb 100644 --- a/src/boards/raytac_mdbt50q_rx/board.h +++ b/src/boards/raytac_mdbt50q_rx/board.h @@ -25,42 +25,39 @@ #ifndef RAYTAC_MDBT50Q_RX_H #define RAYTAC_MDBT50Q_RX_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(1, 13) -#define LED_STATE_ON 0 +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(1, 13) +#define LED_STATE_ON 0 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(0, 15) -#define BUTTON_2 _PINNUM(0, 10) -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(0, 15) +#define BUTTON_DFU_OTA PINNUM(0, 10) +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Raytac" -#define BLEDIS_MODEL "MDBT50Q-RX" +#define BLEDIS_MANUFACTURER "Raytac" +#define BLEDIS_MODEL "MDBT50Q-RX" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x010B -#define USB_DESC_CDC_ONLY_PID 0x010B +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x010B +#define USB_DESC_CDC_ONLY_PID 0x010B //------------- UF2 -------------// -#define UF2_PRODUCT_NAME "Raytac MDBT50Q-RX" -#define UF2_VOLUME_LABEL "MDBT50QBOOT" -#define UF2_BOARD_ID "nRF52840-MDBT50Q_RX-verD" -#define UF2_INDEX_URL "https://www.adafruit.com/product/5199" +#define UF2_PRODUCT_NAME "Raytac MDBT50Q-RX" +#define UF2_VOLUME_LABEL "MDBT50QBOOT" +#define UF2_BOARD_ID "nRF52840-MDBT50Q_RX-verD" +#define UF2_INDEX_URL "https://www.adafruit.com/product/5199" #endif // RAYTAC_MDBT50Q_RX_H diff --git a/src/boards/sparkfun_nrf52840_micromod/board.h b/src/boards/sparkfun_nrf52840_micromod/board.h index bf43912b..11692a42 100644 --- a/src/boards/sparkfun_nrf52840_micromod/board.h +++ b/src/boards/sparkfun_nrf52840_micromod/board.h @@ -26,41 +26,38 @@ #ifndef _SPARKFUN_NRF52840_MICROMOD_H_ #define _SPARKFUN_NRF52840_MICROMOD_H_ -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(0, 13) -#define LED_STATE_ON 1 +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(0, 13) +#define LED_STATE_ON 1 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(0, 7) -#define BUTTON_2 _PINNUM(0, 10) -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(0, 7) +#define BUTTON_DFU_OTA PINNUM(0, 10) +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "SparkFun" -#define BLEDIS_MODEL "MicroMod nRF52840" +#define BLEDIS_MANUFACTURER "SparkFun" +#define BLEDIS_MODEL "MicroMod nRF52840" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x1B4F -#define USB_DESC_UF2_PID 0x0022 -#define USB_DESC_CDC_ONLY_PID 0x0023 +#define USB_DESC_VID 0x1B4F +#define USB_DESC_UF2_PID 0x0022 +#define USB_DESC_CDC_ONLY_PID 0x0023 //------------- UF2 -------------// -#define UF2_PRODUCT_NAME "SparkFun MicroMod nRF52840" -#define UF2_VOLUME_LABEL "SFMM852BOOT" -#define UF2_BOARD_ID "nRF52840-micromod-v10" +#define UF2_PRODUCT_NAME "SparkFun MicroMod nRF52840" +#define UF2_VOLUME_LABEL "SFMM852BOOT" +#define UF2_BOARD_ID "nRF52840-micromod-v10" -#define UF2_INDEX_URL "https://www.sparkfun.com/products/16984" +#define UF2_INDEX_URL "https://www.sparkfun.com/products/16984" #endif /* _SPARKFUN_NRF52840_MICROMOD_H_ */ diff --git a/src/boards/t1000_e/board.h b/src/boards/t1000_e/board.h index 1a087416..58a52c9f 100644 --- a/src/boards/t1000_e/board.h +++ b/src/boards/t1000_e/board.h @@ -25,43 +25,40 @@ #ifndef _T1000_E_H #define _T1000_E_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(0, 24) // Green -#define LED_STATE_ON 0 +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(0, 24) // Green +#define LED_STATE_ON 0 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(0, 6) // Primary Button -#define BUTTON_2 _PINNUM(0, 18) // unusable: RESET -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU PINNUM(0, 6) // Primary Button +#define BUTTON_DFU_OTA PINNUM(0, 18) // unusable: RESET +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Seeed Studio" -#define BLEDIS_MODEL "T1000-E" +#define BLEDIS_MANUFACTURER "Seeed Studio" +#define BLEDIS_MODEL "T1000-E" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x2886 -#define USB_DESC_UF2_PID 0x0057 -#define USB_DESC_CDC_ONLY_PID 0x0057 +#define USB_DESC_VID 0x2886 +#define USB_DESC_UF2_PID 0x0057 +#define USB_DESC_CDC_ONLY_PID 0x0057 //--------------------------------------------------------------------+ // UF2 //--------------------------------------------------------------------+ -#define UF2_PRODUCT_NAME "Seeed T1000-E for Meshtastic" -#define UF2_VOLUME_LABEL "T1000-E" -#define UF2_BOARD_ID "nRF52840-T1000-E-v1" -#define UF2_INDEX_URL "https://www.seeedstudio.com/SenseCAP-Card-Tracker-T1000-E-for-Meshtastic-p-5913.html" +#define UF2_PRODUCT_NAME "Seeed T1000-E for Meshtastic" +#define UF2_VOLUME_LABEL "T1000-E" +#define UF2_BOARD_ID "nRF52840-T1000-E-v1" +#define UF2_INDEX_URL "https://www.seeedstudio.com/SenseCAP-Card-Tracker-T1000-E-for-Meshtastic-p-5913.html" #endif /* _T1000_E_H */ diff --git a/src/boards/waveshare_nrf52840_eval/board.h b/src/boards/waveshare_nrf52840_eval/board.h index 27991df4..d66a7852 100644 --- a/src/boards/waveshare_nrf52840_eval/board.h +++ b/src/boards/waveshare_nrf52840_eval/board.h @@ -23,50 +23,47 @@ #ifndef _WAVESHARE_NRF52840_H #define _WAVESHARE_NRF52840_H -#define _PINNUM(port, pin) ((port)*32 + (pin)) - /*------------------------------------------------------------------*/ /* LED *------------------------------------------------------------------*/ -#define LEDS_NUMBER 2 +#define LEDS_NUMBER 2 /* This is led marked LED1 on the board */ -#define LED_PRIMARY_PIN _PINNUM(0, 13) +#define LED_PRIMARY_PIN PINNUM(0, 13) /* This is led marked LED2 on the board */ -#define LED_SECONDARY_PIN _PINNUM(0, 14) +#define LED_SECONDARY_PIN PINNUM(0, 14) /* There are two more LEDs, but for the purposes of bootloader that * doesn't matter. */ -#define LED_STATE_ON 0 +#define LED_STATE_ON 0 /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 /* This is the 'KEY1' in top left of the board under RESET key. * It is used to remain in bootloader mode after reset. */ -#define BUTTON_1 _PINNUM(0, 11) +#define BUTTON_DFU PINNUM(0, 11) /* Pin below is in the bottom left of PCB, and can be shorted to GND * with a regular 2.54mm jumper or tweezers. This pin is used to * clear user firmware and remain in bootloader mode. */ -#define BUTTON_2 _PINNUM(0, 29) -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP +#define BUTTON_DFU_OTA PINNUM(0, 29) +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP //--------------------------------------------------------------------+ // BLE OTA //--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Waveshare" -#define BLEDIS_MODEL "nRF52840 Eval" +#define BLEDIS_MANUFACTURER "Waveshare" +#define BLEDIS_MODEL "nRF52840 Eval" //--------------------------------------------------------------------+ // USB //--------------------------------------------------------------------+ -#define USB_DESC_VID 0x239A -#define USB_DESC_UF2_PID 0x0029 -#define USB_DESC_CDC_ONLY_PID 0x002A +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x0029 +#define USB_DESC_CDC_ONLY_PID 0x002A //------------- UF2 -------------// -#define UF2_PRODUCT_NAME "Waveshare nRF52840 Eval" -#define UF2_VOLUME_LABEL "WS52840EVK" -#define UF2_BOARD_ID "WS-nRF52840-EVK" -#define UF2_INDEX_URL "https://www.waveshare.com/wiki/NRF52840_Eval_Kit" +#define UF2_PRODUCT_NAME "Waveshare nRF52840 Eval" +#define UF2_VOLUME_LABEL "WS52840EVK" +#define UF2_BOARD_ID "WS-nRF52840-EVK" +#define UF2_INDEX_URL "https://www.waveshare.com/wiki/NRF52840_Eval_Kit" #endif // _WAVESHARE_NRF52840_H diff --git a/src/boards/xiao_nrf52840_ble/board.h b/src/boards/xiao_nrf52840_ble/board.h index 9f4c45e6..eacabd20 100644 --- a/src/boards/xiao_nrf52840_ble/board.h +++ b/src/boards/xiao_nrf52840_ble/board.h @@ -1,68 +1,65 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2018 Ha Thach for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef _XIAO_BLE -#define _XIAO_BLE - -#define _PINNUM(port, pin) ((port)*32 + (pin)) - -/*------------------------------------------------------------------*/ -/* LED - *------------------------------------------------------------------*/ -// The board has 3 leds, but changing the number here causes OTA issues. -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(0, 26) -#define LED_STATE_ON 0 - -#define NEOPIXELS_NUMBER 0 - -/*------------------------------------------------------------------*/ -/* BUTTON - *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(0, 18) -// Button 2 is defined as D1 from expansion board. -#define BUTTON_2 _PINNUM(0, 3) -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP - -//--------------------------------------------------------------------+ -// BLE OTA -//--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Seeed" -#define BLEDIS_MODEL "XIAO nRF52840" - -//--------------------------------------------------------------------+ -// USB -//--------------------------------------------------------------------+ -#define USB_DESC_VID 0x2886 -#define USB_DESC_UF2_PID 0x0044 -#define USB_DESC_CDC_ONLY_PID 0x0044 - -//------------- UF2 -------------// -#define UF2_PRODUCT_NAME "Seeed XIAO nRF52840" -#define UF2_VOLUME_LABEL "XIAO-BOOT" -#define UF2_BOARD_ID "nRF52840-SeeedXiao-v1" -#define UF2_INDEX_URL "https://www.seeedstudio.com/" - -#endif // _XIAO_BLE +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef _XIAO_BLE +#define _XIAO_BLE + +/*------------------------------------------------------------------*/ +/* LED + *------------------------------------------------------------------*/ +// The board has 3 leds, but changing the number here causes OTA issues. +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(0, 26) +#define LED_STATE_ON 0 + +#define NEOPIXELS_NUMBER 0 + +/*------------------------------------------------------------------*/ +/* BUTTON + *------------------------------------------------------------------*/ +#define BUTTON_DFU PINNUM(0, 18) +// Button 2 is defined as D1 from expansion board. +#define BUTTON_DFU_OTA PINNUM(0, 3) +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP + +//--------------------------------------------------------------------+ +// BLE OTA +//--------------------------------------------------------------------+ +#define BLEDIS_MANUFACTURER "Seeed" +#define BLEDIS_MODEL "XIAO nRF52840" + +//--------------------------------------------------------------------+ +// USB +//--------------------------------------------------------------------+ +#define USB_DESC_VID 0x2886 +#define USB_DESC_UF2_PID 0x0044 +#define USB_DESC_CDC_ONLY_PID 0x0044 + +//------------- UF2 -------------// +#define UF2_PRODUCT_NAME "Seeed XIAO nRF52840" +#define UF2_VOLUME_LABEL "XIAO-BOOT" +#define UF2_BOARD_ID "nRF52840-SeeedXiao-v1" +#define UF2_INDEX_URL "https://www.seeedstudio.com/" + +#endif // _XIAO_BLE diff --git a/src/boards/xiao_nrf52840_ble_sense/board.h b/src/boards/xiao_nrf52840_ble_sense/board.h index e512c1b7..ff0c204a 100644 --- a/src/boards/xiao_nrf52840_ble_sense/board.h +++ b/src/boards/xiao_nrf52840_ble_sense/board.h @@ -1,68 +1,65 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2018 Ha Thach for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef _XIAO_BLE_SENSE -#define _XIAO_BLE_SENSE - -#define _PINNUM(port, pin) ((port)*32 + (pin)) - -/*------------------------------------------------------------------*/ -/* LED - *------------------------------------------------------------------*/ -// The board has 3 leds, but changing the number here causes OTA issues. -#define LEDS_NUMBER 1 -#define LED_PRIMARY_PIN _PINNUM(0, 26) -#define LED_STATE_ON 0 - -#define NEOPIXELS_NUMBER 0 - -/*------------------------------------------------------------------*/ -/* BUTTON - *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 -#define BUTTON_1 _PINNUM(0, 18) -// Button 2 is defined as D1 from expansion board. -#define BUTTON_2 _PINNUM(0, 3) -#define BUTTON_PULL NRF_GPIO_PIN_PULLUP - -//--------------------------------------------------------------------+ -// BLE OTA -//--------------------------------------------------------------------+ -#define BLEDIS_MANUFACTURER "Seeed" -#define BLEDIS_MODEL "XIAO nRF52840 Sense" - -//--------------------------------------------------------------------+ -// USB -//--------------------------------------------------------------------+ -#define USB_DESC_VID 0x2886 -#define USB_DESC_UF2_PID 0x0045 -#define USB_DESC_CDC_ONLY_PID 0x0045 - -//------------- UF2 -------------// -#define UF2_PRODUCT_NAME "Seeed XIAO nRF52840" -#define UF2_VOLUME_LABEL "XIAO-SENSE" -#define UF2_BOARD_ID "nRF52840-SeeedXiaoSense-v1" -#define UF2_INDEX_URL "https://www.seeedstudio.com/" - -#endif // _XIAO_BLE_SENSE +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef _XIAO_BLE_SENSE +#define _XIAO_BLE_SENSE + +/*------------------------------------------------------------------*/ +/* LED + *------------------------------------------------------------------*/ +// The board has 3 leds, but changing the number here causes OTA issues. +#define LEDS_NUMBER 1 +#define LED_PRIMARY_PIN PINNUM(0, 26) +#define LED_STATE_ON 0 + +#define NEOPIXELS_NUMBER 0 + +/*------------------------------------------------------------------*/ +/* BUTTON + *------------------------------------------------------------------*/ +#define BUTTON_DFU PINNUM(0, 18) +// Button 2 is defined as D1 from expansion board. +#define BUTTON_DFU_OTA PINNUM(0, 3) +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP + +//--------------------------------------------------------------------+ +// BLE OTA +//--------------------------------------------------------------------+ +#define BLEDIS_MANUFACTURER "Seeed" +#define BLEDIS_MODEL "XIAO nRF52840 Sense" + +//--------------------------------------------------------------------+ +// USB +//--------------------------------------------------------------------+ +#define USB_DESC_VID 0x2886 +#define USB_DESC_UF2_PID 0x0045 +#define USB_DESC_CDC_ONLY_PID 0x0045 + +//------------- UF2 -------------// +#define UF2_PRODUCT_NAME "Seeed XIAO nRF52840" +#define UF2_VOLUME_LABEL "XIAO-SENSE" +#define UF2_BOARD_ID "nRF52840-SeeedXiaoSense-v1" +#define UF2_INDEX_URL "https://www.seeedstudio.com/" + +#endif // _XIAO_BLE_SENSE diff --git a/src/main.c b/src/main.c index f9a95d8c..c988ee43 100644 --- a/src/main.c +++ b/src/main.c @@ -275,8 +275,8 @@ static void check_dfu_mode(void) { #endif // DFU + FRESET are pressed --> OTA -#if defined(BUTTON_DFU) && defined(BUTTON_FRESET) - _ota_dfu = _ota_dfu || (button_pressed(BUTTON_DFU) && button_pressed(BUTTON_FRESET)); +#if defined(BUTTON_DFU) && defined(BUTTON_DFU_OTA) + _ota_dfu = _ota_dfu || (button_pressed(BUTTON_DFU) && button_pressed(BUTTON_DFU_OTA)); #endif bool const valid_app = bootloader_app_is_valid(); diff --git a/supported_boards.md b/supported_boards.md new file mode 100644 index 00000000..82484fdd --- /dev/null +++ b/supported_boards.md @@ -0,0 +1,59 @@ +# Supported Boards + +## Adafruit Boards + +| Board | Name | VID PID | URL | +| --- | --- | --- | --- | +| circuitplayground_nrf52840 | Adafruit Circuit Playground nRF52840 | 0x239A:0x0045 | https://www.adafruit.com/product/4333 | +| clue_nrf52840 | Adafruit CLUE nRF52840 | 0x239A:0x0071 | https://www.adafruit.com/product/4500 | +| feather_nrf52832 | Adafruit Feather nRF52832 | N/A | https://www.adafruit.com/product/3406 | +| feather_nrf52840_express | Adafruit Feather nRF52840 Express | 0x239A:0x0029 | https://www.adafruit.com/product/4062 | +| feather_nrf52840_sense | Adafruit Feather nRF52840 Sense | 0x239A:0x0087 | https://www.adafruit.com/product/4516 | +| feather_nrf52840_sense_tft | Adafruit Feather nRF52840 Sense TFT | 0x239A:0x0087 | https://www.adafruit.com/product/ | +| itsybitsy_nrf52840_express | Adafruit ItsyBitsy nRF52840 Express | 0x239A:0x0051 | https://www.adafruit.com/product/4481 | +| ledglasses_nrf52840 | Adafruit LED Glasses Driver nRF52840 | 0x239A:0x010D | https://www.adafruit.com/product/5217 | +| metro_nrf52840_express | Adafruit Metro nRF52840 Express | 0x239A:0x003F | https://www.adafruit.com/ | + +## 3rd Party Boards + +| Board | Name | VID PID | URL | +| --- | --- | --- | --- | +| adm_b_nrf52840_1 | AtelierDuMaker NRF52840 Breakout | 0x239A:0x009F | https://github.com/Atelier-Du-Maker/HolyIoT_NRF52840 | +| ae_bl652_bo | N/A | N/A | N/A | +| aramcon2_badge | ARAMCON2 Badge | 0x239A:0x007B | https://github.com/aramcon-badge | +| aramcon_badge_2019 | ARAMCON Badge 2019 | 0x239A:0x0079 | https://github.com/aramcon-badge | +| arduino_nano_33_ble | Arduino Nano 33 BLE | 0x239A:0x0063 | https://www.arduino.cc/ | +| bast_ble | Bast BLE | 0x1209:0x805A | https://www.electroniccats.com | +| bluemicro_nrf52833 | BlueMicro | 0x1D50:0x616F | http://bluemicro.jpconstantineau.com/ | +| bluemicro_nrf52840 | BlueMicro | 0x1D50:0x6160 | http://bluemicro.jpconstantineau.com/ | +| challenger_840_ble | ILabs Challenger 840 | 0x1209:0x7380 | https://www.ilabs.se | +| ebyte_e104_bt5032a | Ebyte E104-BT5032A nRF52832 | N/A | https://www.ebyte.com/en/product-view-news.html?id=756 | +| ebyte_e73_tbb | Ebyte E73-TBB nRF52832 | N/A | https://www.ebyte.com/en/product-view-news.aspx?id=889 | +| electronut_labs_papyr | Electronut Labs Papyr | 0x239A:0x003B | https://docs.electronut.in/papyr | +| ikigaisense_vita | IkigaiSense Vita nRF52840 | 0x239A:0x0093 | https://github.com/ikigaisense/vita | +| m60_keyboard | MakerDiary M60 Mechanical Keyboard | 0x2886:0xF00F | https://wiki.makerdiary.com/m60/ | +| mbn52832dk | Murata MBN52832DK | N/A | https://www.murata.com/ja-jp/products/connectivitymodule/bluetooth/overview/lineup/mbn52832 | +| mdk_nrf52840_dongle | MDK nRF52840 USB Dongle | 0x239A:0x0029 | https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/ | +| mikoto | Mikoto nRF52840 | 0x1209:0x7A01 | https://github.com/zhiayang/mikoto | +| nice_nano | nice!nano | 0x239A:0x00B3 | https://nicekeyboards.com/docs/nice-nano | +| nrf52840_bboard | nRF52840 BBoard | 0x1D50:0x6157 | https://github.com/ddB0515/nRF52840-BBoard | +| nRF52840_connect_kit | nRF52840 Connect Kit | 0x2886:0xF00F | https://wiki.makerdiary.com/nrf52840-connectkit/ | +| nrf52840_m2 | MakerDiary nRF52840 M.2 Module | 0x2886:0xF00F | https://wiki.makerdiary.com/nrf52840-m2 | +| nrfmicro | nRFMicro | 0x1209:0x5284 | https://github.com/joric/nrfmicro/wiki | +| ohs2020_badge | OHS2020 Badge | 0x239A:0x007F | https://2020.oshwa.org/ | +| omnimo_nrf52840 | Omnimo nRF52840 | 0x1209:0xCECE | https://www.crowdsupply.com/eafaq/omnimo-nrf52840 | +| particle_argon | Particle Argon | 0x239A:0x00DA | https://www.particle.io/mesh/ | +| particle_boron | Particle Boron | 0x239A:0x00DA | https://www.particle.io/mesh/ | +| particle_xenon | Particle Xenon | 0x239A:0x00DA | https://www.particle.io/mesh/ | +| pca10056 | Nordic nRF52840 DK | 0x239A:0x00DA | https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-DK | +| pca10059 | Nordic nRF52840 Dongle | 0x239A:0x0029 | https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-Dongle | +| pca10100 | Nordic nRF52833 DK | 0x239A:0x00D8 | https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52833-DK | +| pillbug | PillBug | 0x16D0:0x10ED | https://mechwild.com | +| pitaya_go | Pitaya Go | 0x2886:0xF00E | https://wiki.makerdiary.com/pitaya-go | +| raytac_mdbt50q_db_40 | Raytac MDBT50Q Demo Board 40 | 0x239A:0x00BB | https://www.raytac.com/product/ins.php?index_id=81 | +| raytac_mdbt50q_rx | Raytac MDBT50Q-RX | 0x239A:0x010B | https://www.adafruit.com/product/5199 | +| sparkfun_nrf52840_micromod | SparkFun MicroMod nRF52840 | 0x1B4F:0x0022 | https://www.sparkfun.com/products/16984 | +| t1000_e | Seeed T1000-E for Meshtastic | 0x2886:0x0057 | https://www.seeedstudio.com/SenseCAP-Card-Tracker-T1000-E-for-Meshtastic-p-5913.html | +| waveshare_nrf52840_eval | Waveshare nRF52840 Eval | 0x239A:0x0029 | https://www.waveshare.com/wiki/NRF52840_Eval_Kit | +| xiao_nrf52840_ble | Seeed XIAO nRF52840 | 0x2886:0x0044 | https://www.seeedstudio.com/ | +| xiao_nrf52840_ble_sense | Seeed XIAO nRF52840 | 0x2886:0x0045 | https://www.seeedstudio.com/ | diff --git a/tools/gen_boards.py b/tools/gen_boards.py new file mode 100644 index 00000000..140a0dd4 --- /dev/null +++ b/tools/gen_boards.py @@ -0,0 +1,117 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import argparse +import re +from pathlib import Path + + +BOARD_H_GLOB = "src/boards/*/board.h" + + +def _first_match(pattern: str, text: str) -> str | None: + match = re.search(pattern, text, flags=re.MULTILINE) + return match.group(1).strip() if match else None + + +def _parse_int(value: str | None) -> int | None: + if value is None: + return None + value = value.strip() + if value.lower().startswith("0x"): + try: + return int(value, 16) + except ValueError: + return None + try: + return int(value, 10) + except ValueError: + return None + + +def _fmt_vid_pid(vid: int | None, pid: int | None) -> str: + if vid is None or pid is None: + return "N/A" + return f"0x{vid:04X}:0x{pid:04X}" + + +def _escape_md(value: str) -> str: + return value.replace("|", "\\|") + + +def _load_board(board_h: Path, repo_root: Path) -> dict[str, str]: + text = board_h.read_text(errors="ignore") + board = board_h.parent.name + name = _first_match(r'^\s*#define\s+UF2_PRODUCT_NAME\s+"([^"]+)"', text) + url = _first_match(r'^\s*#define\s+UF2_INDEX_URL\s+"([^"]+)"', text) + vid = _parse_int(_first_match(r"^\s*#define\s+USB_DESC_VID\s+([0-9A-Fa-fxX]+)", text)) + pid = _parse_int( + _first_match(r"^\s*#define\s+USB_DESC_UF2_PID\s+([0-9A-Fa-fxX]+)", text) + ) + + return { + "board": board, + "name": name or "N/A", + "vid_pid": _fmt_vid_pid(vid, pid), + "url": url or "N/A", + } + + +def generate(repo_root: Path, output: Path) -> None: + boards: list[dict[str, str]] = [] + for board_h in sorted(repo_root.glob(BOARD_H_GLOB)): + boards.append(_load_board(board_h, repo_root)) + + lines: list[str] = [] + lines.append("# Supported Boards") + lines.append("") + def _is_adafruit(entry: dict[str, str]) -> bool: + name = entry["name"].lower() + board = entry["board"].lower() + return name.startswith("adafruit") or board.startswith("adafruit") + + def _render_table(entries: list[dict[str, str]]) -> None: + lines.append("| Board | Name | VID PID | URL |") + lines.append("| --- | --- | --- | --- |") + for entry in sorted(entries, key=lambda e: e["board"].lower()): + lines.append( + f"| {_escape_md(entry['board'])} | {_escape_md(entry['name'])} | " + f"{_escape_md(entry['vid_pid'])} | {_escape_md(entry['url'])} |" + ) + lines.append("") + + adafruit = [entry for entry in boards if _is_adafruit(entry)] + third_party = [entry for entry in boards if not _is_adafruit(entry)] + + lines.append("## Adafruit Boards") + lines.append("") + _render_table(adafruit) + + lines.append("## 3rd Party Boards") + lines.append("") + _render_table(third_party) + + output.write_text("\n".join(lines)) + + +def main() -> None: + parser = argparse.ArgumentParser( + description="Generate supported_boards.md from src/boards/*/board.h" + ) + parser.add_argument( + "--output", + default="supported_boards.md", + help="Output markdown file (default: supported_boards.md)", + ) + args = parser.parse_args() + + repo_root = Path(__file__).resolve().parents[1] + output = Path(args.output) + if not output.is_absolute(): + output = repo_root / output + + generate(repo_root, output) + + +if __name__ == "__main__": + main()