File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed 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,
43
43
if (result != DIGITALINOUT_OK ) {
44
44
mp_raise_ValueError (translate ("Clock pin init failed." ));
45
45
}
46
+ common_hal_digitalio_digitalinout_switch_to_output (& self -> clock , self -> polarity == 1 , DRIVE_MODE_PUSH_PULL );
47
+
46
48
if (mosi != mp_const_none ) {
47
49
result = common_hal_digitalio_digitalinout_construct (& self -> mosi , mosi );
48
50
if (result != DIGITALINOUT_OK ) {
49
51
common_hal_digitalio_digitalinout_deinit (& self -> clock );
50
52
mp_raise_ValueError (translate ("MOSI pin init failed." ));
51
53
}
52
54
self -> has_mosi = true;
55
+ common_hal_digitalio_digitalinout_switch_to_output (& self -> mosi , false, DRIVE_MODE_PUSH_PULL );
53
56
}
57
+
54
58
if (miso != mp_const_none ) {
59
+ // Starts out as input by default, no need to change.
55
60
result = common_hal_digitalio_digitalinout_construct (& self -> miso , miso );
56
61
if (result != DIGITALINOUT_OK ) {
57
62
common_hal_digitalio_digitalinout_deinit (& self -> clock );
You can’t perform that action at this time.
0 commit comments