File tree Expand file tree Collapse file tree
port/espressif/esp/src/hal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,7 +160,6 @@ pub const SPI = enum(u2) {
160160 self .set_bit_order (config .bit_order );
161161 }
162162
163- // TODO: not sure if this is the best way to do this
164163 pub inline fn connect_pins (_ : SPI , pins : struct {
165164 data : union (enum ) {
166165 single_one_wire : ? gpio.Pin ,
@@ -188,7 +187,7 @@ pub const SPI = enum(u2) {
188187 },
189188 .single_two_wires = > | maybe_pins | {
190189 if (maybe_pins .mosi ) | mosi | {
191- mosi .connect_input_to_peripheral (.{ .signal = .fspid });
190+ mosi .connect_peripheral_to_output (.{ .signal = .fspid });
192191 }
193192 if (maybe_pins .miso ) | miso | {
194193 miso .connect_input_to_peripheral (.{ .signal = .fspiq });
@@ -223,6 +222,10 @@ pub const SPI = enum(u2) {
223222 }
224223 },
225224 }
225+
226+ if (pins .clk ) | clk_pin | {
227+ clk_pin .connect_peripheral_to_output (.{ .signal = .spiclk });
228+ }
226229 }
227230
228231 pub fn writev_blocking (
You can’t perform that action at this time.
0 commit comments