rp2: Add support for Nina-W10 WiFi/BT module.
This commit integrates the Nina-W10 driver as an optional component in the rp2 port.
This commit is contained in:
parent
43079aaf86
commit
3745c393c8
@ -166,6 +166,7 @@ if(MICROPY_PY_BLUETOOTH)
|
|||||||
list(APPEND MICROPY_SOURCE_PORT mpbthciport.c)
|
list(APPEND MICROPY_SOURCE_PORT mpbthciport.c)
|
||||||
target_compile_definitions(${MICROPY_TARGET} PRIVATE
|
target_compile_definitions(${MICROPY_TARGET} PRIVATE
|
||||||
MICROPY_PY_BLUETOOTH=1
|
MICROPY_PY_BLUETOOTH=1
|
||||||
|
MICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS=1
|
||||||
MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE=1
|
MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE=1
|
||||||
MICROPY_PY_BLUETOOTH_ENABLE_PAIRING_BONDING=1
|
MICROPY_PY_BLUETOOTH_ENABLE_PAIRING_BONDING=1
|
||||||
MICROPY_PY_BLUETOOTH_ENABLE_L2CAP_CHANNELS=1
|
MICROPY_PY_BLUETOOTH_ENABLE_L2CAP_CHANNELS=1
|
||||||
@ -188,6 +189,31 @@ if(MICROPY_BLUETOOTH_NIMBLE)
|
|||||||
list(APPEND MICROPY_INC_CORE ${NIMBLE_INCLUDE})
|
list(APPEND MICROPY_INC_CORE ${NIMBLE_INCLUDE})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (MICROPY_PY_NETWORK_NINAW10)
|
||||||
|
target_compile_definitions(${MICROPY_TARGET} PRIVATE
|
||||||
|
MICROPY_PY_NETWORK_NINAW10=1
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(${MICROPY_TARGET} PRIVATE
|
||||||
|
${MICROPY_DIR}/drivers/ninaw10/
|
||||||
|
)
|
||||||
|
|
||||||
|
# Enable NINA-W10 WiFi and Bluetooth drivers.
|
||||||
|
list(APPEND MICROPY_SOURCE_DRIVERS
|
||||||
|
${MICROPY_DIR}/drivers/ninaw10/nina_bt_hci.c
|
||||||
|
${MICROPY_DIR}/drivers/ninaw10/nina_wifi_drv.c
|
||||||
|
${MICROPY_DIR}/drivers/ninaw10/nina_wifi_bsp.c
|
||||||
|
)
|
||||||
|
|
||||||
|
list(APPEND MICROPY_SOURCE_EXTMOD
|
||||||
|
${MICROPY_DIR}/extmod/network_ninaw10.c
|
||||||
|
)
|
||||||
|
|
||||||
|
list(APPEND MICROPY_SOURCE_QSTR
|
||||||
|
${MICROPY_DIR}/extmod/network_ninaw10.c
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Define mpy-cross flags and frozen manifest
|
# Define mpy-cross flags and frozen manifest
|
||||||
set(MICROPY_CROSS_FLAGS -march=armv7m)
|
set(MICROPY_CROSS_FLAGS -march=armv7m)
|
||||||
if (NOT MICROPY_FROZEN_MANIFEST)
|
if (NOT MICROPY_FROZEN_MANIFEST)
|
||||||
|
@ -154,6 +154,20 @@ struct _mp_bluetooth_nimble_malloc_t;
|
|||||||
#define MICROPY_PORT_ROOT_POINTER_BLUETOOTH_NIMBLE
|
#define MICROPY_PORT_ROOT_POINTER_BLUETOOTH_NIMBLE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if MICROPY_PY_NETWORK_NINAW10
|
||||||
|
// This Network interface requires the extended socket state.
|
||||||
|
#ifndef MICROPY_PY_USOCKET_EXTENDED_STATE
|
||||||
|
#define MICROPY_PY_USOCKET_EXTENDED_STATE (1)
|
||||||
|
#endif
|
||||||
|
// It also requires an additional root pointer for the SPI object.
|
||||||
|
#define MICROPY_PORT_ROOT_POINTER_NINAW10 struct _machine_spi_obj_t *mp_wifi_spi;
|
||||||
|
extern const struct _mod_network_nic_type_t mod_network_nic_type_nina;
|
||||||
|
#define MICROPY_HW_NIC_NINAW10 { MP_ROM_QSTR(MP_QSTR_WLAN), MP_ROM_PTR(&mod_network_nic_type_nina) },
|
||||||
|
#else
|
||||||
|
#define MICROPY_HW_NIC_NINAW10
|
||||||
|
#define MICROPY_PORT_ROOT_POINTER_NINAW10
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MICROPY_PORT_BUILTIN_MODULES \
|
#define MICROPY_PORT_BUILTIN_MODULES \
|
||||||
{ MP_OBJ_NEW_QSTR(MP_QSTR_machine), (mp_obj_t)&mp_module_machine }, \
|
{ MP_OBJ_NEW_QSTR(MP_QSTR_machine), (mp_obj_t)&mp_module_machine }, \
|
||||||
{ MP_OBJ_NEW_QSTR(MP_QSTR__onewire), (mp_obj_t)&mp_module_onewire }, \
|
{ MP_OBJ_NEW_QSTR(MP_QSTR__onewire), (mp_obj_t)&mp_module_onewire }, \
|
||||||
@ -163,12 +177,13 @@ struct _mp_bluetooth_nimble_malloc_t;
|
|||||||
SOCKET_BUILTIN_MODULE \
|
SOCKET_BUILTIN_MODULE \
|
||||||
NETWORK_BUILTIN_MODULE \
|
NETWORK_BUILTIN_MODULE \
|
||||||
|
|
||||||
|
#define MICROPY_PORT_NETWORK_INTERFACES \
|
||||||
|
MICROPY_HW_NIC_NINAW10 \
|
||||||
|
|
||||||
#ifndef MICROPY_BOARD_ROOT_POINTERS
|
#ifndef MICROPY_BOARD_ROOT_POINTERS
|
||||||
#define MICROPY_BOARD_ROOT_POINTERS
|
#define MICROPY_BOARD_ROOT_POINTERS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MICROPY_PORT_NETWORK_INTERFACES \
|
|
||||||
|
|
||||||
#define MICROPY_PORT_ROOT_POINTERS \
|
#define MICROPY_PORT_ROOT_POINTERS \
|
||||||
const char *readline_hist[8]; \
|
const char *readline_hist[8]; \
|
||||||
void *machine_pin_irq_obj[30]; \
|
void *machine_pin_irq_obj[30]; \
|
||||||
@ -179,6 +194,7 @@ struct _mp_bluetooth_nimble_malloc_t;
|
|||||||
void *machine_i2s_obj[2]; \
|
void *machine_i2s_obj[2]; \
|
||||||
NETWORK_ROOT_POINTERS \
|
NETWORK_ROOT_POINTERS \
|
||||||
MICROPY_BOARD_ROOT_POINTERS \
|
MICROPY_BOARD_ROOT_POINTERS \
|
||||||
|
MICROPY_PORT_ROOT_POINTER_NINAW10 \
|
||||||
MICROPY_PORT_ROOT_POINTER_BLUETOOTH \
|
MICROPY_PORT_ROOT_POINTER_BLUETOOTH \
|
||||||
MICROPY_PORT_ROOT_POINTER_BLUETOOTH_NIMBLE \
|
MICROPY_PORT_ROOT_POINTER_BLUETOOTH_NIMBLE \
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user