Struct stm32_uart_loader::Programmer[][src]

pub struct Programmer<P, D, E> { /* fields omitted */ }

Implementations

impl Programmer<Serial, Delay, IoErrorKind>[src]

pub fn linux<P: AsRef<Path>>(
    port: P,
    baud: usize,
    options: Options
) -> Result<Self, Error>
[src]

Create a new linux serial port programmer instance

impl<P, D, E> Programmer<P, D, E> where
    P: SerialPort<E>,
    D: DelayMs<u32>,
    E: Debug
[src]

pub fn new(port: P, delay: D, options: Options) -> Result<Self, Error<E>>[src]

Create a new programmer instance and connect to the attached bootloader

pub fn info(&mut self) -> Result<u8, Error<E>>[src]

Fetch bootloader info byte

pub fn erase(&mut self, page_offset: u8, page_count: u8) -> Result<(), Error<E>>[src]

Erase pages by page offset and count

pub fn erase_pages(&mut self, pages: &[u8]) -> Result<(), Error<E>>[src]

Erase pages by page number

pub fn erase_all(&mut self) -> Result<(), Error<E>>[src]

Erase the entire flash

pub fn read(&mut self, addr: u32, data: &mut [u8]) -> Result<(), Error<E>>[src]

Read memory from the device

pub fn write(&mut self, addr: u32, data: &[u8]) -> Result<(), Error<E>>[src]

Write memory to the device

pub fn reset(&mut self, bootloader: bool) -> Result<(), Error<E>>[src]

Reset the device using RTS while asserting DTR entering the bootloading or application

pub fn chip_id(&mut self) -> Result<u16, Error<E>>[src]

Fetch device chip ID (not-working)

pub fn write_cmd(&mut self, command: Command) -> Result<(), Error<E>>[src]

Write a bootloader command to the device

pub fn write_bytes(&mut self, data: &[u8]) -> Result<(), Error<E>>[src]

pub fn write_bytes_csum(&mut self, data: &[u8]) -> Result<(), Error<E>>[src]

Write data with xor checksum

pub fn read_char(&mut self) -> Result<u8, Error<E>>[src]

Read a single character from the device

Auto Trait Implementations

impl<P, D, E> RefUnwindSafe for Programmer<P, D, E> where
    D: RefUnwindSafe,
    E: RefUnwindSafe,
    P: RefUnwindSafe
[src]

impl<P, D, E> Send for Programmer<P, D, E> where
    D: Send,
    E: Send,
    P: Send
[src]

impl<P, D, E> Sync for Programmer<P, D, E> where
    D: Sync,
    E: Sync,
    P: Sync
[src]

impl<P, D, E> Unpin for Programmer<P, D, E> where
    D: Unpin,
    E: Unpin,
    P: Unpin
[src]

impl<P, D, E> UnwindSafe for Programmer<P, D, E> where
    D: UnwindSafe,
    E: UnwindSafe,
    P: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.