File tree 3 files changed +8
-9
lines changed
cores/arduino/ard_sup/iomaster
3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,8 @@ ap3_err_t IOMaster::initialize(am_hal_iom_config_t config){
51
51
if (retVal32 != AM_HAL_STATUS_SUCCESS){ return AP3_ERR; }
52
52
53
53
// Configure the IOM pins. (Must be done by the inherited classes [this is just a reminder])
54
+
55
+ return AP3_OK;
54
56
}
55
57
56
58
ap3_err_t IOMaster::deinitialize ( void ){
Original file line number Diff line number Diff line change @@ -214,14 +214,11 @@ void SPIClass::setDataMode(uint8_t mode)
214
214
initialize ();
215
215
}
216
216
217
- // void SPIClass::setClockDivider(uint8_t div)
218
- // {
219
- // // if (div < SPI_MIN_CLOCK_DIVIDER) {
220
- // // _p_sercom->setBaudrateSPI(SPI_MIN_CLOCK_DIVIDER);
221
- // // } else {
222
- // // _p_sercom->setBaudrateSPI(div);
223
- // // }
224
- // }
217
+ void SPIClass::setClockDivider (uint8_t div)
218
+ {
219
+ _config.ui32ClockFreq = F_CPU / div ;
220
+ initialize ();
221
+ }
225
222
226
223
byte SPIClass::transfer (uint8_t data)
227
224
{
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ class SPIClass : public IOMaster {
104
104
105
105
void setBitOrder (BitOrder order);
106
106
void setDataMode (uint8_t uc_mode);
107
- // void setClockDivider(uint8_t uc_div);
107
+ void setClockDivider (uint8_t uc_div);
108
108
109
109
private:
110
110
void config (SPISettings settings);
You can’t perform that action at this time.
0 commit comments