Expand description
Defines types and interfaces that drivers use to interact with the core of DrMem.
Structs§
- Read
Only Device - Represents a read-only device that uses a specified type for its
reading. Any type that can be converted to a
device::Valueis acceptable. - Read
Write Device - Request
Chan - A handle which is used to communicate with the core of DrMem. When a driver is created, it will be given a handle to be used throughout its life.
Enums§
- Request
- Defines the requests that can be sent to core. Drivers don’t use
this type directly. They are indirectly used by
RequestChan.
Traits§
- API
- All drivers implement the
driver::APItrait.
Type Aliases§
- Driver
Config - Represents how configuration information is given to a driver.
Since each driver can have vastly different requirements, the
config structure needs to be as general as possible. A
DriverConfigtype is a map withStringkeys andtoml::Valuevalues. - Driver
Type - Defines a boxed type that supports the
driver::APItrait. - Name
- Represents the type used to specify the name of a driver.
- Report
Reading - A function that drivers use to report updated values of a device.
- RxDevice
Setting - Used by a driver to receive settings from a client.
- Setting
Reply - A closure type that defines how a driver replies to a setting
request. It can return
Ok()to show what value was actually used orErr()to indicate the setting failed. - Setting
Request - This type represents the data that is transferred in the communication channel. It simplifies the next two types.
- TxDevice
Setting - Used by client APIs to send setting requests to a driver.