pub unsafe trait UartAddress {
// Required methods
fn get_read_address(&self, register: ReadableRegister) -> RegisterAddress;
fn get_write_address(&self, register: WriteableRegister) -> RegisterAddress;
}
Expand description
Represents an address type for a UART device, allowing idiomatic access to register addresses, and allowing any number of constraints to be encoded based on the hardware implemenation of the UART IO (whether port or memory mapped).
§Safety
- The type may only be constructed only with a valid UART base address.
- Ensure returned addresses are valid to read or write the register
passed in
UartAddress::get_read_address
orUartAddress::get_write_address
.