mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
retire work around for rust issue 90195 in I2C
This commit is contained in:
parent
b32cde6870
commit
da89a61a28
1 changed files with 4 additions and 7 deletions
|
|
@ -33,17 +33,14 @@ pub(crate) enum I2cCallback {
|
||||||
// and create a "public" version for return values via callbacks. But for now, it's pretty
|
// and create a "public" version for return values via callbacks. But for now, it's pretty
|
||||||
// convenient to reach into the state of the I2C machine to debug problems in the callbacks.
|
// convenient to reach into the state of the I2C machine to debug problems in the callbacks.
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub (crate) const I2C_MAX_LEN: usize = 33; // note: due to a regression in Rust 1.56, we can't use the I2C_MAX_LEN symbol in the structure below. So you must manually update that if you change it here.
|
pub (crate) const I2C_MAX_LEN: usize = 33;
|
||||||
// pending https://github.com/rust-lang/rust/issues/90195
|
|
||||||
#[derive(Debug, Copy, Clone, Archive, Serialize, Deserialize)]
|
#[derive(Debug, Copy, Clone, Archive, Serialize, Deserialize)]
|
||||||
pub struct I2cTransaction {
|
pub struct I2cTransaction {
|
||||||
pub bus_addr: u8,
|
pub bus_addr: u8,
|
||||||
// write address and read address are encoded in the packet field below
|
// write address and read address are encoded in the packet field below
|
||||||
// NOTE: the number 33 that appears twice below mirrors I2C_MAX_LEN; due to a regression in Rust 1.56 we can't use constants in array types
|
pub txbuf: Option<[u8; I2C_MAX_LEN]>,
|
||||||
// pending https://github.com/rust-lang/rust/issues/90195
|
|
||||||
pub txbuf: Option<[u8; 33]>,
|
|
||||||
pub txlen: u32,
|
pub txlen: u32,
|
||||||
pub rxbuf: Option<[u8; 33]>,
|
pub rxbuf: Option<[u8; I2C_MAX_LEN]>,
|
||||||
pub rxlen: u32,
|
pub rxlen: u32,
|
||||||
pub listener: Option<(u32, u32, u32, u32)>, // where Rx split transactions should be routed to
|
pub listener: Option<(u32, u32, u32, u32)>, // where Rx split transactions should be routed to
|
||||||
pub timeout_ms: u32,
|
pub timeout_ms: u32,
|
||||||
|
|
@ -78,7 +75,7 @@ pub struct I2cAsyncReadHook {
|
||||||
/// The data reported by an I2cAsycReadHook message
|
/// The data reported by an I2cAsycReadHook message
|
||||||
#[derive(Debug, Copy, Clone, Archive, Serialize, Deserialize)]
|
#[derive(Debug, Copy, Clone, Archive, Serialize, Deserialize)]
|
||||||
pub struct I2cReadResult {
|
pub struct I2cReadResult {
|
||||||
pub rxbuf: [u8; 33],
|
pub rxbuf: [u8; I2C_MAX_LEN],
|
||||||
pub rxlen: u32,
|
pub rxlen: u32,
|
||||||
pub status: I2cStatus,
|
pub status: I2cStatus,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue