Skip to content

Commit 45c6a1a

Browse files
committed
Add Type 60 support
1 parent dc6e171 commit 45c6a1a

4 files changed

Lines changed: 94 additions & 0 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Apply board specific content here
2+
set(IDF_TARGET "esp32s3")
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2020 Ha Thach (tinyusb.org) for Adafruit Industries
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
#pragma once
26+
27+
#define CUSTOM_BOOTLOADER_NAME "Type 60"
28+
#define FASTBOOT
29+
30+
//--------------------------------------------------------------------+
31+
// Button
32+
//--------------------------------------------------------------------+
33+
34+
// Enter UF2 mode if GPIO is pressed while 2nd stage bootloader indicator
35+
// is on e.g RGB = Purple. If it is GPIO0, user should not hold this while
36+
// reset since that will instead run the 1st stage ROM bootloader
37+
38+
//This is ESC key
39+
#define PIN_BUTTON_ENABLE 2
40+
#define PIN_BUTTON_UF2 8
41+
#define BUTTON_ACTIVE_HIGH
42+
43+
// GPIO that implement 1-bit memory with RC components which hold the
44+
// pin value long enough for double reset detection.
45+
// #define PIN_DOUBLE_RESET_RC
46+
47+
//--------------------------------------------------------------------+
48+
// LED
49+
//--------------------------------------------------------------------+
50+
51+
// GPIO connected to Neopixel data
52+
#define NEOPIXEL_PIN 46
53+
54+
// Brightness percentage from 1 to 255
55+
#define NEOPIXEL_BRIGHTNESS 0x20
56+
57+
// Number of neopixels
58+
#define NEOPIXEL_NUMBER 1
59+
// LED for indicator
60+
// If not defined neopixel will be use for flash writing instead
61+
// #define LED_PIN 33
62+
// #define LED_STATE_ON 0
63+
64+
//--------------------------------------------------------------------+
65+
// USB UF2
66+
//--------------------------------------------------------------------+
67+
68+
#define USB_VID 0x0203
69+
#define USB_PID 0x00B1
70+
#define USB_MANUFACTURER "203 Electronics"
71+
#define USB_PRODUCT "Type60 DFU"
72+
73+
#define UF2_PRODUCT_NAME "203 | Type 60"
74+
#define UF2_BOARD_ID "293-TYPE-60"
75+
#define UF2_VOLUME_LABEL "TYPE60DFU"
76+
#define UF2_INDEX_URL "https://203.io"
77+
78+
// Use favicon
79+
// #define TINYUF2_FAVICON_HEADER "favicon_matrix_256.h"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Board Specific Config
2+
3+
# Partition Table
4+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-8MB.csv"
5+
6+
# Serial flasher config
7+
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y

ports/espressif/components/bootloader/subproject/main/bootloader_start.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,12 @@ static int selected_boot_partition(const bootloader_state_t *bs)
236236

237237
if ( boot_index != FACTORY_INDEX )
238238
{
239+
#ifdef PIN_BUTTON_ENABLE
240+
esp_rom_gpio_pad_select_gpio(PIN_BUTTON_ENABLE);
241+
gpio_ll_input_disable(&GPIO, PIN_BUTTON_ENABLE);
242+
gpio_ll_output_enable(&GPIO, PIN_BUTTON_ENABLE);
243+
gpio_ll_set_level(&GPIO, PIN_BUTTON_ENABLE, 1);
244+
#endif
239245
esp_rom_gpio_pad_select_gpio(PIN_BUTTON_UF2);
240246
PIN_INPUT_ENABLE(GPIO_PIN_MUX_REG[PIN_BUTTON_UF2]);
241247
#ifdef BUTTON_ACTIVE_HIGH

0 commit comments

Comments
 (0)