Skip to content

Commit 2e50803

Browse files
committed
feat(board): Add ozobot circuit kit board
1 parent 9b1330a commit 2e50803

3 files changed

Lines changed: 354 additions & 0 deletions

File tree

boards.txt

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57377,3 +57377,149 @@ xteink_x4.menu.ZigbeeMode.zczr.build.zigbee_mode=-DZIGBEE_MODE_ZCZR
5737757377
xteink_x4.menu.ZigbeeMode.zczr.build.zigbee_libs=-lesp_zb_api.zczr -lzboss_stack.zczr -lzboss_port.remote
5737857378

5737957379
##############################################################
57380+
# Ozobot Circuit kit
57381+
57382+
ozobot_circuit_kit.name=Ozobot circuit kit
57383+
ozobot_circuit_kit.vid.0=0x2D81
57384+
ozobot_circuit_kit.pid.0=0x1901
57385+
ozobot_circuit_kit.upload_port.0.vid=0x303A
57386+
ozobot_circuit_kit.upload_port.0.pid=0x1001
57387+
57388+
ozobot_circuit_kit.bootloader.tool=esptool_py
57389+
ozobot_circuit_kit.bootloader.tool.default=esptool_py
57390+
57391+
ozobot_circuit_kit.upload.tool=esptool_py
57392+
ozobot_circuit_kit.upload.tool.default=esptool_py
57393+
ozobot_circuit_kit.upload.tool.network=esp_ota
57394+
57395+
ozobot_circuit_kit.upload.maximum_size=1310720
57396+
ozobot_circuit_kit.upload.maximum_data_size=327680
57397+
ozobot_circuit_kit.upload.flags=
57398+
ozobot_circuit_kit.upload.extra_flags=
57399+
ozobot_circuit_kit.upload.use_1200bps_touch=false
57400+
ozobot_circuit_kit.upload.wait_for_upload_port=false
57401+
ozobot_circuit_kit.upload.speed=921600
57402+
57403+
ozobot_circuit_kit.serial.disableDTR=false
57404+
ozobot_circuit_kit.serial.disableRTS=false
57405+
57406+
ozobot_circuit_kit.build.tarch=xtensa
57407+
ozobot_circuit_kit.build.bootloader_addr=0x0
57408+
ozobot_circuit_kit.build.target=esp32s3
57409+
ozobot_circuit_kit.build.mcu=esp32s3
57410+
ozobot_circuit_kit.build.core=esp32
57411+
ozobot_circuit_kit.build.variant=ozobot_circuit_kit
57412+
ozobot_circuit_kit.build.board=OZOBOT_CIRCUIT_KIT
57413+
ozobot_circuit_kit.build.code_debug=0
57414+
57415+
ozobot_circuit_kit.build.usb_mode=1
57416+
ozobot_circuit_kit.build.cdc_on_boot=1
57417+
ozobot_circuit_kit.build.msc_on_boot=0
57418+
ozobot_circuit_kit.build.dfu_on_boot=0
57419+
ozobot_circuit_kit.build.f_cpu=240000000L
57420+
ozobot_circuit_kit.build.flash_size=4MB
57421+
ozobot_circuit_kit.build.flash_freq=80m
57422+
ozobot_circuit_kit.build.flash_mode=dio
57423+
ozobot_circuit_kit.build.boot=qio
57424+
ozobot_circuit_kit.build.boot_freq=80m
57425+
ozobot_circuit_kit.build.defines=-DBOARD_HAS_PIN_REMAP {build.disable_pin_remap} -DBOARD_HAS_PSRAM
57426+
ozobot_circuit_kit.build.loop_core=
57427+
ozobot_circuit_kit.build.event_core=
57428+
ozobot_circuit_kit.build.psram_type=qspi
57429+
ozobot_circuit_kit.build.memory_type={build.boot}_{build.psram_type}
57430+
ozobot_circuit_kit.build.disable_pin_remap=
57431+
57432+
## IDE 2.0 Seems to not update the value
57433+
ozobot_circuit_kit.menu.JTAGAdapter.bridge=ESP USB Bridge
57434+
ozobot_circuit_kit.menu.JTAGAdapter.bridge.build.openocdscript=esp32s3-bridge.cfg
57435+
ozobot_circuit_kit.menu.JTAGAdapter.bridge.build.copy_jtag_files=1
57436+
ozobot_circuit_kit.menu.JTAGAdapter.external=FTDI Adapter
57437+
ozobot_circuit_kit.menu.JTAGAdapter.external.build.openocdscript=esp32s3-ftdi.cfg
57438+
ozobot_circuit_kit.menu.JTAGAdapter.external.build.copy_jtag_files=1
57439+
57440+
ozobot_circuit_kit.menu.LoopCore.1=Core 1
57441+
ozobot_circuit_kit.menu.LoopCore.1.build.loop_core=-DARDUINO_RUNNING_CORE=1
57442+
ozobot_circuit_kit.menu.LoopCore.0=Core 0
57443+
ozobot_circuit_kit.menu.LoopCore.0.build.loop_core=-DARDUINO_RUNNING_CORE=0
57444+
57445+
ozobot_circuit_kit.menu.EventsCore.1=Core 1
57446+
ozobot_circuit_kit.menu.EventsCore.1.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1
57447+
ozobot_circuit_kit.menu.EventsCore.0=Core 0
57448+
ozobot_circuit_kit.menu.EventsCore.0.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=0
57449+
57450+
ozobot_circuit_kit.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS)
57451+
ozobot_circuit_kit.menu.PartitionScheme.huge_app.build.partitions=huge_app
57452+
ozobot_circuit_kit.menu.PartitionScheme.huge_app.upload.maximum_size=3145728
57453+
ozobot_circuit_kit.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)
57454+
ozobot_circuit_kit.menu.PartitionScheme.default.build.partitions=default
57455+
ozobot_circuit_kit.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS)
57456+
ozobot_circuit_kit.menu.PartitionScheme.defaultffat.build.partitions=default_ffat
57457+
ozobot_circuit_kit.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS)
57458+
ozobot_circuit_kit.menu.PartitionScheme.minimal.build.partitions=minimal
57459+
ozobot_circuit_kit.menu.PartitionScheme.no_fs=No FS 4MB (2MB APP x2)
57460+
ozobot_circuit_kit.menu.PartitionScheme.no_fs.build.partitions=no_fs
57461+
ozobot_circuit_kit.menu.PartitionScheme.no_fs.upload.maximum_size=2031616
57462+
ozobot_circuit_kit.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS)
57463+
ozobot_circuit_kit.menu.PartitionScheme.no_ota.build.partitions=no_ota
57464+
ozobot_circuit_kit.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
57465+
ozobot_circuit_kit.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS)
57466+
ozobot_circuit_kit.menu.PartitionScheme.noota_3g.build.partitions=noota_3g
57467+
ozobot_circuit_kit.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576
57468+
ozobot_circuit_kit.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS)
57469+
ozobot_circuit_kit.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat
57470+
ozobot_circuit_kit.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152
57471+
ozobot_circuit_kit.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS)
57472+
ozobot_circuit_kit.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat
57473+
ozobot_circuit_kit.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576
57474+
ozobot_circuit_kit.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/128KB SPIFFS)
57475+
ozobot_circuit_kit.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
57476+
ozobot_circuit_kit.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
57477+
ozobot_circuit_kit.menu.PartitionScheme.rainmaker=RainMaker 4MB
57478+
ozobot_circuit_kit.menu.PartitionScheme.rainmaker.build.partitions=rainmaker
57479+
ozobot_circuit_kit.menu.PartitionScheme.rainmaker.upload.maximum_size=1966080
57480+
ozobot_circuit_kit.menu.PartitionScheme.rainmaker_4MB=RainMaker 4MB No OTA
57481+
ozobot_circuit_kit.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_ota
57482+
ozobot_circuit_kit.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656
57483+
ozobot_circuit_kit.menu.PartitionScheme.zigbee_zczr=Zigbee ZCZR 4MB with spiffs
57484+
ozobot_circuit_kit.menu.PartitionScheme.zigbee_zczr.build.partitions=zigbee_zczr
57485+
ozobot_circuit_kit.menu.PartitionScheme.zigbee_zczr.upload.maximum_size=1310720
57486+
ozobot_circuit_kit.menu.PartitionScheme.custom=Custom
57487+
ozobot_circuit_kit.menu.PartitionScheme.custom.build.partitions=
57488+
ozobot_circuit_kit.menu.PartitionScheme.custom.upload.maximum_size=4194304
57489+
57490+
ozobot_circuit_kit.menu.PinNumbers.default=By Arduino pin (default)
57491+
ozobot_circuit_kit.menu.PinNumbers.byGPIONumber=By GPIO number (legacy)
57492+
ozobot_circuit_kit.menu.PinNumbers.byGPIONumber.build.disable_pin_remap=-DBOARD_USES_HW_GPIO_NUMBERS
57493+
57494+
ozobot_circuit_kit.menu.USBMode.hwcdc=Hardware CDC and JTAG
57495+
ozobot_circuit_kit.menu.USBMode.hwcdc.build.usb_mode=1
57496+
ozobot_circuit_kit.menu.USBMode.default=USB-OTG (TinyUSB)
57497+
ozobot_circuit_kit.menu.USBMode.default.build.usb_mode=0
57498+
ozobot_circuit_kit.menu.USBMode.hwcdc.debug.executable={build.path}/{build.project_name}.elf
57499+
57500+
ozobot_circuit_kit.menu.DebugLevel.none=None
57501+
ozobot_circuit_kit.menu.DebugLevel.none.build.code_debug=0
57502+
ozobot_circuit_kit.menu.DebugLevel.error=Error
57503+
ozobot_circuit_kit.menu.DebugLevel.error.build.code_debug=1
57504+
ozobot_circuit_kit.menu.DebugLevel.warn=Warn
57505+
ozobot_circuit_kit.menu.DebugLevel.warn.build.code_debug=2
57506+
ozobot_circuit_kit.menu.DebugLevel.info=Info
57507+
ozobot_circuit_kit.menu.DebugLevel.info.build.code_debug=3
57508+
ozobot_circuit_kit.menu.DebugLevel.debug=Debug
57509+
ozobot_circuit_kit.menu.DebugLevel.debug.build.code_debug=4
57510+
ozobot_circuit_kit.menu.DebugLevel.verbose=Verbose
57511+
ozobot_circuit_kit.menu.DebugLevel.verbose.build.code_debug=5
57512+
57513+
ozobot_circuit_kit.menu.EraseFlash.none=Disabled
57514+
ozobot_circuit_kit.menu.EraseFlash.none.upload.erase_cmd=
57515+
ozobot_circuit_kit.menu.EraseFlash.all=Enabled
57516+
ozobot_circuit_kit.menu.EraseFlash.all.upload.erase_cmd=-e
57517+
57518+
ozobot_circuit_kit.menu.ZigbeeMode.default=Disabled
57519+
ozobot_circuit_kit.menu.ZigbeeMode.default.build.zigbee_mode=
57520+
ozobot_circuit_kit.menu.ZigbeeMode.default.build.zigbee_libs=
57521+
ozobot_circuit_kit.menu.ZigbeeMode.zczr=Zigbee ZCZR (coordinator/router)
57522+
ozobot_circuit_kit.menu.ZigbeeMode.zczr.build.zigbee_mode=-DZIGBEE_MODE_ZCZR
57523+
ozobot_circuit_kit.menu.ZigbeeMode.zczr.build.zigbee_libs=-lesp_zb_api.zczr -lzboss_stack.zczr -lzboss_port.remote
57524+
57525+
##############################################################
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#if defined(BOARD_HAS_PIN_REMAP) && !defined(ARDUINO_CORE_BUILD)
2+
// -DARDUINO_CORE_BUILD must be set for core files only, to avoid extra
3+
// remapping steps that would create all sorts of issues in the core.
4+
// Removing -DBOARD_HAS_PIN_REMAP at least does correctly restore the
5+
// use of GPIO numbers in the API.
6+
#error This build system is not supported. Please rebuild without BOARD_HAS_PIN_REMAP.
7+
#endif
8+
9+
#if !defined(BOARD_HAS_PIN_REMAP)
10+
// This board uses pin mapping but the build system has disabled it
11+
#warning The build system forces the Arduino API to use GPIO numbers on a board that has custom pin mapping.
12+
#elif defined(BOARD_USES_HW_GPIO_NUMBERS)
13+
// The user has chosen to disable pin mappin.
14+
#warning The Arduino API will use GPIO numbers for this build.
15+
#endif
16+
17+
#include "Arduino.h"
18+
19+
// NOTE: This must match with the remapped pin sequence in pins_arduino.h
20+
static const int8_t TO_GPIO_NUMBER[] = {
21+
35 , // [ 0] G0
22+
36 , // [ 1] G1
23+
37 , // [ 2] G2
24+
38 , // [ 3] G3
25+
45 , // [ 4] G4
26+
46 , // [ 5] G5
27+
39 , // [ 6] G6
28+
40 , // [ 7] G7
29+
41 , // [ 8] G8
30+
42 , // [ 9] G9
31+
18 , // [10] Motor L IN1
32+
17 , // [11] Motor L IN2
33+
21 , // [12] Motor R IN1
34+
33 , // [13] Motor R IN2
35+
34 , // [14] SPI CS
36+
12 , // [15] SPI CLK
37+
11 , // [16] SPI MOSI
38+
13 , // [17] SPI MISO
39+
47 , // [18] I2C SDA
40+
48 , // [19] I2C SCK
41+
14 , // [20] I2C Interrupt
42+
43 , // [21] UART TX
43+
44 , // [22] UART RX
44+
0, // [23] Boot pin
45+
1, // [24] ADC Channel 0
46+
2, // [25] ADC Channel 1
47+
3, // [26] ADC Channel 2
48+
4, // [27] ADC Channel 3
49+
5, // [28] ADC Channel 4
50+
6, // [29] ADC Channel 5
51+
7, // [30] ADC Channel 6
52+
8, // [31] ADC Channel 7
53+
9, // [32] ADC Channel 8
54+
10, // [33] ADC Channel 9
55+
};
56+
57+
static const unsigned REMAP_TABLE_ENTRIES = sizeof(TO_GPIO_NUMBER) / sizeof(TO_GPIO_NUMBER[0]);
58+
59+
#if defined(BOARD_HAS_PIN_REMAP) && !defined(BOARD_USES_HW_GPIO_NUMBERS)
60+
61+
int8_t digitalPinToGPIONumber(int8_t digitalPin)
62+
{
63+
if ((digitalPin < 0) || (digitalPin >= REMAP_TABLE_ENTRIES))
64+
return -1;
65+
return TO_GPIO_NUMBER[digitalPin];
66+
}
67+
68+
int8_t gpioNumberToDigitalPin(int8_t gpioNumber)
69+
{
70+
if (gpioNumber < 0)
71+
return -1;
72+
73+
// slow linear table lookup
74+
for (int8_t digitalPin = 0; digitalPin < REMAP_TABLE_ENTRIES; ++digitalPin) {
75+
if (TO_GPIO_NUMBER[digitalPin] == gpioNumber)
76+
return digitalPin;
77+
}
78+
79+
// not found
80+
return -1;
81+
}
82+
83+
#endif
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
#ifndef Pins_Arduino_h
2+
#define Pins_Arduino_h
3+
4+
#include <stdint.h>
5+
6+
#define USB_VID 0x2D81
7+
#define USB_PID 0x1901
8+
#define USB_MANUFACTURER "OZOEDU"
9+
#define USB_PRODUCT "Ozobot circuit kit"
10+
#define USB_SERIAL "" // Empty string for MAC address
11+
12+
#ifndef __cplusplus
13+
#define constexpr const
14+
#endif
15+
16+
#if defined(BOARD_HAS_PIN_REMAP) && !defined(BOARD_USES_HW_GPIO_NUMBERS)
17+
18+
// Arduino style definitions (API uses Dx)
19+
20+
static constexpr uint8_t D0 = 0; // G0
21+
static constexpr uint8_t D1 = 1; // G1
22+
static constexpr uint8_t D2 = 2; // G2
23+
static constexpr uint8_t D3 = 3; // G3
24+
static constexpr uint8_t D4 = 4; // G4
25+
static constexpr uint8_t D5 = 5; // G5
26+
static constexpr uint8_t D6 = 6; // G6
27+
static constexpr uint8_t D7 = 7; // G7
28+
static constexpr uint8_t D8 = 8; // G8
29+
static constexpr uint8_t D9 = 9; // G9
30+
static constexpr uint8_t D10 = 10; // Motor L IN1
31+
static constexpr uint8_t D11 = 11; // Motor L IN2
32+
static constexpr uint8_t D12 = 12; // Motor R IN1
33+
static constexpr uint8_t D13 = 13; // Motor R IN2
34+
static constexpr uint8_t D14 = 14; // SPI CS
35+
static constexpr uint8_t D15 = 15; // SPI CLK
36+
static constexpr uint8_t D16 = 16; // SPI MOSI
37+
static constexpr uint8_t D17 = 17; // SPI MISO
38+
static constexpr uint8_t D18 = 18; // I2C SDA
39+
static constexpr uint8_t D19 = 19; // I2C SCK
40+
static constexpr uint8_t D20 = 20; // I2C Interrupt
41+
static constexpr uint8_t D21 = 21; // UART TX
42+
static constexpr uint8_t D22 = 22; // UART RX
43+
static constexpr uint8_t D23 = 23; // Boot pin
44+
45+
static constexpr uint8_t A0 = 24; // also DTR
46+
static constexpr uint8_t A1 = 25;
47+
static constexpr uint8_t A2 = 26;
48+
static constexpr uint8_t A3 = 27;
49+
static constexpr uint8_t A4 = 28; // also SDA
50+
static constexpr uint8_t A5 = 29; // also SCL
51+
static constexpr uint8_t A6 = 30;
52+
static constexpr uint8_t A7 = 31;
53+
static constexpr uint8_t A8 = 32;
54+
static constexpr uint8_t A9 = 33;
55+
56+
#else
57+
58+
// ESP32-style definitions (API uses GPIOx)
59+
60+
static constexpr uint8_t D0 = 35; // G0
61+
static constexpr uint8_t D1 = 36; // G1
62+
static constexpr uint8_t D2 = 37; // G2
63+
static constexpr uint8_t D3 = 38; // G3
64+
static constexpr uint8_t D4 = 45; // G4
65+
static constexpr uint8_t D5 = 46; // G5
66+
static constexpr uint8_t D6 = 39; // G6
67+
static constexpr uint8_t D7 = 40; // G7
68+
static constexpr uint8_t D8 = 41; // G8
69+
static constexpr uint8_t D9 = 42; // G9
70+
static constexpr uint8_t D10 = 18; // Motor L IN1
71+
static constexpr uint8_t D11 = 17; // Motor L IN2
72+
static constexpr uint8_t D12 = 21; // Motor R IN1
73+
static constexpr uint8_t D13 = 33; // Motor R IN2
74+
static constexpr uint8_t D14 = 34; // SPI CS
75+
static constexpr uint8_t D15 = 12; // SPI CLK
76+
static constexpr uint8_t D16 = 11; // SPI MOSI
77+
static constexpr uint8_t D17 = 13; // SPI MISO
78+
static constexpr uint8_t D18 = 47; // I2C SDA
79+
static constexpr uint8_t D19 = 48; // I2C SCK
80+
static constexpr uint8_t D20 = 14; // I2C Interrupt
81+
static constexpr uint8_t D21 = 43; // UART TX
82+
static constexpr uint8_t D22 = 44; // UART RX
83+
static constexpr uint8_t D23 = 0; // Boot pin
84+
85+
static constexpr uint8_t A0 = 1;
86+
static constexpr uint8_t A1 = 2;
87+
static constexpr uint8_t A2 = 3;
88+
static constexpr uint8_t A3 = 4;
89+
static constexpr uint8_t A4 = 5;
90+
static constexpr uint8_t A5 = 6;
91+
static constexpr uint8_t A6 = 7;
92+
static constexpr uint8_t A7 = 8;
93+
static constexpr uint8_t A8 = 9;
94+
static constexpr uint8_t A9 = 10;
95+
96+
#endif
97+
98+
// alternate pin functions
99+
100+
static constexpr uint8_t TX = D21;
101+
static constexpr uint8_t RX = D22;
102+
103+
static constexpr uint8_t SS = D14;
104+
static constexpr uint8_t MOSI = D16;
105+
static constexpr uint8_t MISO = D17;
106+
static constexpr uint8_t SCK = D15;
107+
108+
static constexpr uint8_t SDA = D18;
109+
static constexpr uint8_t SCL = D19;
110+
111+
static constexpr uint8_t MOTOR_L_IN1 = D10;
112+
static constexpr uint8_t MOTOR_L_IN2 = D11;
113+
114+
static constexpr uint8_t MOTOR_R_IN1 = D12;
115+
static constexpr uint8_t MOTOR_R_IN2 = D13;
116+
117+
static constexpr uint8_t BUTTON = D23;
118+
119+
static constexpr uint8_t RGB_LED = D9;
120+
121+
#ifndef __cplusplus
122+
#undef constexpr
123+
#endif
124+
125+
#endif /* Pins_Arduino_h */

0 commit comments

Comments
 (0)