Skip to content

Commit

Permalink
Merge pull request #62 from asterics/RP2040
Browse files Browse the repository at this point in the history
Support for Arduino Nano Connect RP2040
  • Loading branch information
Benjamin Aigner authored Feb 9, 2023
2 parents 90deeeb + d69ea9d commit c4d9c87
Show file tree
Hide file tree
Showing 7 changed files with 308 additions and 198 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The following lines of boilerplate have to be in your project's CMakeLists
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.16)

set(SUPPORTED_TARGETS esp32)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ With `idf.py -p (PORT) flash` or `make flash` you can upload this build to an ES

With `idf.py -p (PORT) monitor` or `make monitor` you can see the debug output (please use this output if you open an issue) or trigger basic test commands (mouse movement or a keyboard key press) on
a connected target.

### esp32miniBT vs. Arduino Nano Connect

This firmware is used on 2 different devices in context of our assistive devices:
* __esp32miniBT module__: This board is located in this repository and is used as addon for v2 FLipMouse, FABI and FLipPad PCBs which use either a TeensyLC or a ProMicro controller.
* __Arduino Nano RP2040 Connect__: Version 3 of FLipMouse and FLipPad (maybe FABI as well) use this Arduino board, where we have a RP2040 controller AND the ESP32 on the same board (more RAM, more flash, cheaper than 2 boards).

__Note:__ Please select the correct type of board in `idf.py menuconfig`!

__Note:__ If you want to use this firmware on a custom board, you can select the external UART interface settings in menuconfig; for our boards the pinning, baudrate and UART config is pre-defined.

# Usage via Console or second UART

Expand Down
2 changes: 1 addition & 1 deletion main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ idf_component_register(SRCS "ble_hidd_demo_main.c"
"hid_dev.c"
"hid_device_le_prf.c"
INCLUDE_DIRS "."
REQUIRES esp_hid PRIV_REQUIRES esp32 esp_wifi esp_websocket_client esp_https_server esp_eth mdns lwip fatfs openssl esp_https_ota esp_hid app_update)
REQUIRES esp_hid PRIV_REQUIRES esp_wifi esp_https_server esp_eth nvs_flash lwip fatfs esp_https_ota esp_hid app_update)

target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-unused-const-variable)
98 changes: 31 additions & 67 deletions main/Kconfig.projbuild
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
menu "esp32_mouse_keyboard - FLipMouse & FABI config"

config MODULE_RX_PIN
int "RX pin for command/HID UART"
default 17
range 1 39

config MODULE_TX_PIN
int "TX pin for command/HID UART"
default 16
range 1 39

config MODULE_LED_PIN
int "LED connection indicator pin"
default 5
range 1 39

config MODULE_UART_NR
int "UART interface number"
default 2
range 1 2
menu "esp32_mouse_keyboard / FLipMouse & FABI config"
config USE_AS_FLIPMOUSE_FABI
bool "Use project as FLipMouse/FABI Bluetooth module"
default n
help
If this option is enabled, a FLipMouse/FABI Bluetooth module
is built. If disabled, this project acts as demo code for Bluetooth
HID code.

menu "Pinning for UART RX/TX & LED (if not a defined module)"
visible if !USE_AS_FLIPMOUSE_FABI

config MODULE_RX_PIN
int "RX pin for command/HID UART"
default 17
range 1 39

config MODULE_TX_PIN
int "TX pin for command/HID UART"
default 16
range 1 39

config MODULE_LED_PIN
int "LED connection indicator pin"
default 5
range 1 39

config MODULE_UART_NR
int "UART interface number"
default 2
range 1 2
endmenu
config MODULE_USEKEYBOARD
bool "Enable BLE-HID keyboard (UNUSED)"
default y
Expand Down Expand Up @@ -56,50 +66,4 @@ menu "esp32_mouse_keyboard - FLipMouse & FABI config"
If enabled, the module denies pairing requests by default.
It is possible to enable the pairing by sending the pairing en-/disable command
via the serial interface.


config USE_AS_FLIPMOUSE_FABI
bool "Use project as FLipMouse/FABI Bluetooth module"
default n
help
If this option is enabled, a FLipMouse/FABI Bluetooth module
is built. If disabled, this project acts as demo code for Bluetooth
HID code.
menu "FLipMouse / FABI configuration"
visible if USE_AS_FLIPMOUSE_FABI

choice MODULE_TYPE
prompt "Module type (FLipMouse/FABI)"
depends on USE_AS_FLIPMOUSE_FABI
help
Specify the module type (FLipMouse or FABI).

config MODULE_FLIPMOUSE
bool "FLipMouse"

config MODULE_FABI
bool "FABI"
endchoice

config FM_WEBGUI
bool "Enable WebGUI (UNUSED)"
default n
help
Enable the WebGUI for the FLipMouse in the ESP32.

config FM_OTA
depends on MODULE_FLIPMOUSE
bool "Enable programming via Teensy (UNUSED)"
default n
help
Enable the update functionality via the Teensy module.

config FABI_OTA
depends on MODULE_FABI
bool "Enable programming via ArduinoProMicro (UNUSED)"
default n
help
Enable the update functionality via the Arduino Pro Micro module.

endmenu
endmenu
Loading

0 comments on commit c4d9c87

Please sign in to comment.