Skip to content

Commit

Permalink
feat(spi): add SPISettings constructor with uint8_t
Browse files Browse the repository at this point in the history
for backward compatibility.
Example with Adafruit GFX Library library.

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
  • Loading branch information
fpistm committed Nov 24, 2023
1 parent 8a01b92 commit e781dc7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libraries/SPI/src/SPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ extern "C" {

class SPISettings {
public:
constexpr SPISettings(uint32_t clock, BitOrder bitOrder, uint8_t dataMode)
: clockFreq(clock),
bitOrder(bitOrder),
dataMode((SPIMode)dataMode)
{ }
constexpr SPISettings(uint32_t clock, BitOrder bitOrder, SPIMode dataMode)
: clockFreq(clock),
bitOrder(bitOrder),
Expand Down

0 comments on commit e781dc7

Please sign in to comment.