File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,15 +43,20 @@ void shared_module_bitbangio_spi_construct(bitbangio_spi_obj_t *self,
4343 if (result != DIGITALINOUT_OK ) {
4444 mp_raise_ValueError (translate ("Clock pin init failed." ));
4545 }
46+ common_hal_digitalio_digitalinout_switch_to_output (& self -> clock , self -> polarity == 1 , DRIVE_MODE_PUSH_PULL );
47+
4648 if (mosi != mp_const_none ) {
4749 result = common_hal_digitalio_digitalinout_construct (& self -> mosi , mosi );
4850 if (result != DIGITALINOUT_OK ) {
4951 common_hal_digitalio_digitalinout_deinit (& self -> clock );
5052 mp_raise_ValueError (translate ("MOSI pin init failed." ));
5153 }
5254 self -> has_mosi = true;
55+ common_hal_digitalio_digitalinout_switch_to_output (& self -> mosi , false, DRIVE_MODE_PUSH_PULL );
5356 }
57+
5458 if (miso != mp_const_none ) {
59+ // Starts out as input by default, no need to change.
5560 result = common_hal_digitalio_digitalinout_construct (& self -> miso , miso );
5661 if (result != DIGITALINOUT_OK ) {
5762 common_hal_digitalio_digitalinout_deinit (& self -> clock );
You can’t perform that action at this time.
0 commit comments