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

[spi]: Keep constexpr constructor #2204

Merged
merged 8 commits into from
Nov 24, 2023
Merged

[spi]: Keep constexpr constructor #2204

merged 8 commits into from
Nov 24, 2023

Conversation

fpistm
Copy link
Member

@fpistm fpistm commented Nov 24, 2023

to ensures that constructing an SPISettings object can be done at compiletime.

This PR also:

  • revert the change made in SubGhz library.
  • clean up SubGhzSPI class since internal CS pin removed.
  • Remove skip receive from SPISettings as this is not a settings.
  • Allow to skip receive during transfer (SPI: improvements for SPI library #912).

Fixes #2201.

@fpistm fpistm added this to the 2.7.1 milestone Nov 24, 2023
@fpistm fpistm added this to In progress in STM32 core based on ST HAL via automation Nov 24, 2023
Keep constexpr constructor to ensures that constructing
an SPISettings object can be done at compiletime.

Fixes stm32duino#2201.

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
This parameter should not be part of SPISettings.

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Since internal CS pin removed.

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Linked to stm32duino#912.

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
for backward compatibility.
Example with Adafruit GFX Library library.

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
@fpistm
Copy link
Member Author

fpistm commented Nov 24, 2023

Tested with Radiolib with success using Nucleo WL55JC1 and LoRa E5 mini.

Note to have generic sketch example use the LORAWAN_RFSWITCH_* definition defined in the variant_*.h:

static const uint32_t rfswitch_pins[] = { LORAWAN_RFSWITCH_PINS
#if LORAWAN_RFSWITCH_PIN_COUNT == 2
                                          ,
                                          RADIOLIB_NC
#endif
};

static const Module::RfSwitchMode_t rfswitch_table[] = {
  { STM32WLx::MODE_IDLE, { LORAWAN_RFSWITCH_OFF_VALUES } },
  { STM32WLx::MODE_RX, { LORAWAN_RFSWITCH_RX_VALUES } },
  { STM32WLx::MODE_TX_LP, { LORAWAN_RFSWITCH_RFO_LP_VALUES } },
  { STM32WLx::MODE_TX_HP, { LORAWAN_RFSWITCH_RFO_HP_VALUES } },
  END_OF_MODE_TABLE,
};

@fpistm fpistm merged commit cd3043f into stm32duino:main Nov 24, 2023
23 checks passed
STM32 core based on ST HAL automation moved this from In progress to Done Nov 24, 2023
@fpistm fpistm deleted the spi_fixup branch November 24, 2023 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

SPISettings no longer constexpr
1 participant