1052 lines
28 KiB
Rust
1052 lines
28 KiB
Rust
#[doc = r" Value read from the register"]
|
|
pub struct R {
|
|
bits: u16,
|
|
}
|
|
#[doc = r" Value to write to the register"]
|
|
pub struct W {
|
|
bits: u16,
|
|
}
|
|
impl super::AESACTL0 {
|
|
#[doc = r" Modifies the contents of the register"]
|
|
#[inline]
|
|
pub fn modify<F>(&self, f: F)
|
|
where
|
|
for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
|
|
{
|
|
let bits = self.register.get();
|
|
let r = R { bits: bits };
|
|
let mut w = W { bits: bits };
|
|
f(&r, &mut w);
|
|
self.register.set(w.bits);
|
|
}
|
|
#[doc = r" Reads the contents of the register"]
|
|
#[inline]
|
|
pub fn read(&self) -> R {
|
|
R {
|
|
bits: self.register.get(),
|
|
}
|
|
}
|
|
#[doc = r" Writes to the register"]
|
|
#[inline]
|
|
pub fn write<F>(&self, f: F)
|
|
where
|
|
F: FnOnce(&mut W) -> &mut W,
|
|
{
|
|
let mut w = W::reset_value();
|
|
f(&mut w);
|
|
self.register.set(w.bits);
|
|
}
|
|
#[doc = r" Writes the reset value to the register"]
|
|
#[inline]
|
|
pub fn reset(&self) {
|
|
self.write(|w| w)
|
|
}
|
|
}
|
|
#[doc = "Possible values of the field `AESOPx`"]
|
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
pub enum AESOPXR {
|
|
#[doc = "Encryption"]
|
|
AESOPX_0,
|
|
#[doc = "Decryption. The provided key is the same key used for encryption"]
|
|
AESOPX_1,
|
|
#[doc = "Generate first round key required for decryption"]
|
|
AESOPX_2,
|
|
#[doc = "Decryption. The provided key is the first round key required for decryption"]
|
|
AESOPX_3,
|
|
}
|
|
impl AESOPXR {
|
|
#[doc = r" Value of the field as raw bits"]
|
|
#[inline]
|
|
pub fn bits(&self) -> u8 {
|
|
match *self {
|
|
AESOPXR::AESOPX_0 => 0,
|
|
AESOPXR::AESOPX_1 => 1,
|
|
AESOPXR::AESOPX_2 => 2,
|
|
AESOPXR::AESOPX_3 => 3,
|
|
}
|
|
}
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _from(value: u8) -> AESOPXR {
|
|
match value {
|
|
0 => AESOPXR::AESOPX_0,
|
|
1 => AESOPXR::AESOPX_1,
|
|
2 => AESOPXR::AESOPX_2,
|
|
3 => AESOPXR::AESOPX_3,
|
|
_ => unreachable!(),
|
|
}
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESOPX_0`"]
|
|
#[inline]
|
|
pub fn is_aesopx_0(&self) -> bool {
|
|
*self == AESOPXR::AESOPX_0
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESOPX_1`"]
|
|
#[inline]
|
|
pub fn is_aesopx_1(&self) -> bool {
|
|
*self == AESOPXR::AESOPX_1
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESOPX_2`"]
|
|
#[inline]
|
|
pub fn is_aesopx_2(&self) -> bool {
|
|
*self == AESOPXR::AESOPX_2
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESOPX_3`"]
|
|
#[inline]
|
|
pub fn is_aesopx_3(&self) -> bool {
|
|
*self == AESOPXR::AESOPX_3
|
|
}
|
|
}
|
|
#[doc = "Possible values of the field `AESKLx`"]
|
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
pub enum AESKLXR {
|
|
#[doc = "AES128. The key size is 128 bit"]
|
|
AESKLX_0,
|
|
#[doc = "AES192. The key size is 192 bit."]
|
|
AESKLX_1,
|
|
#[doc = "AES256. The key size is 256 bit"]
|
|
AESKLX_2,
|
|
#[doc = r" Reserved"]
|
|
_Reserved(u8),
|
|
}
|
|
impl AESKLXR {
|
|
#[doc = r" Value of the field as raw bits"]
|
|
#[inline]
|
|
pub fn bits(&self) -> u8 {
|
|
match *self {
|
|
AESKLXR::AESKLX_0 => 0,
|
|
AESKLXR::AESKLX_1 => 1,
|
|
AESKLXR::AESKLX_2 => 2,
|
|
AESKLXR::_Reserved(bits) => bits,
|
|
}
|
|
}
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _from(value: u8) -> AESKLXR {
|
|
match value {
|
|
0 => AESKLXR::AESKLX_0,
|
|
1 => AESKLXR::AESKLX_1,
|
|
2 => AESKLXR::AESKLX_2,
|
|
i => AESKLXR::_Reserved(i),
|
|
}
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESKLX_0`"]
|
|
#[inline]
|
|
pub fn is_aesklx_0(&self) -> bool {
|
|
*self == AESKLXR::AESKLX_0
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESKLX_1`"]
|
|
#[inline]
|
|
pub fn is_aesklx_1(&self) -> bool {
|
|
*self == AESKLXR::AESKLX_1
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESKLX_2`"]
|
|
#[inline]
|
|
pub fn is_aesklx_2(&self) -> bool {
|
|
*self == AESKLXR::AESKLX_2
|
|
}
|
|
}
|
|
#[doc = "Possible values of the field `AESCMx`"]
|
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
pub enum AESCMXR {
|
|
#[doc = "ECB"]
|
|
AESCMX_0,
|
|
#[doc = "CBC"]
|
|
AESCMX_1,
|
|
#[doc = "OFB"]
|
|
AESCMX_2,
|
|
#[doc = "CFB"]
|
|
AESCMX_3,
|
|
}
|
|
impl AESCMXR {
|
|
#[doc = r" Value of the field as raw bits"]
|
|
#[inline]
|
|
pub fn bits(&self) -> u8 {
|
|
match *self {
|
|
AESCMXR::AESCMX_0 => 0,
|
|
AESCMXR::AESCMX_1 => 1,
|
|
AESCMXR::AESCMX_2 => 2,
|
|
AESCMXR::AESCMX_3 => 3,
|
|
}
|
|
}
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _from(value: u8) -> AESCMXR {
|
|
match value {
|
|
0 => AESCMXR::AESCMX_0,
|
|
1 => AESCMXR::AESCMX_1,
|
|
2 => AESCMXR::AESCMX_2,
|
|
3 => AESCMXR::AESCMX_3,
|
|
_ => unreachable!(),
|
|
}
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESCMX_0`"]
|
|
#[inline]
|
|
pub fn is_aescmx_0(&self) -> bool {
|
|
*self == AESCMXR::AESCMX_0
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESCMX_1`"]
|
|
#[inline]
|
|
pub fn is_aescmx_1(&self) -> bool {
|
|
*self == AESCMXR::AESCMX_1
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESCMX_2`"]
|
|
#[inline]
|
|
pub fn is_aescmx_2(&self) -> bool {
|
|
*self == AESCMXR::AESCMX_2
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESCMX_3`"]
|
|
#[inline]
|
|
pub fn is_aescmx_3(&self) -> bool {
|
|
*self == AESCMXR::AESCMX_3
|
|
}
|
|
}
|
|
#[doc = "Possible values of the field `AESSWRST`"]
|
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
pub enum AESSWRSTR {
|
|
#[doc = "No reset"]
|
|
AESSWRST_0,
|
|
#[doc = "Reset AES accelerator module"]
|
|
AESSWRST_1,
|
|
}
|
|
impl AESSWRSTR {
|
|
#[doc = r" Returns `true` if the bit is clear (0)"]
|
|
#[inline]
|
|
pub fn bit_is_clear(&self) -> bool {
|
|
!self.bit()
|
|
}
|
|
#[doc = r" Returns `true` if the bit is set (1)"]
|
|
#[inline]
|
|
pub fn bit_is_set(&self) -> bool {
|
|
self.bit()
|
|
}
|
|
#[doc = r" Value of the field as raw bits"]
|
|
#[inline]
|
|
pub fn bit(&self) -> bool {
|
|
match *self {
|
|
AESSWRSTR::AESSWRST_0 => false,
|
|
AESSWRSTR::AESSWRST_1 => true,
|
|
}
|
|
}
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _from(value: bool) -> AESSWRSTR {
|
|
match value {
|
|
false => AESSWRSTR::AESSWRST_0,
|
|
true => AESSWRSTR::AESSWRST_1,
|
|
}
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESSWRST_0`"]
|
|
#[inline]
|
|
pub fn is_aesswrst_0(&self) -> bool {
|
|
*self == AESSWRSTR::AESSWRST_0
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESSWRST_1`"]
|
|
#[inline]
|
|
pub fn is_aesswrst_1(&self) -> bool {
|
|
*self == AESSWRSTR::AESSWRST_1
|
|
}
|
|
}
|
|
#[doc = "Possible values of the field `AESRDYIFG`"]
|
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
pub enum AESRDYIFGR {
|
|
#[doc = "No interrupt pending"]
|
|
AESRDYIFG_0,
|
|
#[doc = "Interrupt pending"]
|
|
AESRDYIFG_1,
|
|
}
|
|
impl AESRDYIFGR {
|
|
#[doc = r" Returns `true` if the bit is clear (0)"]
|
|
#[inline]
|
|
pub fn bit_is_clear(&self) -> bool {
|
|
!self.bit()
|
|
}
|
|
#[doc = r" Returns `true` if the bit is set (1)"]
|
|
#[inline]
|
|
pub fn bit_is_set(&self) -> bool {
|
|
self.bit()
|
|
}
|
|
#[doc = r" Value of the field as raw bits"]
|
|
#[inline]
|
|
pub fn bit(&self) -> bool {
|
|
match *self {
|
|
AESRDYIFGR::AESRDYIFG_0 => false,
|
|
AESRDYIFGR::AESRDYIFG_1 => true,
|
|
}
|
|
}
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _from(value: bool) -> AESRDYIFGR {
|
|
match value {
|
|
false => AESRDYIFGR::AESRDYIFG_0,
|
|
true => AESRDYIFGR::AESRDYIFG_1,
|
|
}
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESRDYIFG_0`"]
|
|
#[inline]
|
|
pub fn is_aesrdyifg_0(&self) -> bool {
|
|
*self == AESRDYIFGR::AESRDYIFG_0
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESRDYIFG_1`"]
|
|
#[inline]
|
|
pub fn is_aesrdyifg_1(&self) -> bool {
|
|
*self == AESRDYIFGR::AESRDYIFG_1
|
|
}
|
|
}
|
|
#[doc = "Possible values of the field `AESERRFG`"]
|
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
pub enum AESERRFGR {
|
|
#[doc = "No error"]
|
|
AESERRFG_0,
|
|
#[doc = "Error occurred"]
|
|
AESERRFG_1,
|
|
}
|
|
impl AESERRFGR {
|
|
#[doc = r" Returns `true` if the bit is clear (0)"]
|
|
#[inline]
|
|
pub fn bit_is_clear(&self) -> bool {
|
|
!self.bit()
|
|
}
|
|
#[doc = r" Returns `true` if the bit is set (1)"]
|
|
#[inline]
|
|
pub fn bit_is_set(&self) -> bool {
|
|
self.bit()
|
|
}
|
|
#[doc = r" Value of the field as raw bits"]
|
|
#[inline]
|
|
pub fn bit(&self) -> bool {
|
|
match *self {
|
|
AESERRFGR::AESERRFG_0 => false,
|
|
AESERRFGR::AESERRFG_1 => true,
|
|
}
|
|
}
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _from(value: bool) -> AESERRFGR {
|
|
match value {
|
|
false => AESERRFGR::AESERRFG_0,
|
|
true => AESERRFGR::AESERRFG_1,
|
|
}
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESERRFG_0`"]
|
|
#[inline]
|
|
pub fn is_aeserrfg_0(&self) -> bool {
|
|
*self == AESERRFGR::AESERRFG_0
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESERRFG_1`"]
|
|
#[inline]
|
|
pub fn is_aeserrfg_1(&self) -> bool {
|
|
*self == AESERRFGR::AESERRFG_1
|
|
}
|
|
}
|
|
#[doc = "Possible values of the field `AESRDYIE`"]
|
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
pub enum AESRDYIER {
|
|
#[doc = "Interrupt disabled"]
|
|
AESRDYIE_0,
|
|
#[doc = "Interrupt enabled"]
|
|
AESRDYIE_1,
|
|
}
|
|
impl AESRDYIER {
|
|
#[doc = r" Returns `true` if the bit is clear (0)"]
|
|
#[inline]
|
|
pub fn bit_is_clear(&self) -> bool {
|
|
!self.bit()
|
|
}
|
|
#[doc = r" Returns `true` if the bit is set (1)"]
|
|
#[inline]
|
|
pub fn bit_is_set(&self) -> bool {
|
|
self.bit()
|
|
}
|
|
#[doc = r" Value of the field as raw bits"]
|
|
#[inline]
|
|
pub fn bit(&self) -> bool {
|
|
match *self {
|
|
AESRDYIER::AESRDYIE_0 => false,
|
|
AESRDYIER::AESRDYIE_1 => true,
|
|
}
|
|
}
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _from(value: bool) -> AESRDYIER {
|
|
match value {
|
|
false => AESRDYIER::AESRDYIE_0,
|
|
true => AESRDYIER::AESRDYIE_1,
|
|
}
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESRDYIE_0`"]
|
|
#[inline]
|
|
pub fn is_aesrdyie_0(&self) -> bool {
|
|
*self == AESRDYIER::AESRDYIE_0
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESRDYIE_1`"]
|
|
#[inline]
|
|
pub fn is_aesrdyie_1(&self) -> bool {
|
|
*self == AESRDYIER::AESRDYIE_1
|
|
}
|
|
}
|
|
#[doc = "Possible values of the field `AESCMEN`"]
|
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
pub enum AESCMENR {
|
|
#[doc = "No DMA triggers are generated"]
|
|
AESCMEN_0,
|
|
#[doc = "DMA ciphermode support operation is enabled and the corresponding DMA triggers are generated"]
|
|
AESCMEN_1,
|
|
}
|
|
impl AESCMENR {
|
|
#[doc = r" Returns `true` if the bit is clear (0)"]
|
|
#[inline]
|
|
pub fn bit_is_clear(&self) -> bool {
|
|
!self.bit()
|
|
}
|
|
#[doc = r" Returns `true` if the bit is set (1)"]
|
|
#[inline]
|
|
pub fn bit_is_set(&self) -> bool {
|
|
self.bit()
|
|
}
|
|
#[doc = r" Value of the field as raw bits"]
|
|
#[inline]
|
|
pub fn bit(&self) -> bool {
|
|
match *self {
|
|
AESCMENR::AESCMEN_0 => false,
|
|
AESCMENR::AESCMEN_1 => true,
|
|
}
|
|
}
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _from(value: bool) -> AESCMENR {
|
|
match value {
|
|
false => AESCMENR::AESCMEN_0,
|
|
true => AESCMENR::AESCMEN_1,
|
|
}
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESCMEN_0`"]
|
|
#[inline]
|
|
pub fn is_aescmen_0(&self) -> bool {
|
|
*self == AESCMENR::AESCMEN_0
|
|
}
|
|
#[doc = "Checks if the value of the field is `AESCMEN_1`"]
|
|
#[inline]
|
|
pub fn is_aescmen_1(&self) -> bool {
|
|
*self == AESCMENR::AESCMEN_1
|
|
}
|
|
}
|
|
#[doc = "Values that can be written to the field `AESOPx`"]
|
|
pub enum AESOPXW {
|
|
#[doc = "Encryption"]
|
|
AESOPX_0,
|
|
#[doc = "Decryption. The provided key is the same key used for encryption"]
|
|
AESOPX_1,
|
|
#[doc = "Generate first round key required for decryption"]
|
|
AESOPX_2,
|
|
#[doc = "Decryption. The provided key is the first round key required for decryption"]
|
|
AESOPX_3,
|
|
}
|
|
impl AESOPXW {
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _bits(&self) -> u8 {
|
|
match *self {
|
|
AESOPXW::AESOPX_0 => 0,
|
|
AESOPXW::AESOPX_1 => 1,
|
|
AESOPXW::AESOPX_2 => 2,
|
|
AESOPXW::AESOPX_3 => 3,
|
|
}
|
|
}
|
|
}
|
|
#[doc = r" Proxy"]
|
|
pub struct _AESOPXW<'a> {
|
|
w: &'a mut W,
|
|
}
|
|
impl<'a> _AESOPXW<'a> {
|
|
#[doc = r" Writes `variant` to the field"]
|
|
#[inline]
|
|
pub fn variant(self, variant: AESOPXW) -> &'a mut W {
|
|
{
|
|
self.bits(variant._bits())
|
|
}
|
|
}
|
|
#[doc = "Encryption"]
|
|
#[inline]
|
|
pub fn aesopx_0(self) -> &'a mut W {
|
|
self.variant(AESOPXW::AESOPX_0)
|
|
}
|
|
#[doc = "Decryption. The provided key is the same key used for encryption"]
|
|
#[inline]
|
|
pub fn aesopx_1(self) -> &'a mut W {
|
|
self.variant(AESOPXW::AESOPX_1)
|
|
}
|
|
#[doc = "Generate first round key required for decryption"]
|
|
#[inline]
|
|
pub fn aesopx_2(self) -> &'a mut W {
|
|
self.variant(AESOPXW::AESOPX_2)
|
|
}
|
|
#[doc = "Decryption. The provided key is the first round key required for decryption"]
|
|
#[inline]
|
|
pub fn aesopx_3(self) -> &'a mut W {
|
|
self.variant(AESOPXW::AESOPX_3)
|
|
}
|
|
#[doc = r" Writes raw bits to the field"]
|
|
#[inline]
|
|
pub fn bits(self, value: u8) -> &'a mut W {
|
|
const MASK: u8 = 3;
|
|
const OFFSET: u8 = 0;
|
|
self.w.bits &= !((MASK as u16) << OFFSET);
|
|
self.w.bits |= ((value & MASK) as u16) << OFFSET;
|
|
self.w
|
|
}
|
|
}
|
|
#[doc = "Values that can be written to the field `AESKLx`"]
|
|
pub enum AESKLXW {
|
|
#[doc = "AES128. The key size is 128 bit"]
|
|
AESKLX_0,
|
|
#[doc = "AES192. The key size is 192 bit."]
|
|
AESKLX_1,
|
|
#[doc = "AES256. The key size is 256 bit"]
|
|
AESKLX_2,
|
|
}
|
|
impl AESKLXW {
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _bits(&self) -> u8 {
|
|
match *self {
|
|
AESKLXW::AESKLX_0 => 0,
|
|
AESKLXW::AESKLX_1 => 1,
|
|
AESKLXW::AESKLX_2 => 2,
|
|
}
|
|
}
|
|
}
|
|
#[doc = r" Proxy"]
|
|
pub struct _AESKLXW<'a> {
|
|
w: &'a mut W,
|
|
}
|
|
impl<'a> _AESKLXW<'a> {
|
|
#[doc = r" Writes `variant` to the field"]
|
|
#[inline]
|
|
pub fn variant(self, variant: AESKLXW) -> &'a mut W {
|
|
unsafe { self.bits(variant._bits()) }
|
|
}
|
|
#[doc = "AES128. The key size is 128 bit"]
|
|
#[inline]
|
|
pub fn aesklx_0(self) -> &'a mut W {
|
|
self.variant(AESKLXW::AESKLX_0)
|
|
}
|
|
#[doc = "AES192. The key size is 192 bit."]
|
|
#[inline]
|
|
pub fn aesklx_1(self) -> &'a mut W {
|
|
self.variant(AESKLXW::AESKLX_1)
|
|
}
|
|
#[doc = "AES256. The key size is 256 bit"]
|
|
#[inline]
|
|
pub fn aesklx_2(self) -> &'a mut W {
|
|
self.variant(AESKLXW::AESKLX_2)
|
|
}
|
|
#[doc = r" Writes raw bits to the field"]
|
|
#[inline]
|
|
pub unsafe fn bits(self, value: u8) -> &'a mut W {
|
|
const MASK: u8 = 3;
|
|
const OFFSET: u8 = 2;
|
|
self.w.bits &= !((MASK as u16) << OFFSET);
|
|
self.w.bits |= ((value & MASK) as u16) << OFFSET;
|
|
self.w
|
|
}
|
|
}
|
|
#[doc = "Values that can be written to the field `AESCMx`"]
|
|
pub enum AESCMXW {
|
|
#[doc = "ECB"]
|
|
AESCMX_0,
|
|
#[doc = "CBC"]
|
|
AESCMX_1,
|
|
#[doc = "OFB"]
|
|
AESCMX_2,
|
|
#[doc = "CFB"]
|
|
AESCMX_3,
|
|
}
|
|
impl AESCMXW {
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _bits(&self) -> u8 {
|
|
match *self {
|
|
AESCMXW::AESCMX_0 => 0,
|
|
AESCMXW::AESCMX_1 => 1,
|
|
AESCMXW::AESCMX_2 => 2,
|
|
AESCMXW::AESCMX_3 => 3,
|
|
}
|
|
}
|
|
}
|
|
#[doc = r" Proxy"]
|
|
pub struct _AESCMXW<'a> {
|
|
w: &'a mut W,
|
|
}
|
|
impl<'a> _AESCMXW<'a> {
|
|
#[doc = r" Writes `variant` to the field"]
|
|
#[inline]
|
|
pub fn variant(self, variant: AESCMXW) -> &'a mut W {
|
|
{
|
|
self.bits(variant._bits())
|
|
}
|
|
}
|
|
#[doc = "ECB"]
|
|
#[inline]
|
|
pub fn aescmx_0(self) -> &'a mut W {
|
|
self.variant(AESCMXW::AESCMX_0)
|
|
}
|
|
#[doc = "CBC"]
|
|
#[inline]
|
|
pub fn aescmx_1(self) -> &'a mut W {
|
|
self.variant(AESCMXW::AESCMX_1)
|
|
}
|
|
#[doc = "OFB"]
|
|
#[inline]
|
|
pub fn aescmx_2(self) -> &'a mut W {
|
|
self.variant(AESCMXW::AESCMX_2)
|
|
}
|
|
#[doc = "CFB"]
|
|
#[inline]
|
|
pub fn aescmx_3(self) -> &'a mut W {
|
|
self.variant(AESCMXW::AESCMX_3)
|
|
}
|
|
#[doc = r" Writes raw bits to the field"]
|
|
#[inline]
|
|
pub fn bits(self, value: u8) -> &'a mut W {
|
|
const MASK: u8 = 3;
|
|
const OFFSET: u8 = 5;
|
|
self.w.bits &= !((MASK as u16) << OFFSET);
|
|
self.w.bits |= ((value & MASK) as u16) << OFFSET;
|
|
self.w
|
|
}
|
|
}
|
|
#[doc = "Values that can be written to the field `AESSWRST`"]
|
|
pub enum AESSWRSTW {
|
|
#[doc = "No reset"]
|
|
AESSWRST_0,
|
|
#[doc = "Reset AES accelerator module"]
|
|
AESSWRST_1,
|
|
}
|
|
impl AESSWRSTW {
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _bits(&self) -> bool {
|
|
match *self {
|
|
AESSWRSTW::AESSWRST_0 => false,
|
|
AESSWRSTW::AESSWRST_1 => true,
|
|
}
|
|
}
|
|
}
|
|
#[doc = r" Proxy"]
|
|
pub struct _AESSWRSTW<'a> {
|
|
w: &'a mut W,
|
|
}
|
|
impl<'a> _AESSWRSTW<'a> {
|
|
#[doc = r" Writes `variant` to the field"]
|
|
#[inline]
|
|
pub fn variant(self, variant: AESSWRSTW) -> &'a mut W {
|
|
{
|
|
self.bit(variant._bits())
|
|
}
|
|
}
|
|
#[doc = "No reset"]
|
|
#[inline]
|
|
pub fn aesswrst_0(self) -> &'a mut W {
|
|
self.variant(AESSWRSTW::AESSWRST_0)
|
|
}
|
|
#[doc = "Reset AES accelerator module"]
|
|
#[inline]
|
|
pub fn aesswrst_1(self) -> &'a mut W {
|
|
self.variant(AESSWRSTW::AESSWRST_1)
|
|
}
|
|
#[doc = r" Sets the field bit"]
|
|
pub fn set_bit(self) -> &'a mut W {
|
|
self.bit(true)
|
|
}
|
|
#[doc = r" Clears the field bit"]
|
|
pub fn clear_bit(self) -> &'a mut W {
|
|
self.bit(false)
|
|
}
|
|
#[doc = r" Writes raw bits to the field"]
|
|
#[inline]
|
|
pub fn bit(self, value: bool) -> &'a mut W {
|
|
const MASK: bool = true;
|
|
const OFFSET: u8 = 7;
|
|
self.w.bits &= !((MASK as u16) << OFFSET);
|
|
self.w.bits |= ((value & MASK) as u16) << OFFSET;
|
|
self.w
|
|
}
|
|
}
|
|
#[doc = "Values that can be written to the field `AESRDYIFG`"]
|
|
pub enum AESRDYIFGW {
|
|
#[doc = "No interrupt pending"]
|
|
AESRDYIFG_0,
|
|
#[doc = "Interrupt pending"]
|
|
AESRDYIFG_1,
|
|
}
|
|
impl AESRDYIFGW {
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _bits(&self) -> bool {
|
|
match *self {
|
|
AESRDYIFGW::AESRDYIFG_0 => false,
|
|
AESRDYIFGW::AESRDYIFG_1 => true,
|
|
}
|
|
}
|
|
}
|
|
#[doc = r" Proxy"]
|
|
pub struct _AESRDYIFGW<'a> {
|
|
w: &'a mut W,
|
|
}
|
|
impl<'a> _AESRDYIFGW<'a> {
|
|
#[doc = r" Writes `variant` to the field"]
|
|
#[inline]
|
|
pub fn variant(self, variant: AESRDYIFGW) -> &'a mut W {
|
|
{
|
|
self.bit(variant._bits())
|
|
}
|
|
}
|
|
#[doc = "No interrupt pending"]
|
|
#[inline]
|
|
pub fn aesrdyifg_0(self) -> &'a mut W {
|
|
self.variant(AESRDYIFGW::AESRDYIFG_0)
|
|
}
|
|
#[doc = "Interrupt pending"]
|
|
#[inline]
|
|
pub fn aesrdyifg_1(self) -> &'a mut W {
|
|
self.variant(AESRDYIFGW::AESRDYIFG_1)
|
|
}
|
|
#[doc = r" Sets the field bit"]
|
|
pub fn set_bit(self) -> &'a mut W {
|
|
self.bit(true)
|
|
}
|
|
#[doc = r" Clears the field bit"]
|
|
pub fn clear_bit(self) -> &'a mut W {
|
|
self.bit(false)
|
|
}
|
|
#[doc = r" Writes raw bits to the field"]
|
|
#[inline]
|
|
pub fn bit(self, value: bool) -> &'a mut W {
|
|
const MASK: bool = true;
|
|
const OFFSET: u8 = 8;
|
|
self.w.bits &= !((MASK as u16) << OFFSET);
|
|
self.w.bits |= ((value & MASK) as u16) << OFFSET;
|
|
self.w
|
|
}
|
|
}
|
|
#[doc = "Values that can be written to the field `AESERRFG`"]
|
|
pub enum AESERRFGW {
|
|
#[doc = "No error"]
|
|
AESERRFG_0,
|
|
#[doc = "Error occurred"]
|
|
AESERRFG_1,
|
|
}
|
|
impl AESERRFGW {
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _bits(&self) -> bool {
|
|
match *self {
|
|
AESERRFGW::AESERRFG_0 => false,
|
|
AESERRFGW::AESERRFG_1 => true,
|
|
}
|
|
}
|
|
}
|
|
#[doc = r" Proxy"]
|
|
pub struct _AESERRFGW<'a> {
|
|
w: &'a mut W,
|
|
}
|
|
impl<'a> _AESERRFGW<'a> {
|
|
#[doc = r" Writes `variant` to the field"]
|
|
#[inline]
|
|
pub fn variant(self, variant: AESERRFGW) -> &'a mut W {
|
|
{
|
|
self.bit(variant._bits())
|
|
}
|
|
}
|
|
#[doc = "No error"]
|
|
#[inline]
|
|
pub fn aeserrfg_0(self) -> &'a mut W {
|
|
self.variant(AESERRFGW::AESERRFG_0)
|
|
}
|
|
#[doc = "Error occurred"]
|
|
#[inline]
|
|
pub fn aeserrfg_1(self) -> &'a mut W {
|
|
self.variant(AESERRFGW::AESERRFG_1)
|
|
}
|
|
#[doc = r" Sets the field bit"]
|
|
pub fn set_bit(self) -> &'a mut W {
|
|
self.bit(true)
|
|
}
|
|
#[doc = r" Clears the field bit"]
|
|
pub fn clear_bit(self) -> &'a mut W {
|
|
self.bit(false)
|
|
}
|
|
#[doc = r" Writes raw bits to the field"]
|
|
#[inline]
|
|
pub fn bit(self, value: bool) -> &'a mut W {
|
|
const MASK: bool = true;
|
|
const OFFSET: u8 = 11;
|
|
self.w.bits &= !((MASK as u16) << OFFSET);
|
|
self.w.bits |= ((value & MASK) as u16) << OFFSET;
|
|
self.w
|
|
}
|
|
}
|
|
#[doc = "Values that can be written to the field `AESRDYIE`"]
|
|
pub enum AESRDYIEW {
|
|
#[doc = "Interrupt disabled"]
|
|
AESRDYIE_0,
|
|
#[doc = "Interrupt enabled"]
|
|
AESRDYIE_1,
|
|
}
|
|
impl AESRDYIEW {
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _bits(&self) -> bool {
|
|
match *self {
|
|
AESRDYIEW::AESRDYIE_0 => false,
|
|
AESRDYIEW::AESRDYIE_1 => true,
|
|
}
|
|
}
|
|
}
|
|
#[doc = r" Proxy"]
|
|
pub struct _AESRDYIEW<'a> {
|
|
w: &'a mut W,
|
|
}
|
|
impl<'a> _AESRDYIEW<'a> {
|
|
#[doc = r" Writes `variant` to the field"]
|
|
#[inline]
|
|
pub fn variant(self, variant: AESRDYIEW) -> &'a mut W {
|
|
{
|
|
self.bit(variant._bits())
|
|
}
|
|
}
|
|
#[doc = "Interrupt disabled"]
|
|
#[inline]
|
|
pub fn aesrdyie_0(self) -> &'a mut W {
|
|
self.variant(AESRDYIEW::AESRDYIE_0)
|
|
}
|
|
#[doc = "Interrupt enabled"]
|
|
#[inline]
|
|
pub fn aesrdyie_1(self) -> &'a mut W {
|
|
self.variant(AESRDYIEW::AESRDYIE_1)
|
|
}
|
|
#[doc = r" Sets the field bit"]
|
|
pub fn set_bit(self) -> &'a mut W {
|
|
self.bit(true)
|
|
}
|
|
#[doc = r" Clears the field bit"]
|
|
pub fn clear_bit(self) -> &'a mut W {
|
|
self.bit(false)
|
|
}
|
|
#[doc = r" Writes raw bits to the field"]
|
|
#[inline]
|
|
pub fn bit(self, value: bool) -> &'a mut W {
|
|
const MASK: bool = true;
|
|
const OFFSET: u8 = 12;
|
|
self.w.bits &= !((MASK as u16) << OFFSET);
|
|
self.w.bits |= ((value & MASK) as u16) << OFFSET;
|
|
self.w
|
|
}
|
|
}
|
|
#[doc = "Values that can be written to the field `AESCMEN`"]
|
|
pub enum AESCMENW {
|
|
#[doc = "No DMA triggers are generated"]
|
|
AESCMEN_0,
|
|
#[doc = "DMA ciphermode support operation is enabled and the corresponding DMA triggers are generated"]
|
|
AESCMEN_1,
|
|
}
|
|
impl AESCMENW {
|
|
#[allow(missing_docs)]
|
|
#[doc(hidden)]
|
|
#[inline]
|
|
pub fn _bits(&self) -> bool {
|
|
match *self {
|
|
AESCMENW::AESCMEN_0 => false,
|
|
AESCMENW::AESCMEN_1 => true,
|
|
}
|
|
}
|
|
}
|
|
#[doc = r" Proxy"]
|
|
pub struct _AESCMENW<'a> {
|
|
w: &'a mut W,
|
|
}
|
|
impl<'a> _AESCMENW<'a> {
|
|
#[doc = r" Writes `variant` to the field"]
|
|
#[inline]
|
|
pub fn variant(self, variant: AESCMENW) -> &'a mut W {
|
|
{
|
|
self.bit(variant._bits())
|
|
}
|
|
}
|
|
#[doc = "No DMA triggers are generated"]
|
|
#[inline]
|
|
pub fn aescmen_0(self) -> &'a mut W {
|
|
self.variant(AESCMENW::AESCMEN_0)
|
|
}
|
|
#[doc = "DMA ciphermode support operation is enabled and the corresponding DMA triggers are generated"]
|
|
#[inline]
|
|
pub fn aescmen_1(self) -> &'a mut W {
|
|
self.variant(AESCMENW::AESCMEN_1)
|
|
}
|
|
#[doc = r" Sets the field bit"]
|
|
pub fn set_bit(self) -> &'a mut W {
|
|
self.bit(true)
|
|
}
|
|
#[doc = r" Clears the field bit"]
|
|
pub fn clear_bit(self) -> &'a mut W {
|
|
self.bit(false)
|
|
}
|
|
#[doc = r" Writes raw bits to the field"]
|
|
#[inline]
|
|
pub fn bit(self, value: bool) -> &'a mut W {
|
|
const MASK: bool = true;
|
|
const OFFSET: u8 = 15;
|
|
self.w.bits &= !((MASK as u16) << OFFSET);
|
|
self.w.bits |= ((value & MASK) as u16) << OFFSET;
|
|
self.w
|
|
}
|
|
}
|
|
impl R {
|
|
#[doc = r" Value of the register as raw bits"]
|
|
#[inline]
|
|
pub fn bits(&self) -> u16 {
|
|
self.bits
|
|
}
|
|
#[doc = "Bits 0:1 - AES operation"]
|
|
#[inline]
|
|
pub fn aesopx(&self) -> AESOPXR {
|
|
AESOPXR::_from({
|
|
const MASK: u8 = 3;
|
|
const OFFSET: u8 = 0;
|
|
((self.bits >> OFFSET) & MASK as u16) as u8
|
|
})
|
|
}
|
|
#[doc = "Bits 2:3 - AES key length"]
|
|
#[inline]
|
|
pub fn aesklx(&self) -> AESKLXR {
|
|
AESKLXR::_from({
|
|
const MASK: u8 = 3;
|
|
const OFFSET: u8 = 2;
|
|
((self.bits >> OFFSET) & MASK as u16) as u8
|
|
})
|
|
}
|
|
#[doc = "Bits 5:6 - AES cipher mode select"]
|
|
#[inline]
|
|
pub fn aescmx(&self) -> AESCMXR {
|
|
AESCMXR::_from({
|
|
const MASK: u8 = 3;
|
|
const OFFSET: u8 = 5;
|
|
((self.bits >> OFFSET) & MASK as u16) as u8
|
|
})
|
|
}
|
|
#[doc = "Bit 7 - AES software reset"]
|
|
#[inline]
|
|
pub fn aesswrst(&self) -> AESSWRSTR {
|
|
AESSWRSTR::_from({
|
|
const MASK: bool = true;
|
|
const OFFSET: u8 = 7;
|
|
((self.bits >> OFFSET) & MASK as u16) != 0
|
|
})
|
|
}
|
|
#[doc = "Bit 8 - AES ready interrupt flag"]
|
|
#[inline]
|
|
pub fn aesrdyifg(&self) -> AESRDYIFGR {
|
|
AESRDYIFGR::_from({
|
|
const MASK: bool = true;
|
|
const OFFSET: u8 = 8;
|
|
((self.bits >> OFFSET) & MASK as u16) != 0
|
|
})
|
|
}
|
|
#[doc = "Bit 11 - AES error flag"]
|
|
#[inline]
|
|
pub fn aeserrfg(&self) -> AESERRFGR {
|
|
AESERRFGR::_from({
|
|
const MASK: bool = true;
|
|
const OFFSET: u8 = 11;
|
|
((self.bits >> OFFSET) & MASK as u16) != 0
|
|
})
|
|
}
|
|
#[doc = "Bit 12 - AES ready interrupt enable"]
|
|
#[inline]
|
|
pub fn aesrdyie(&self) -> AESRDYIER {
|
|
AESRDYIER::_from({
|
|
const MASK: bool = true;
|
|
const OFFSET: u8 = 12;
|
|
((self.bits >> OFFSET) & MASK as u16) != 0
|
|
})
|
|
}
|
|
#[doc = "Bit 15 - AES cipher mode enable"]
|
|
#[inline]
|
|
pub fn aescmen(&self) -> AESCMENR {
|
|
AESCMENR::_from({
|
|
const MASK: bool = true;
|
|
const OFFSET: u8 = 15;
|
|
((self.bits >> OFFSET) & MASK as u16) != 0
|
|
})
|
|
}
|
|
}
|
|
impl W {
|
|
#[doc = r" Reset value of the register"]
|
|
#[inline]
|
|
pub fn reset_value() -> W {
|
|
W { bits: 0 }
|
|
}
|
|
#[doc = r" Writes raw bits to the register"]
|
|
#[inline]
|
|
pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
|
|
self.bits = bits;
|
|
self
|
|
}
|
|
#[doc = "Bits 0:1 - AES operation"]
|
|
#[inline]
|
|
pub fn aesopx(&mut self) -> _AESOPXW {
|
|
_AESOPXW { w: self }
|
|
}
|
|
#[doc = "Bits 2:3 - AES key length"]
|
|
#[inline]
|
|
pub fn aesklx(&mut self) -> _AESKLXW {
|
|
_AESKLXW { w: self }
|
|
}
|
|
#[doc = "Bits 5:6 - AES cipher mode select"]
|
|
#[inline]
|
|
pub fn aescmx(&mut self) -> _AESCMXW {
|
|
_AESCMXW { w: self }
|
|
}
|
|
#[doc = "Bit 7 - AES software reset"]
|
|
#[inline]
|
|
pub fn aesswrst(&mut self) -> _AESSWRSTW {
|
|
_AESSWRSTW { w: self }
|
|
}
|
|
#[doc = "Bit 8 - AES ready interrupt flag"]
|
|
#[inline]
|
|
pub fn aesrdyifg(&mut self) -> _AESRDYIFGW {
|
|
_AESRDYIFGW { w: self }
|
|
}
|
|
#[doc = "Bit 11 - AES error flag"]
|
|
#[inline]
|
|
pub fn aeserrfg(&mut self) -> _AESERRFGW {
|
|
_AESERRFGW { w: self }
|
|
}
|
|
#[doc = "Bit 12 - AES ready interrupt enable"]
|
|
#[inline]
|
|
pub fn aesrdyie(&mut self) -> _AESRDYIEW {
|
|
_AESRDYIEW { w: self }
|
|
}
|
|
#[doc = "Bit 15 - AES cipher mode enable"]
|
|
#[inline]
|
|
pub fn aescmen(&mut self) -> _AESCMENW {
|
|
_AESCMENW { w: self }
|
|
}
|
|
}
|