diff options
| author | Yannick <[email protected]> | 2025-11-05 16:01:47 +0100 |
|---|---|---|
| committer | Yannick Steiner <[email protected]> | 2025-11-06 11:51:27 +0100 |
| commit | d44219123ff95f151bd523c7fab057c51f96f368 (patch) | |
| tree | e3a656dfa24a4512dfb4b4a13b1909c14eceac09 | |
| parent | 33f256ad01a1997b31e062d11fc45d1579609068 (diff) | |
stm32/dsi: support short write without parameters
| -rw-r--r-- | embassy-stm32/src/dsihost.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/embassy-stm32/src/dsihost.rs b/embassy-stm32/src/dsihost.rs index fd1682d2b..59a2cbcdb 100644 --- a/embassy-stm32/src/dsihost.rs +++ b/embassy-stm32/src/dsihost.rs | |||
| @@ -121,17 +121,15 @@ impl<'d, T: Instance> DsiHost<'d, T> { | |||
| 121 | 121 | ||
| 122 | /// DCS or Generic short/long write command | 122 | /// DCS or Generic short/long write command |
| 123 | pub fn write_cmd(&mut self, channel_id: u8, address: u8, data: &[u8]) -> Result<(), Error> { | 123 | pub fn write_cmd(&mut self, channel_id: u8, address: u8, data: &[u8]) -> Result<(), Error> { |
| 124 | assert!(data.len() > 0); | 124 | match data.len() { |
| 125 | 125 | 0 => self.short_write(channel_id, PacketType::DcsShortPktWriteP0, address, 0), | |
| 126 | if data.len() == 1 { | 126 | 1 => self.short_write(channel_id, PacketType::DcsShortPktWriteP1, address, data[0]), |
| 127 | self.short_write(channel_id, PacketType::DcsShortPktWriteP1, address, data[0]) | 127 | _ => self.long_write( |
| 128 | } else { | ||
| 129 | self.long_write( | ||
| 130 | channel_id, | 128 | channel_id, |
| 131 | PacketType::DcsLongPktWrite, // FIXME: This might be a generic long packet, as well... | 129 | PacketType::DcsLongPktWrite, // FIXME: This might be a generic long packet, as well... |
| 132 | address, | 130 | address, |
| 133 | data, | 131 | data, |
| 134 | ) | 132 | ), |
| 135 | } | 133 | } |
| 136 | } | 134 | } |
| 137 | 135 | ||
