serial_write
Simplifying serial output in a no_std
environment, both string and numeric.
List of possible output types
&str
i8
,i16
,i32
,i64
,isize
u8
,u16
,u32
,u64
,usize
f32
,f64
&[i8]
,&[i16]
,&[i32]
,&[i64]
,&[isize]
&[u8]
,&[u16]
,&[u32]
,&[u64]
,&[usize]
&[f32]
,&[f64]
How to use
1. Prepare SerialPort
// Set the USB bus
let usb_bus = new;
// Set the serial port
let mut serial = new;
2. Create Writer
let mut writer = new;
3. Output strings or numbers.
// Output "123".
writer.write_usize;
// Output "123" and break line.
writer.writeln_usize;
// Output to 2 decimal places ("12.34").
writer.write_usize;