-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from rneswold/pr-issue110
✨ add `map` driver
- Loading branch information
Showing
6 changed files
with
451 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "drmem-api" | ||
version = "0.4.0" | ||
version = "0.4.1" | ||
authors = ["Rich Neswold <[email protected]>"] | ||
edition = "2021" | ||
description = "Traits and types used internally by the DrMem control system" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# drmem-drv-map | ||
|
||
A map device is a driver that maps a range of integers to a device | ||
value. The driver creates two devices, `index` and `output`. When the | ||
`index` is set, the driver finds the associated value and write both | ||
of them to the backend storage. Every setting will get sent to the | ||
backend -- even if the new value is the same as the old. | ||
|
||
## Configuration | ||
|
||
The configuration parameters for this driver are: | ||
|
||
- `initial` is an optional parameter. It is an integer which specifies | ||
the initial index to use when the driver starts. If no initial value | ||
is specified, the `output` device will be set to the default value. | ||
- `values` is an array of maps. Each map has three key/values: 1) | ||
'start' is an integer specifying the start of the index range, `end` | ||
is an optional parameter specifying the ending range, inclusive (if | ||
omitted, `end` is the same as `start`), and `value` is a value to | ||
output when the index device is set within this range. | ||
- `default` is the value that will be used if the `index` device gets | ||
set to a value that doesn't lie within any range. | ||
|
||
NOTE: when the driver starts, it makes sure that no range in the | ||
`values` array overlaps any other range. It also makes sure that all | ||
the values in the array and the default value are of the same type. | ||
|
||
## Devices | ||
|
||
The driver creates these devices: | ||
|
||
| Base Name | Type | Units | Comment | | ||
|-----------|------------|-------|--------------------------------------------------------------| | ||
| index | integer, RW | | The index value used to look up a value in the map. | | ||
| output | VALUE, RO | | This device gets updated everytime the `index` device gets updated. It gets set to the value determined by the map lookup. If the index didn't lie in any range, it gets set to the default value. | | ||
|
||
## History | ||
|
||
Added in v0.4.0. |
Oops, something went wrong.