Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/type_c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl Current {
}

/// The current state of a Type-C port.
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum ConnectionState {
/// The port is connected to an USB Type-C Digital Audio (TCDA) accessory.
Expand Down
2 changes: 1 addition & 1 deletion src/ucsi/lpm/get_connector_capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ impl<Context> Decode<Context> for ResponseData {
}

/// GET_CONNECTOR_CAPABILITY command arguments
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct Args;

Expand Down
4 changes: 2 additions & 2 deletions src/ucsi/lpm/get_connector_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ impl From<u8> for ProviderCapsLimitedReason {

bitfield! {
/// Raw response data bitfield
#[derive(Copy, Clone, Default)]
#[derive(Copy, Clone, Default, PartialEq, Eq)]
pub struct ResponseDataRaw([u8]);
impl Debug;

Expand Down Expand Up @@ -741,7 +741,7 @@ impl<Context> Decode<Context> for ResponseData {
}
}
/// GET_CONNECTOR_STATUS command arguments
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct Args;

Expand Down
2 changes: 1 addition & 1 deletion src/ucsi/lpm/get_error_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub const COMMAND_PADDING: usize = COMMAND_LEN - size_of::<CommandHeaderRaw>() -
/// Maximum support vendor-data length
pub const MAX_VENDOR_DATA_LEN: usize = 14;

#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct Args;

Expand Down
6 changes: 3 additions & 3 deletions src/ucsi/lpm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ pub type GlobalCommand = Command<GlobalPortId>;
pub type LocalCommand = Command<LocalPortId>;

/// LPM response data
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum ResponseData {
ConnectorReset,
Expand Down Expand Up @@ -404,7 +404,7 @@ impl Decode<CommandType> for ResponseData {
}

/// LPM command response
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct Response<T: PortId> {
/// CCI is produced by every command
Expand All @@ -418,7 +418,7 @@ pub type LocalResponse = Response<LocalPortId>;

bitfield! {
/// Raw connector number
#[derive(Copy, Clone, Default)]
#[derive(Copy, Clone, Default, PartialEq, Eq)]
pub(self) struct ConnectorNumberRaw(u8);
impl Debug;

Expand Down
8 changes: 4 additions & 4 deletions src/ucsi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl<Context, T: PortId> Decode<Context> for Command<T> {
}

/// UCSI command response data
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum ResponseData {
Ppm(ppm::ResponseData),
Expand All @@ -210,7 +210,7 @@ impl Encode for ResponseData {
}

/// UCSI command response
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct Response<T: PortId> {
/// CCI is produced by every command
Expand Down Expand Up @@ -248,7 +248,7 @@ pub type LocalResponse = Response<LocalPortId>;

bitfield! {
/// Common header shared by all UCSI commands
#[derive(Copy, Clone)]
#[derive(Copy, Clone, PartialEq, Eq)]
pub(self) struct CommandHeaderRaw(u16);
impl Debug;

Expand All @@ -271,7 +271,7 @@ impl defmt::Format for CommandHeaderRaw {
}

/// Higher-level wrapper around [`CommandHeaderRaw`]
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct CommandHeader(CommandHeaderRaw);

Expand Down
2 changes: 1 addition & 1 deletion src/ucsi/ppm/cancel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use bincode::error::{DecodeError, EncodeError};
use crate::ucsi::{CommandHeaderRaw, COMMAND_LEN};

/// PPM CANCEL command args
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct Args;

Expand Down
6 changes: 3 additions & 3 deletions src/ucsi/ppm/get_capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub const RESPONSE_DATA_LEN: usize = 16;
pub const COMMAND_PADDING: usize = COMMAND_LEN - size_of::<CommandHeaderRaw>();

/// GetCapability command
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct Args;

Expand Down Expand Up @@ -218,7 +218,7 @@ impl<Context> Decode<Context> for OptionalFeatures {

bitfield! {
/// Raw power source data for GetCapability command
#[derive(Copy, Clone)]
#[derive(Copy, Clone, PartialEq, Eq)]
struct PowerSourceRaw(u8);
impl Debug;

Expand All @@ -245,7 +245,7 @@ impl defmt::Format for PowerSourceRaw {
}

/// Higher-level wrapper around [`PowerSourceRaw`]
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct PowerSource(PowerSourceRaw);

Expand Down
4 changes: 2 additions & 2 deletions src/ucsi/ppm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl Decode<()> for Command {
}

/// PPM command response data
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum ResponseData {
GetCapability(get_capability::ResponseData),
Expand Down Expand Up @@ -123,7 +123,7 @@ impl Decode<CommandType> for ResponseData {
}

/// PPM command response
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct Response<T: PortId> {
/// CCI is produced by every command
Expand Down
2 changes: 1 addition & 1 deletion src/ucsi/ppm/ppm_reset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use bincode::error::{DecodeError, EncodeError};
use crate::ucsi::{CommandHeaderRaw, COMMAND_LEN};

/// PPM Reset command structure
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct Args;

Expand Down
Loading