diff --git a/src/interface/connection_interface.rs b/src/interface/connection_interface.rs index 7ae2cc5..4a4cad3 100644 --- a/src/interface/connection_interface.rs +++ b/src/interface/connection_interface.rs @@ -26,16 +26,16 @@ pub(crate) struct ConnectionInterface { } -impl ConnectionInterface +impl ConnectionInterface where - SPI: Write, + SPI: Write, CS: OutputPin, BUSY: InputPin, - DC: OutputPin, + DataCommand: OutputPin, RST: OutputPin, - D: DelayUs + DelayMs, + Delay: DelayUs + DelayMs, { - pub(crate) fn new(spi: SPI, cs: CS, busy: BUSY, dc: DC, rst: RST, delay: D) -> Self { + pub(crate) fn new(spi: SPI, cs: CS, busy: BUSY, dc: DataCommand, rst: RST, delay: Delay) -> Self { ConnectionInterface {spi, cs, busy, dc, rst, delay } } @@ -44,7 +44,7 @@ where /// Enables direct interaction with the device with the help of [send_data()](ConnectionInterface::send_data()) /// Should rarely be needed! /// //TODO: make public? - pub(crate) fn send_command(&mut self, command: T) -> Result<(), E> { + pub(crate) fn send_command(&mut self, command: T) -> Result<(), ErrorSpeziale> { // low for commands self.dc.set_low(); @@ -60,7 +60,7 @@ where /// /// Should rarely be needed! /// //TODO: make public? - pub(crate) fn send_data(&mut self, val: u8) -> Result<(), E> { + pub(crate) fn send_data(&mut self, val: u8) -> Result<(), ErrorSpeziale> { // high for data self.dc.set_high(); @@ -76,7 +76,7 @@ where /// /// Should rarely be needed! /// //TODO: make public? - pub(crate) fn send_data_x_times(&mut self, val: u8, repetitions: u16) -> Result<(), E> { + pub(crate) fn send_data_x_times(&mut self, val: u8, repetitions: u16) -> Result<(), ErrorSpeziale> { // high for data self.dc.set_high(); @@ -95,7 +95,7 @@ where /// /// Should rarely be needed! /// //TODO: make public? - pub(crate) fn send_multiple_data(&mut self, data: &[u8]) -> Result<(), E> { + pub(crate) fn send_multiple_data(&mut self, data: &[u8]) -> Result<(), ErrorSpeziale> { // high for data self.dc.set_high(); @@ -106,9 +106,9 @@ where } // spi write helper/abstraction function - pub(crate) fn with_cs(&mut self, f: F) -> Result<(), E> + pub(crate) fn with_cs(&mut self, f: F) -> Result<(), ErrorSpeziale> where - F: FnOnce(&mut Self) -> Result<(), E>, + F: FnOnce(&mut Self) -> Result<(), ErrorSpeziale>, { // activate spi with cs low self.cs.set_low(); @@ -129,8 +129,8 @@ where /// /// is_busy_low /// - /// - TRUE for epd4in2, epd1in54, epd2in13, epd2in7, epd5in83, epd7in5 - /// - FALSE for epd2in9 + /// - TRUE for epd4in2, epd2in13, epd2in7, epd5in83, epd7in5 + /// - FALSE for epd2in9, epd1in54 (for all Display Type A ones?) /// /// Most likely there was a mistake with the 2in9 busy connection pub(crate) fn wait_until_idle(&mut self, is_busy_low: bool) {