Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: Add shield_llcc68 module #20885

Merged
merged 2 commits into from
Oct 2, 2024
Merged
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
7 changes: 7 additions & 0 deletions drivers/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 44 additions & 0 deletions drivers/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,22 @@
* @ingroup drivers_shield
* @brief Driver for the Arduino W5100 Ethernet Shield
*
* Overview
* ========
*
* @image html https://docs.arduino.cc/static/61f89cdbee1f4b4d00168ea63d9fbd6a/6aca1/a000072_featured.jpg "Photo of the Arduino Ethernet Shield" width=50%
*
* | Key | Value |
* |:---------------------- |:--------------------------------------------------------------------- |
* | Abstract | Ethernet Network Card |
* | Product Name | Arduino Ethernet Shield |
* | Vendor | Arduino |
* | Vendor Doc | [Product Homepage][shield_w5100_hp] |
* | Attachment Standard | Arduino UNO Shield (ISP-SPI required) |
*
* [shield_w5100_hp]: http://web.archive.org/web/20240910190853/https://docs.arduino.cc/retired/shields/arduino-ethernet-shield-without-poe-module/
*
*
* Usage
* =====
*
Expand All @@ -150,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
* ```
*/
62 changes: 37 additions & 25 deletions drivers/sx126x/include/sx126x_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,70 +23,82 @@
#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
*
* Default values are adapted for mbed shield used with to nucleo64 boards
* @{
*/
#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, \
Expand Down
1 change: 1 addition & 0 deletions makefiles/pseudomodules.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading