Skip to content

Commit

Permalink
Remove reset from new
Browse files Browse the repository at this point in the history
  • Loading branch information
pbert519 committed Jun 19, 2024
1 parent fc1d758 commit 62fa975
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,15 @@ This driver can be used with the embedded graphics trait, currently only suppori
- Support display engine fill area
- Support display engine 1 bit per pixel mode
- Support static buffer allocations
- Make max buffer size configurable (default = 1kByte)
- Make gpio busy timeout configurable (default = 10s)
- Make lut timeout configurable (default = 10s)


## Changelog

### 0.4.0
- Buffer data type changed from u16 to u8
- **Public API**: `load_image_area`, `load_image`, and `memory_burst_write` functions are now using u8 as buffer type
- Memory usage is reduced by half (1kByte max. instead of 2kByte)
- **Behavior** Calling `init` no longer clears the eink display. Instead call `reset` directly.
5 changes: 1 addition & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ impl<IT8951Interface: interface::IT8951Interface> IT8951<IT8951Interface, Off> {

/// Initalize the driver and resets the display
/// VCOM should be given on your display
/// Since version 0.4.0, this function no longer resets the display
pub fn init(mut self, vcom: u16) -> Result<IT8951<IT8951Interface, Run>, Error> {
self.interface.reset()?;

Expand All @@ -139,15 +140,11 @@ impl<IT8951Interface: interface::IT8951Interface> IT8951<IT8951Interface, Off> {

it8951.dev_info = Some(dev_info);

// TODO check if necessary
it8951.reset()?;

Ok(it8951)
}

/// Create a new Driver for are already active and initalized driver
/// This can be usefull if the device was still powered on, but the uC restarts.
/// VCOM should be given on your display
pub fn attach(interface: IT8951Interface) -> Result<IT8951<IT8951Interface, Run>, Error> {
let mut it8951 = IT8951 {
interface,
Expand Down

0 comments on commit 62fa975

Please sign in to comment.