Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions main/hwconf/devboards/hw_blink_example.lbm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
; LED blink (e.g. Supermini)

; Getting started
; - https://github.com/svenssonjoel/lispBM/tree/master/doc
; - https://github.com/vedderb/bldc/tree/master/lispBM

(gpio-configure 8 'pin-mode-out) ; configure pin 8 as output

(loopwhile t { ; loop endlessly
(gpio-write 8 1) ; set pin 8 high
(sleep 1.0) ; wait 1s
(gpio-write 8 0) ; set pin 8 low
(sleep 0.5) ; wait 0.5s
})
28 changes: 28 additions & 0 deletions main/hwconf/devboards/hw_blink_example_rgb.lbm
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
; RGB LED blink (e.g. ESP32-C3-DevKit boards)

; Getting started
; - https://github.com/svenssonjoel/lispBM/tree/master/doc
; - https://github.com/vedderb/bldc/tree/master/lispBM

; LED functions
; - https://github.com/vedderb/bldc/blob/master/lispBM/README.md#rgb-led-eg-ws2812

(rgbled-init 8) ; Initialize RGB LEDs on pin 8

(def led-num 1) ; Number of LEDs in strip
(def strip1 (rgbled-buffer led-num 1)) ; type 1=RGB

(def colors '(
0x00550000i32 ; red (R channel)
0x00005500i32 ; green (G channel)
0x00000055i32 ; blue (B channel)
0x55000000i32 ; white (W channel, if present)
))

(loopwhile t
(loopforeach c colors
(progn
(rgbled-color strip1 0 c) ; Set first LED of strip1 to color c
(rgbled-update strip1) ; Apply configured color
(sleep 0.2) ; Wait 200ms
)))
25 changes: 25 additions & 0 deletions main/hwconf/devboards/hw_c3_supermini.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
Copyright 2024 Benjamin Vedder benjamin@vedder.se

This file is part of the VESC firmware.

The VESC firmware is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

The VESC firmware is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "hw_c3_supermini.h"

void hw_init(void) {

}

55 changes: 55 additions & 0 deletions main/hwconf/devboards/hw_c3_supermini.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
Copyright 2026 Benjamin Vedder benjamin@vedder.se

This file is part of the VESC firmware.

The VESC firmware is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

The VESC firmware is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/* ESP32C3 Supermini
- https://www.fambach.net/esp32-c3-super-mini-board/
- https://forum.esk8.news/t/usb-c-to-vesc-can-forward-adapter-cheap-and-diy/79789

HW_HEADER=hwconf/devboards/hw_c3_supermini.h && HW_SRC=hwconf/devboards/hw_c3_supermini.c && idf.py build
*/

#ifndef MAIN_HWCONF_C3_SUPERMINI_H_
#define MAIN_HWCONF_C3_SUPERMINI_H_

#include "driver/gpio.h"

#define HW_NAME "C3 Supermini"
#define HW_DEFAULT_ID 2

#define HW_INIT_HOOK() hw_init()

// LEDs
// Blue is shared (GPIO8/SCK/D8), Red is not controllable (Power LED)
// On the VESC-Express, blue LED is used for feedback of BT and red for Wifi
#define LED_BLUE_PIN 8

#define LED_BLUE_ON() gpio_set_level(LED_BLUE_PIN, 1)
#define LED_BLUE_OFF() gpio_set_level(LED_BLUE_PIN, 0)

// CAN
#define CAN_TX_GPIO_NUM 1
#define CAN_RX_GPIO_NUM 0

// UART
#define HW_NO_UART

// Functions
void hw_init(void);

#endif
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/* ESP32-C3-DevKit (multiple)
- https://www.espressif.com/en/products/devkits#:~:text=ESP32%2DC3

HW_HEADER=hwconf/devboards/hw_devkit_c3.h && HW_SRC=hwconf/devboards/hw_devkit_c3.c && idf.py build
*/

#ifndef MAIN_HWCONF_DEVKIT_C3_H_
#define MAIN_HWCONF_DEVKIT_C3_H_

Expand All @@ -25,6 +31,9 @@

#define HW_INIT_HOOK() hw_init()

// LEDs
// RGB on GPIO8 (see hw_blink_example_rgb.lbm), Red is not controllable (Power LED)

// UART
#define UART_NUM 0
#define UART_BAUDRATE 115200
Expand Down
25 changes: 25 additions & 0 deletions main/hwconf/devboards/hw_xiao_c3.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
Copyright 2024 Benjamin Vedder benjamin@vedder.se

This file is part of the VESC firmware.

The VESC firmware is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

The VESC firmware is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "hw_xiao_c3.h"

void hw_init(void) {

}

50 changes: 50 additions & 0 deletions main/hwconf/devboards/hw_xiao_c3.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
Copyright 2026 Benjamin Vedder benjamin@vedder.se

This file is part of the VESC firmware.

The VESC firmware is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

The VESC firmware is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/* XIAO ESP32C3
- https://wiki.seeedstudio.com/XIAO_ESP32C3_Getting_Started/
- https://forum.esk8.news/t/usb-c-to-vesc-can-forward-adapter-cheap-and-diy/79789

HW_HEADER=hwconf/devboards/hw_xiao_c3.h && HW_SRC=hwconf/devboards/hw_xiao_c3.c && idf.py build
*/

#ifndef MAIN_HWCONF_XIAO_C3_H_
#define MAIN_HWCONF_XIAO_C3_H_

#include "driver/gpio.h"

#define HW_NAME "XIAO C3"
#define HW_DEFAULT_ID 2

#define HW_INIT_HOOK() hw_init()

// LEDs
// Red is not controllable (Charge LED)

// CAN
#define CAN_TX_GPIO_NUM 9
#define CAN_RX_GPIO_NUM 8

// UART
#define HW_NO_UART

// Functions
void hw_init(void);

#endif