MCPcopy Create free account
hub / github.com/SharpCoder/teensycore / uart_sw_reset

Function uart_sw_reset

src/phys/uart.rs:298–308  ·  view source on GitHub ↗

Set the software reset pin on or off

(device: Device, sw_reset: bool)

Source from the content-addressed store, hash-verified

296
297// Set the software reset pin on or off
298pub fn uart_sw_reset(device: Device, sw_reset: bool) {
299 let value = match sw_reset {
300 true => 0x2,
301 false => 0x0,
302 };
303
304 assign(get_addr(device) + 0x8, value);
305
306 // Solves what I believe is a timing issue.
307 wait_exact_ns(1);
308}
309
310pub fn uart_configure(device: Device, configuration: UartConfig) {
311 let addr = get_addr(device) + 0x18;

Callers 1

initializeMethod · 0.85

Calls 3

assignFunction · 0.85
wait_exact_nsFunction · 0.85
get_addrFunction · 0.70

Tested by

no test coverage detected