Skip to content

Commit 10af0a2

Browse files
SaintSampodpgeorge
authored andcommitted
rp2/boards/CYTRON_NANOXRP_CONTROLLER: Add support for NanoXRP board.
The NanoXRP is a small version of the XRP Robot using rp2040. Signed-off-by: Jacob Williams <jwilliams@experiential.bot>
1 parent 68c2d4e commit 10af0a2

5 files changed

Lines changed: 115 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"deploy": [
3+
"../deploy.md"
4+
],
5+
"docs": "",
6+
"features": [
7+
"BLE",
8+
"Dual-core",
9+
"External Flash",
10+
"IMU",
11+
"JST-SH",
12+
"USB",
13+
"WiFi"
14+
],
15+
"images": [
16+
"nanoxrp-board.jpg"
17+
],
18+
"mcu": "rp2040",
19+
"product": "NanoXRP Controller",
20+
"thumbnail": "",
21+
"url": "https://www.experiential.bot/",
22+
"vendor": "Cytron"
23+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
include("$(PORT_DIR)/boards/manifest.py")
2+
3+
require("bundle-networking")
4+
5+
# Bluetooth
6+
require("aioble")
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# cmake file for Cytron NanoXRP Controller
2+
3+
set(PICO_BOARD "pico_w")
4+
5+
set(MICROPY_PY_LWIP ON)
6+
set(MICROPY_PY_NETWORK_CYW43 ON)
7+
8+
# Bluetooth
9+
set(MICROPY_PY_BLUETOOTH ON)
10+
set(MICROPY_BLUETOOTH_BTSTACK ON)
11+
set(MICROPY_PY_BLUETOOTH_CYW43 ON)
12+
13+
# Board specific version of the frozen manifest
14+
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Board and hardware specific configuration
2+
#define MICROPY_HW_BOARD_NAME "Cytron NanoXRP Controller"
3+
4+
// todo: We need something to check our binary size
5+
#define MICROPY_HW_FLASH_STORAGE_BYTES (848 * 1024)
6+
7+
// Enable networking.
8+
#define MICROPY_PY_NETWORK 1
9+
#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "NanoXRP"
10+
11+
// CYW43 driver configuration.
12+
#define CYW43_USE_SPI (1)
13+
#define CYW43_LWIP (1)
14+
#define CYW43_GPIO (1)
15+
#define CYW43_SPI_PIO (1)
16+
17+
// For debugging mbedtls - also set
18+
// Debug level (0-4) 1=warning, 2=info, 3=debug, 4=verbose
19+
// #define MODUSSL_MBEDTLS_DEBUG_LEVEL 1
20+
21+
#define MICROPY_HW_PIN_EXT_COUNT CYW43_WL_GPIO_COUNT
22+
23+
// If this returns true for a pin then its irq will not be disabled on a soft reboot
24+
int mp_hal_is_pin_reserved(int n);
25+
#define MICROPY_HW_PIN_RESERVED(i) mp_hal_is_pin_reserved(i)
26+
27+
#define MICROPY_HW_USB_VID (0x2E8A)
28+
#define MICROPY_HW_USB_PID (0x110A)
29+
30+
#define MICROPY_HW_I2C1_SDA (14)
31+
#define MICROPY_HW_I2C1_SCL (15)
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# XRP default pin names
2+
MOTOR_L_IN_1,GPIO10
3+
MOTOR_L_IN_2,GPIO11
4+
MOTOR_R_IN_1,GPIO1
5+
MOTOR_R_IN_2,GPIO0
6+
MOTOR_3_IN_1,GPIO7
7+
MOTOR_3_IN_2,GPIO6
8+
MOTOR_L_ENCODER_A,GPIO9
9+
MOTOR_L_ENCODER_B,GPIO8
10+
MOTOR_R_ENCODER_A,GPIO3
11+
MOTOR_R_ENCODER_B,GPIO2
12+
MOTOR_3_ENCODER_A,GPIO5
13+
MOTOR_3_ENCODER_B,GPIO4
14+
SERVO_1,GPIO16
15+
SERVO_2,GPIO17
16+
I2C_SDA_0,GPIO4
17+
I2C_SCL_0,GPIO5
18+
I2C_SDA_1,GPIO14
19+
I2C_SCL_1,GPIO15
20+
DISTANCE_TRIGGER,GPIO22
21+
DISTANCE_ECHO,GPIO21
22+
LINE_L,GPIO26
23+
LINE_M,GPIO27
24+
LINE_R,GPIO28
25+
BOARD_VIN_MEASURE,GPIO29
26+
BOARD_USER_BUTTON,GPIO20
27+
BOARD_NEOPIXEL,GPIO12
28+
BOARD_BUZZER,GPIO13
29+
BOARD_LED,EXT_GPIO0
30+
31+
# XRP alternate pin names
32+
RANGE_TRIGGER,GPIO22
33+
RANGE_ECHO,GPIO21
34+
35+
# LED default names
36+
LED,EXT_GPIO0
37+
38+
# Radio GPIO pins
39+
WL_GPIO0,EXT_GPIO0
40+
WL_GPIO1,EXT_GPIO1
41+
WL_GPIO2,EXT_GPIO2

0 commit comments

Comments
 (0)