diff --git a/drivers/Makefile.dep b/drivers/Makefile.dep index 5f2f4d832a..35afb62c1f 100644 --- a/drivers/Makefile.dep +++ b/drivers/Makefile.dep @@ -192,6 +192,13 @@ ifneq (,$(filter servo_%,$(USEMODULE))) USEMODULE += servo endif +ifneq (,$(filter shield_llcc68,$(USEMODULE))) + FEATURES_REQUIRED += arduino_pins + FEATURES_REQUIRED += arduino_shield_uno + FEATURES_REQUIRED += arduino_spi + USEMODULE += llcc68 +endif + ifneq (,$(filter shield_w5100,$(USEMODULE))) FEATURES_REQUIRED += arduino_pins FEATURES_REQUIRED += arduino_shield_isp diff --git a/drivers/doc.txt b/drivers/doc.txt index 0aa28a3c36..740f9f9734 100644 --- a/drivers/doc.txt +++ b/drivers/doc.txt @@ -166,3 +166,31 @@ * It should work out of the box for any fully Arduino UNO compatible board * (including the ISP header) and correct I/O mapping (`arduino_*`) features. */ + +/** + * @defgroup drivers_shield_llcc68 LLCC68 Arduino LoRa Shield + * @ingroup drivers_shield + * @brief LLCC68 Arduino LoRa Shield + * + * # Overview + * + * @image html https://www.semtech.com/uploads/products/product/LLCC68MB2BAS_image2_horiz_300x300px.jpg "Photo of the LLCC68 Shield" width=50% + * + * | Key | Value | + * |:---------------------- |:--------------------------------------------------------------------- | + * | Abstract | LoRa Transceiver | + * | Product Name | LLCC68MB2CAS0 | + * | Vendor | Semtech | + * | Vendor Doc | [Product Homepage][shield_llcc68_hp] | + * | Attachment Standard | Arduino UNO Shield (Side SPI used, no ISP-SPI required) | + * + * [shield_llcc68_hp]: http://web.archive.org/web/20240528223141/https://www.semtech.com/products/wireless-rf/lora-connect/llcc68mb2cas + * + * # Usage + * + * Use the `shield_llcc68` module, e.g. using + * + * ``` + * USEMODULE=shield_llcc68 make BOARD=arduino-zero -C examples/lorawan + * ``` + */ diff --git a/drivers/sx126x/include/sx126x_params.h b/drivers/sx126x/include/sx126x_params.h index e0978d5dba..09d2a6d0d6 100644 --- a/drivers/sx126x/include/sx126x_params.h +++ b/drivers/sx126x/include/sx126x_params.h @@ -23,10 +23,22 @@ #include "sx126x.h" #include "sx126x_driver.h" +#ifdef MODULE_SHIELD_LC68 +# include "arduino_iomap.h" +#endif + #ifdef __cplusplus extern "C" { #endif +#ifdef MODULE_SHIELD_LLCC68 +# define SX126X_PARAM_SPI ARDUINO_SPI_D11D12D13 +# define SX126X_PARAM_SPI_NSS ARDUINO_PIN_7 +# define SX126X_PARAM_RESET ARDUINO_PIN_A0 +# define SX126X_PARAM_BUSY ARDUINO_PIN_3 +# define SX126X_PARAM_DIO1 ARDUINO_PIN_5 +#endif + /** * @name Set default configuration parameters * @@ -34,59 +46,59 @@ extern "C" { * @{ */ #ifndef SX126X_PARAM_SPI -#define SX126X_PARAM_SPI SPI_DEV(0) +# define SX126X_PARAM_SPI SPI_DEV(0) #endif #ifndef SX126X_PARAM_SPI_NSS -#define SX126X_PARAM_SPI_NSS GPIO_PIN(0, 8) /* D7 */ +# define SX126X_PARAM_SPI_NSS GPIO_PIN(0, 8) /* D7 */ #endif #ifndef SX126X_PARAM_RESET -#define SX126X_PARAM_RESET GPIO_PIN(0, 0) /* A0 */ +# define SX126X_PARAM_RESET GPIO_PIN(0, 0) /* A0 */ #endif #ifndef SX126X_PARAM_BUSY -#define SX126X_PARAM_BUSY GPIO_PIN(1, 3) /* D3 */ +# define SX126X_PARAM_BUSY GPIO_PIN(1, 3) /* D3 */ #endif #ifndef SX126X_PARAM_DIO1 -#define SX126X_PARAM_DIO1 GPIO_PIN(1, 4) /* D5 */ +# define SX126X_PARAM_DIO1 GPIO_PIN(1, 4) /* D5 */ #endif #ifndef SX126X_PARAM_REGULATOR -#define SX126X_PARAM_REGULATOR SX126X_REG_MODE_DCDC +# define SX126X_PARAM_REGULATOR SX126X_REG_MODE_DCDC #endif #ifndef SX126X_PARAM_SET_RF_MODE_CB -#define SX126X_PARAM_SET_RF_MODE_CB NULL +# define SX126X_PARAM_SET_RF_MODE_CB NULL #endif #ifndef SX126X_PARAM_TX_PA_MODE -#define SX126X_PARAM_TX_PA_MODE SX126X_RF_MODE_TX_LPA +# define SX126X_PARAM_TX_PA_MODE SX126X_RF_MODE_TX_LPA #endif #ifndef SX126X_PARAM_TYPE -# if IS_USED(MODULE_SX1261) -# define SX126X_PARAM_TYPE SX126X_TYPE_SX1261 -# elif IS_USED(MODULE_SX1262) -# define SX126X_PARAM_TYPE SX126X_TYPE_SX1262 -# elif IS_USED(MODULE_SX1268) -# define SX126X_PARAM_TYPE SX126X_TYPE_SX1268 -# elif IS_USED(MODULE_LLCC68) -# define SX126X_PARAM_TYPE SX126X_TYPE_LLCC68 -# elif IS_USED(MODULE_SX126X_STM32WL) -# define SX126X_PARAM_TYPE SX126X_TYPE_STM32WL -# else -# error "You should select at least one of the SX126x variants." -# endif +# if IS_USED(MODULE_SX1261) +# define SX126X_PARAM_TYPE SX126X_TYPE_SX1261 +# elif IS_USED(MODULE_SX1262) +# define SX126X_PARAM_TYPE SX126X_TYPE_SX1262 +# elif IS_USED(MODULE_SX1268) +# define SX126X_PARAM_TYPE SX126X_TYPE_SX1268 +# elif IS_USED(MODULE_LLCC68) +# define SX126X_PARAM_TYPE SX126X_TYPE_LLCC68 +# elif IS_USED(MODULE_SX126X_STM32WL) +# define SX126X_PARAM_TYPE SX126X_TYPE_STM32WL +# else +# error "You should select at least one of the SX126x variants." +# endif #endif #if IS_USED(MODULE_SX126X_RF_SWITCH) -#define SX126X_SET_RF_MODE .set_rf_mode = SX126X_PARAM_SET_RF_MODE_CB, -#define SX126X_TX_PA_MODE .tx_pa_mode = SX126X_PARAM_TX_PA_MODE +# define SX126X_SET_RF_MODE .set_rf_mode = SX126X_PARAM_SET_RF_MODE_CB, +# define SX126X_TX_PA_MODE .tx_pa_mode = SX126X_PARAM_TX_PA_MODE #else -#define SX126X_SET_RF_MODE -#define SX126X_TX_PA_MODE +# define SX126X_SET_RF_MODE +# define SX126X_TX_PA_MODE #endif #define SX126X_PARAMS { .spi = SX126X_PARAM_SPI, \ diff --git a/makefiles/pseudomodules.inc.mk b/makefiles/pseudomodules.inc.mk index fb28302282..bbc6c00a91 100644 --- a/makefiles/pseudomodules.inc.mk +++ b/makefiles/pseudomodules.inc.mk @@ -463,6 +463,7 @@ PSEUDOMODULES += shell_cmd_vfs PSEUDOMODULES += shell_cmds_default PSEUDOMODULES += shell_hooks PSEUDOMODULES += shell_lock_auto_locking +PSEUDOMODULES += shield_llcc68 PSEUDOMODULES += shield_w5100 PSEUDOMODULES += slipdev_stdio PSEUDOMODULES += slipdev_l2addr