Commit f5246cf4 authored by BuzzRage's avatar BuzzRage Committed by Me No Dev

Adding a getClockDivider function (#1355)

* Adding getClockDivider function

* indentation correction
parent 6bf7619c
......@@ -31,7 +31,7 @@ SPIClass::SPIClass(uint8_t spi_bus)
,_ss(-1)
,_div(0)
,_freq(1000000)
, _inTransaction(false)
,_inTransaction(false)
{}
void SPIClass::begin(int8_t sck, int8_t miso, int8_t mosi, int8_t ss)
......@@ -109,6 +109,11 @@ void SPIClass::setClockDivider(uint32_t clockDiv)
spiSetClockDiv(_spi, _div);
}
uint32_t SPIClass::getClockDivider()
{
return spiGetClockDiv(_spi);
}
void SPIClass::setDataMode(uint8_t dataMode)
{
spiSetDataMode(_spi, dataMode);
......
......@@ -60,6 +60,8 @@ public:
void setDataMode(uint8_t dataMode);
void setFrequency(uint32_t freq);
void setClockDivider(uint32_t clockDiv);
uint32_t getClockDivider();
void beginTransaction(SPISettings settings);
void endTransaction(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment