sdmmc_core/register/ext_csd/tcase_support/
support.rs

1use crate::lib_enum;
2use crate::result::{Error, Result};
3
4lib_enum! {
5    /// Represents the `TCASE_SUPPORT` field of the [ExtCsd](super::ExtCsd) register.
6    TcaseSupport: u8 {
7        default: None,
8        error: Error,
9        /// Case temperature control support is not configured/supported.
10        None = 0x00,
11        /// Case temperature control is supported. Heat relief only through the case.
12        CaseOnly = 0x01,
13        /// Case temperature control is supported. Heat relief through the case and PCB/balls.
14        CasePcb = 0x10,
15    }
16}
17
18impl TcaseSupport {
19    /// Attempts to convert an inner representation into a [TcaseSupport].
20    pub const fn try_from_inner(val: u8) -> Result<Self> {
21        Self::from_raw(val)
22    }
23
24    /// Converts a [TcaseSupport] into an inner representation.
25    pub const fn into_inner(self) -> u8 {
26        self.into_raw()
27    }
28}