aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src/tsc/errors.rs
blob: 21f6441baf2500621a2419281dd0dff6346ce357 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/// Represents errors that can occur when configuring or validating TSC pin groups.
#[derive(Debug)]
pub enum GroupError {
    /// Error when a group has no sampling capacitor
    NoSamplingCapacitor,
    /// Error when a group has neither channel IOs nor a shield IO
    NoChannelOrShield,
    /// Error when a group has both channel IOs and a shield IO
    MixedChannelAndShield,
    /// Error when there is more than one shield IO across all groups
    MultipleShields,
}

/// Error returned when attempting to set an invalid channel pin as active in the TSC.
#[derive(Debug)]
pub enum AcquisitionBankError {
    /// Indicates that one or more of the provided pins is not a valid channel pin.
    InvalidChannelPin,
    /// Indicates that multiple channels from the same group were provided.
    MultipleChannelsPerGroup,
}