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

chore: allow some redefinitions #11

Merged
merged 1 commit into from
Jan 30, 2023
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
28 changes: 21 additions & 7 deletions src/BSP/radio_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,48 +50,62 @@
* @brief drive value used anytime radio is NOT in TX low power mode
* @note override the default configuration of radio_driver.c
*/
#define SMPS_DRIVE_SETTING_DEFAULT SMPS_DRV_40
#ifndef SMPS_DRIVE_SETTING_DEFAULT
#define SMPS_DRIVE_SETTING_DEFAULT SMPS_DRV_40
#endif

/**
* @brief drive value used anytime radio is in TX low power mode
* TX low power mode is the worst case because the PA sinks from SMPS
* while in high power mode, current is sunk directly from the battery
* @note override the default configuration of radio_driver.c
*/
#define SMPS_DRIVE_SETTING_MAX SMPS_DRV_60
#ifndef SMPS_DRIVE_SETTING_MAX
#define SMPS_DRIVE_SETTING_MAX SMPS_DRV_60
#endif

/**
* @brief Provides the frequency of the chip running on the radio and the frequency step
* @remark These defines are used for computing the frequency divider to set the RF frequency
* @note override the default configuration of radio_driver.c
*/
#define XTAL_FREQ ( 32000000UL )
#ifndef XTAL_FREQ
#define XTAL_FREQ ( 32000000UL )
#endif

/**
* @brief in XO mode, set internal capacitor (from 0x00 to 0x2F starting 11.2pF with 0.47pF steps)
* @note override the default configuration of radio_driver.c
*/
#define XTAL_DEFAULT_CAP_VALUE ( 0x20UL )
#ifndef XTAL_DEFAULT_CAP_VALUE
#define XTAL_DEFAULT_CAP_VALUE ( 0x20UL )
#endif /* XTAL_DEFAULT_CAP_VALUE */

/**
* @brief voltage of vdd tcxo.
* @note override the default configuration of radio_driver.c
*/
#define TCXO_CTRL_VOLTAGE TCXO_CTRL_1_7V
#ifndef TCXO_CTRL_VOLTAGE
#define TCXO_CTRL_VOLTAGE TCXO_CTRL_1_7V
#endif

/**
* @brief Radio maximum wakeup time (in ms)
* @note override the default configuration of radio_driver.c
*/
#define RF_WAKEUP_TIME ( 1UL )
#ifndef RF_WAKEUP_TIME
#define RF_WAKEUP_TIME ( 1UL )
#endif

/**
* @brief DCDC is enabled
* @remark this define is only used if the DCDC is present on the board
* (as indicated by RBI_IsDCDC())
* @note override the default configuration of radio_driver.c
*/
#define DCDC_ENABLE ( 1UL )
#ifndef DCDC_ENABLE
#define DCDC_ENABLE ( 1UL )
#endif

/**
* @brief disable the Sigfox radio modulation
Expand Down
16 changes: 12 additions & 4 deletions src/STM32CubeWL/LoRaWAN/Mac/Region/RegionEU868.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ extern "C"
/*!
* Maximal datarate that can be used by the node
*/
#define EU868_TX_MAX_DATARATE DR_7
#ifndef EU868_TX_MAX_DATARATE
#define EU868_TX_MAX_DATARATE DR_7
#endif

/*!
* Minimal datarate that can be used by the node
Expand All @@ -87,12 +89,16 @@ extern "C"
/*!
* Maximal datarate that can be used by the node
*/
#define EU868_RX_MAX_DATARATE DR_7
#ifndef EU868_RX_MAX_DATARATE
#define EU868_RX_MAX_DATARATE DR_7
#endif

/*!
* Default datarate used by the node
*/
#define EU868_DEFAULT_DATARATE DR_0
#ifndef EU868_DEFAULT_DATARATE
#define EU868_DEFAULT_DATARATE DR_0
#endif

/*!
* Minimal Rx1 receive datarate offset
Expand Down Expand Up @@ -127,7 +133,9 @@ extern "C"
/*!
* Default antenna gain
*/
#define EU868_DEFAULT_ANTENNA_GAIN 2.15f
#ifndef EU868_DEFAULT_ANTENNA_GAIN
#define EU868_DEFAULT_ANTENNA_GAIN 2.15f
#endif

/*!
* Enabled or disabled the duty cycle
Expand Down