mirror of
https://github.com/yuri91/ili9341-rs.git
synced 2024-11-24 23:50:59 +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;
|
use core::iter;
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@ use embedded_graphics::{
|
||||||
impl<IFACE, RESET> DrawTarget<Rgb565> for Ili9341<IFACE, RESET>
|
impl<IFACE, RESET> DrawTarget<Rgb565> for Ili9341<IFACE, RESET>
|
||||||
where
|
where
|
||||||
IFACE: display_interface::WriteOnlyDataCommand,
|
IFACE: display_interface::WriteOnlyDataCommand,
|
||||||
RESET: OutputPin,
|
|
||||||
{
|
{
|
||||||
type Error = display_interface::DisplayError;
|
type Error = display_interface::DisplayError;
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,12 @@ where
|
||||||
|
|
||||||
Ok(ili9341)
|
Ok(ili9341)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<IFACE, RESET> Ili9341<IFACE, RESET>
|
||||||
|
where
|
||||||
|
IFACE: WriteOnlyDataCommand,
|
||||||
|
{
|
||||||
fn command(&mut self, cmd: Command, args: &[u8]) -> Result {
|
fn command(&mut self, cmd: Command, args: &[u8]) -> Result {
|
||||||
self.interface.send_commands(U8Iter(&mut once(cmd as u8)))?;
|
self.interface.send_commands(U8Iter(&mut once(cmd as u8)))?;
|
||||||
self.interface.send_data(U8Iter(&mut args.iter().cloned()))
|
self.interface.send_data(U8Iter(&mut args.iter().cloned()))
|
||||||
|
@ -270,7 +275,9 @@ where
|
||||||
self.mode = mode;
|
self.mode = mode;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<IFACE, RESET> Ili9341<IFACE, RESET> {
|
||||||
/// Get the current screen width. It can change based on the current orientation
|
/// Get the current screen width. It can change based on the current orientation
|
||||||
pub fn width(&self) -> usize {
|
pub fn width(&self) -> usize {
|
||||||
self.width
|
self.width
|
||||||
|
|
Loading…
Reference in a new issue