mirror of
https://github.com/yuri91/ili9341-rs.git
synced 2024-11-21 14:30:58 +00:00
Loosen trait bounds
This commit is contained in:
parent
be44c24eea
commit
535feb236c
2 changed files with 8 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
use crate::{Ili9341, OutputPin};
|
||||
use crate::Ili9341;
|
||||
|
||||
use core::iter;
|
||||
|
||||
|
@ -17,7 +17,6 @@ use embedded_graphics::{
|
|||
impl<IFACE, RESET> DrawTarget<Rgb565> for Ili9341<IFACE, RESET>
|
||||
where
|
||||
IFACE: display_interface::WriteOnlyDataCommand,
|
||||
RESET: OutputPin,
|
||||
{
|
||||
type Error = display_interface::DisplayError;
|
||||
|
||||
|
|
|
@ -130,7 +130,12 @@ where
|
|||
|
||||
Ok(ili9341)
|
||||
}
|
||||
}
|
||||
|
||||
impl<IFACE, RESET> Ili9341<IFACE, RESET>
|
||||
where
|
||||
IFACE: WriteOnlyDataCommand,
|
||||
{
|
||||
fn command(&mut self, cmd: Command, args: &[u8]) -> Result {
|
||||
self.interface.send_commands(U8Iter(&mut once(cmd as u8)))?;
|
||||
self.interface.send_data(U8Iter(&mut args.iter().cloned()))
|
||||
|
@ -270,7 +275,9 @@ where
|
|||
self.mode = mode;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl<IFACE, RESET> Ili9341<IFACE, RESET> {
|
||||
/// Get the current screen width. It can change based on the current orientation
|
||||
pub fn width(&self) -> usize {
|
||||
self.width
|
||||
|
|
Loading…
Reference in a new issue