#[doc = r"Value read from the register"]
pub struct R {
bits: u32,
}
#[doc = r"Value to write to the register"]
pub struct W {
bits: u32,
}
impl super::CR {
#[doc = r"Modifies the contents of the register"]
#[inline(always)]
pub fn modify<F>(&self, f: F)
where
for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
{
let bits = self.register.get();
self.register.set(f(&R { bits }, &mut W { bits }).bits);
}
#[doc = r"Reads the contents of the register"]
#[inline(always)]
pub fn read(&self) -> R {
R {
bits: self.register.get(),
}
}
#[doc = r"Writes to the register"]
#[inline(always)]
pub fn write<F>(&self, f: F)
where
F: FnOnce(&mut W) -> &mut W,
{
self.register.set(
f(&mut W {
bits: Self::reset_value(),
})
.bits,
);
}
#[doc = r"Reset value of the register"]
#[inline(always)]
pub const fn reset_value() -> u32 {
0
}
#[doc = r"Writes the reset value to the register"]
#[inline(always)]
pub fn reset(&self) {
self.register.set(Self::reset_value())
}
}
#[doc = "Possible values of the field `EN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ENR {
#[doc = "Channel disabled"]
DISABLED,
#[doc = "Channel enabled"]
ENABLED,
}
impl ENR {
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
ENR::DISABLED => false,
ENR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> ENR {
match value {
false => ENR::DISABLED,
true => ENR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ENR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ENR::ENABLED
}
}
#[doc = "Values that can be written to the field `EN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ENW {
#[doc = "Channel disabled"]
DISABLED,
#[doc = "Channel enabled"]
ENABLED,
}
impl ENW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
ENW::DISABLED => false,
ENW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _ENW<'a> {
w: &'a mut W,
}
impl<'a> _ENW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: ENW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Channel disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(ENW::DISABLED)
}
#[doc = "Channel enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(ENW::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(0x01 << 0);
self.w.bits |= ((value as u32) & 0x01) << 0;
self.w
}
}
#[doc = "Possible values of the field `TCIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TCIER {
#[doc = "Transfer Complete interrupt disabled"]
DISABLED,
#[doc = "Transfer Complete interrupt enabled"]
ENABLED,
}
impl TCIER {
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
TCIER::DISABLED => false,
TCIER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> TCIER {
match value {
false => TCIER::DISABLED,
true => TCIER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TCIER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TCIER::ENABLED
}
}
#[doc = "Values that can be written to the field `TCIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TCIEW {
#[doc = "Transfer Complete interrupt disabled"]
DISABLED,
#[doc = "Transfer Complete interrupt enabled"]
ENABLED,
}
impl TCIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
TCIEW::DISABLED => false,
TCIEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _TCIEW<'a> {
w: &'a mut W,
}
impl<'a> _TCIEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: TCIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Transfer Complete interrupt disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(TCIEW::DISABLED)
}
#[doc = "Transfer Complete interrupt enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(TCIEW::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(0x01 << 1);
self.w.bits |= ((value as u32) & 0x01) << 1;
self.w
}
}
#[doc = "Possible values of the field `HTIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum HTIER {
#[doc = "Half Transfer interrupt disabled"]
DISABLED,
#[doc = "Half Transfer interrupt enabled"]
ENABLED,
}
impl HTIER {
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
HTIER::DISABLED => false,
HTIER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> HTIER {
match value {
false => HTIER::DISABLED,
true => HTIER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == HTIER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == HTIER::ENABLED
}
}
#[doc = "Values that can be written to the field `HTIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum HTIEW {
#[doc = "Half Transfer interrupt disabled"]
DISABLED,
#[doc = "Half Transfer interrupt enabled"]
ENABLED,
}
impl HTIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
HTIEW::DISABLED => false,
HTIEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _HTIEW<'a> {
w: &'a mut W,
}
impl<'a> _HTIEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: HTIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Half Transfer interrupt disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(HTIEW::DISABLED)
}
#[doc = "Half Transfer interrupt enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(HTIEW::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(0x01 << 2);
self.w.bits |= ((value as u32) & 0x01) << 2;
self.w
}
}
#[doc = "Possible values of the field `TEIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TEIER {
#[doc = "Transfer Error interrupt disabled"]
DISABLED,
#[doc = "Transfer Error interrupt enabled"]
ENABLED,
}
impl TEIER {
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
TEIER::DISABLED => false,
TEIER::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> TEIER {
match value {
false => TEIER::DISABLED,
true => TEIER::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TEIER::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TEIER::ENABLED
}
}
#[doc = "Values that can be written to the field `TEIE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TEIEW {
#[doc = "Transfer Error interrupt disabled"]
DISABLED,
#[doc = "Transfer Error interrupt enabled"]
ENABLED,
}
impl TEIEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
TEIEW::DISABLED => false,
TEIEW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _TEIEW<'a> {
w: &'a mut W,
}
impl<'a> _TEIEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: TEIEW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Transfer Error interrupt disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(TEIEW::DISABLED)
}
#[doc = "Transfer Error interrupt enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(TEIEW::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(0x01 << 3);
self.w.bits |= ((value as u32) & 0x01) << 3;
self.w
}
}
#[doc = "Possible values of the field `DIR`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DIRR {
#[doc = "Read from peripheral"]
FROMPERIPHERAL,
#[doc = "Read from memory"]
FROMMEMORY,
}
impl DIRR {
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
DIRR::FROMPERIPHERAL => false,
DIRR::FROMMEMORY => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> DIRR {
match value {
false => DIRR::FROMPERIPHERAL,
true => DIRR::FROMMEMORY,
}
}
#[doc = "Checks if the value of the field is `FROMPERIPHERAL`"]
#[inline(always)]
pub fn is_from_peripheral(&self) -> bool {
*self == DIRR::FROMPERIPHERAL
}
#[doc = "Checks if the value of the field is `FROMMEMORY`"]
#[inline(always)]
pub fn is_from_memory(&self) -> bool {
*self == DIRR::FROMMEMORY
}
}
#[doc = "Values that can be written to the field `DIR`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DIRW {
#[doc = "Read from peripheral"]
FROMPERIPHERAL,
#[doc = "Read from memory"]
FROMMEMORY,
}
impl DIRW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
DIRW::FROMPERIPHERAL => false,
DIRW::FROMMEMORY => true,
}
}
}
#[doc = r"Proxy"]
pub struct _DIRW<'a> {
w: &'a mut W,
}
impl<'a> _DIRW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: DIRW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Read from peripheral"]
#[inline(always)]
pub fn from_peripheral(self) -> &'a mut W {
self.variant(DIRW::FROMPERIPHERAL)
}
#[doc = "Read from memory"]
#[inline(always)]
pub fn from_memory(self) -> &'a mut W {
self.variant(DIRW::FROMMEMORY)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(0x01 << 4);
self.w.bits |= ((value as u32) & 0x01) << 4;
self.w
}
}
#[doc = "Possible values of the field `CIRC`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CIRCR {
#[doc = "Circular buffer disabled"]
DISABLED,
#[doc = "Circular buffer enabled"]
ENABLED,
}
impl CIRCR {
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
CIRCR::DISABLED => false,
CIRCR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> CIRCR {
match value {
false => CIRCR::DISABLED,
true => CIRCR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CIRCR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CIRCR::ENABLED
}
}
#[doc = "Values that can be written to the field `CIRC`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CIRCW {
#[doc = "Circular buffer disabled"]
DISABLED,
#[doc = "Circular buffer enabled"]
ENABLED,
}
impl CIRCW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
CIRCW::DISABLED => false,
CIRCW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _CIRCW<'a> {
w: &'a mut W,
}
impl<'a> _CIRCW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CIRCW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Circular buffer disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(CIRCW::DISABLED)
}
#[doc = "Circular buffer enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(CIRCW::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(0x01 << 5);
self.w.bits |= ((value as u32) & 0x01) << 5;
self.w
}
}
#[doc = "Possible values of the field `PINC`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PINCR {
#[doc = "Increment mode disabled"]
DISABLED,
#[doc = "Increment mode enabled"]
ENABLED,
}
impl PINCR {
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
PINCR::DISABLED => false,
PINCR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> PINCR {
match value {
false => PINCR::DISABLED,
true => PINCR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == PINCR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == PINCR::ENABLED
}
}
#[doc = "Values that can be written to the field `PINC`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PINCW {
#[doc = "Increment mode disabled"]
DISABLED,
#[doc = "Increment mode enabled"]
ENABLED,
}
impl PINCW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
PINCW::DISABLED => false,
PINCW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _PINCW<'a> {
w: &'a mut W,
}
impl<'a> _PINCW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: PINCW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Increment mode disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(PINCW::DISABLED)
}
#[doc = "Increment mode enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(PINCW::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(0x01 << 6);
self.w.bits |= ((value as u32) & 0x01) << 6;
self.w
}
}
#[doc = "Possible values of the field `MINC`"]
pub type MINCR = PINCR;
#[doc = "Values that can be written to the field `MINC`"]
pub type MINCW = PINCW;
#[doc = r"Proxy"]
pub struct _MINCW<'a> {
w: &'a mut W,
}
impl<'a> _MINCW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: MINCW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Increment mode disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(PINCW::DISABLED)
}
#[doc = "Increment mode enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(PINCW::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(0x01 << 7);
self.w.bits |= ((value as u32) & 0x01) << 7;
self.w
}
}
#[doc = "Possible values of the field `PSIZE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PSIZER {
#[doc = "8-bit size"]
BITS8,
#[doc = "16-bit size"]
BITS16,
#[doc = "32-bit size"]
BITS32,
#[doc = r"Reserved"]
_Reserved(u8),
}
impl PSIZER {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u8 {
match *self {
PSIZER::BITS8 => 0,
PSIZER::BITS16 => 0x01,
PSIZER::BITS32 => 0x02,
PSIZER::_Reserved(bits) => bits,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: u8) -> PSIZER {
match value {
0 => PSIZER::BITS8,
1 => PSIZER::BITS16,
2 => PSIZER::BITS32,
i => PSIZER::_Reserved(i),
}
}
#[doc = "Checks if the value of the field is `BITS8`"]
#[inline(always)]
pub fn is_bits8(&self) -> bool {
*self == PSIZER::BITS8
}
#[doc = "Checks if the value of the field is `BITS16`"]
#[inline(always)]
pub fn is_bits16(&self) -> bool {
*self == PSIZER::BITS16
}
#[doc = "Checks if the value of the field is `BITS32`"]
#[inline(always)]
pub fn is_bits32(&self) -> bool {
*self == PSIZER::BITS32
}
}
#[doc = "Values that can be written to the field `PSIZE`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PSIZEW {
#[doc = "8-bit size"]
BITS8,
#[doc = "16-bit size"]
BITS16,
#[doc = "32-bit size"]
BITS32,
}
impl PSIZEW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> u8 {
match *self {
PSIZEW::BITS8 => 0,
PSIZEW::BITS16 => 1,
PSIZEW::BITS32 => 2,
}
}
}
#[doc = r"Proxy"]
pub struct _PSIZEW<'a> {
w: &'a mut W,
}
impl<'a> _PSIZEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: PSIZEW) -> &'a mut W {
unsafe { self.bits(variant._bits()) }
}
#[doc = "8-bit size"]
#[inline(always)]
pub fn bits8(self) -> &'a mut W {
self.variant(PSIZEW::BITS8)
}
#[doc = "16-bit size"]
#[inline(always)]
pub fn bits16(self) -> &'a mut W {
self.variant(PSIZEW::BITS16)
}
#[doc = "32-bit size"]
#[inline(always)]
pub fn bits32(self) -> &'a mut W {
self.variant(PSIZEW::BITS32)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits &= !(0x03 << 8);
self.w.bits |= ((value as u32) & 0x03) << 8;
self.w
}
}
#[doc = "Possible values of the field `MSIZE`"]
pub type MSIZER = PSIZER;
#[doc = "Values that can be written to the field `MSIZE`"]
pub type MSIZEW = PSIZEW;
#[doc = r"Proxy"]
pub struct _MSIZEW<'a> {
w: &'a mut W,
}
impl<'a> _MSIZEW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: MSIZEW) -> &'a mut W {
unsafe { self.bits(variant._bits()) }
}
#[doc = "8-bit size"]
#[inline(always)]
pub fn bits8(self) -> &'a mut W {
self.variant(PSIZEW::BITS8)
}
#[doc = "16-bit size"]
#[inline(always)]
pub fn bits16(self) -> &'a mut W {
self.variant(PSIZEW::BITS16)
}
#[doc = "32-bit size"]
#[inline(always)]
pub fn bits32(self) -> &'a mut W {
self.variant(PSIZEW::BITS32)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits &= !(0x03 << 10);
self.w.bits |= ((value as u32) & 0x03) << 10;
self.w
}
}
#[doc = "Possible values of the field `PL`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PLR {
#[doc = "Low priority"]
LOW,
#[doc = "Medium priority"]
MEDIUM,
#[doc = "High priority"]
HIGH,
#[doc = "Very high priority"]
VERYHIGH,
}
impl PLR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u8 {
match *self {
PLR::LOW => 0,
PLR::MEDIUM => 0x01,
PLR::HIGH => 0x02,
PLR::VERYHIGH => 0x03,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: u8) -> PLR {
match value {
0 => PLR::LOW,
1 => PLR::MEDIUM,
2 => PLR::HIGH,
3 => PLR::VERYHIGH,
_ => unreachable!(),
}
}
#[doc = "Checks if the value of the field is `LOW`"]
#[inline(always)]
pub fn is_low(&self) -> bool {
*self == PLR::LOW
}
#[doc = "Checks if the value of the field is `MEDIUM`"]
#[inline(always)]
pub fn is_medium(&self) -> bool {
*self == PLR::MEDIUM
}
#[doc = "Checks if the value of the field is `HIGH`"]
#[inline(always)]
pub fn is_high(&self) -> bool {
*self == PLR::HIGH
}
#[doc = "Checks if the value of the field is `VERYHIGH`"]
#[inline(always)]
pub fn is_very_high(&self) -> bool {
*self == PLR::VERYHIGH
}
}
#[doc = "Values that can be written to the field `PL`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PLW {
#[doc = "Low priority"]
LOW,
#[doc = "Medium priority"]
MEDIUM,
#[doc = "High priority"]
HIGH,
#[doc = "Very high priority"]
VERYHIGH,
}
impl PLW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> u8 {
match *self {
PLW::LOW => 0,
PLW::MEDIUM => 1,
PLW::HIGH => 2,
PLW::VERYHIGH => 3,
}
}
}
#[doc = r"Proxy"]
pub struct _PLW<'a> {
w: &'a mut W,
}
impl<'a> _PLW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: PLW) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "Low priority"]
#[inline(always)]
pub fn low(self) -> &'a mut W {
self.variant(PLW::LOW)
}
#[doc = "Medium priority"]
#[inline(always)]
pub fn medium(self) -> &'a mut W {
self.variant(PLW::MEDIUM)
}
#[doc = "High priority"]
#[inline(always)]
pub fn high(self) -> &'a mut W {
self.variant(PLW::HIGH)
}
#[doc = "Very high priority"]
#[inline(always)]
pub fn very_high(self) -> &'a mut W {
self.variant(PLW::VERYHIGH)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bits(self, value: u8) -> &'a mut W {
self.w.bits &= !(0x03 << 12);
self.w.bits |= ((value as u32) & 0x03) << 12;
self.w
}
}
#[doc = "Possible values of the field `MEM2MEM`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum MEM2MEMR {
#[doc = "Memory to memory mode disabled"]
DISABLED,
#[doc = "Memory to memory mode enabled"]
ENABLED,
}
impl MEM2MEMR {
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
match *self {
MEM2MEMR::DISABLED => false,
MEM2MEMR::ENABLED => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: bool) -> MEM2MEMR {
match value {
false => MEM2MEMR::DISABLED,
true => MEM2MEMR::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == MEM2MEMR::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == MEM2MEMR::ENABLED
}
}
#[doc = "Values that can be written to the field `MEM2MEM`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum MEM2MEMW {
#[doc = "Memory to memory mode disabled"]
DISABLED,
#[doc = "Memory to memory mode enabled"]
ENABLED,
}
impl MEM2MEMW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> bool {
match *self {
MEM2MEMW::DISABLED => false,
MEM2MEMW::ENABLED => true,
}
}
}
#[doc = r"Proxy"]
pub struct _MEM2MEMW<'a> {
w: &'a mut W,
}
impl<'a> _MEM2MEMW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: MEM2MEMW) -> &'a mut W {
{
self.bit(variant._bits())
}
}
#[doc = "Memory to memory mode disabled"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(MEM2MEMW::DISABLED)
}
#[doc = "Memory to memory mode enabled"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(MEM2MEMW::ENABLED)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(0x01 << 14);
self.w.bits |= ((value as u32) & 0x01) << 14;
self.w
}
}
impl R {
#[doc = r"Value of the register as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u32 {
self.bits
}
#[doc = "Bit 0 - Channel enable"]
#[inline(always)]
pub fn en(&self) -> ENR {
ENR::_from(((self.bits >> 0) & 0x01) != 0)
}
#[doc = "Bit 1 - Transfer complete interrupt enable"]
#[inline(always)]
pub fn tcie(&self) -> TCIER {
TCIER::_from(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 2 - Half Transfer interrupt enable"]
#[inline(always)]
pub fn htie(&self) -> HTIER {
HTIER::_from(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 3 - Transfer error interrupt enable"]
#[inline(always)]
pub fn teie(&self) -> TEIER {
TEIER::_from(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bit 4 - Data transfer direction"]
#[inline(always)]
pub fn dir(&self) -> DIRR {
DIRR::_from(((self.bits >> 4) & 0x01) != 0)
}
#[doc = "Bit 5 - Circular mode"]
#[inline(always)]
pub fn circ(&self) -> CIRCR {
CIRCR::_from(((self.bits >> 5) & 0x01) != 0)
}
#[doc = "Bit 6 - Peripheral increment mode"]
#[inline(always)]
pub fn pinc(&self) -> PINCR {
PINCR::_from(((self.bits >> 6) & 0x01) != 0)
}
#[doc = "Bit 7 - Memory increment mode"]
#[inline(always)]
pub fn minc(&self) -> MINCR {
MINCR::_from(((self.bits >> 7) & 0x01) != 0)
}
#[doc = "Bits 8:9 - Peripheral size"]
#[inline(always)]
pub fn psize(&self) -> PSIZER {
PSIZER::_from(((self.bits >> 8) & 0x03) as u8)
}
#[doc = "Bits 10:11 - Memory size"]
#[inline(always)]
pub fn msize(&self) -> MSIZER {
MSIZER::_from(((self.bits >> 10) & 0x03) as u8)
}
#[doc = "Bits 12:13 - Channel Priority level"]
#[inline(always)]
pub fn pl(&self) -> PLR {
PLR::_from(((self.bits >> 12) & 0x03) as u8)
}
#[doc = "Bit 14 - Memory to memory mode"]
#[inline(always)]
pub fn mem2mem(&self) -> MEM2MEMR {
MEM2MEMR::_from(((self.bits >> 14) & 0x01) != 0)
}
}
impl W {
#[doc = r"Writes raw bits to the register"]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.bits = bits;
self
}
#[doc = "Bit 0 - Channel enable"]
#[inline(always)]
pub fn en(&mut self) -> _ENW {
_ENW { w: self }
}
#[doc = "Bit 1 - Transfer complete interrupt enable"]
#[inline(always)]
pub fn tcie(&mut self) -> _TCIEW {
_TCIEW { w: self }
}
#[doc = "Bit 2 - Half Transfer interrupt enable"]
#[inline(always)]
pub fn htie(&mut self) -> _HTIEW {
_HTIEW { w: self }
}
#[doc = "Bit 3 - Transfer error interrupt enable"]
#[inline(always)]
pub fn teie(&mut self) -> _TEIEW {
_TEIEW { w: self }
}
#[doc = "Bit 4 - Data transfer direction"]
#[inline(always)]
pub fn dir(&mut self) -> _DIRW {
_DIRW { w: self }
}
#[doc = "Bit 5 - Circular mode"]
#[inline(always)]
pub fn circ(&mut self) -> _CIRCW {
_CIRCW { w: self }
}
#[doc = "Bit 6 - Peripheral increment mode"]
#[inline(always)]
pub fn pinc(&mut self) -> _PINCW {
_PINCW { w: self }
}
#[doc = "Bit 7 - Memory increment mode"]
#[inline(always)]
pub fn minc(&mut self) -> _MINCW {
_MINCW { w: self }
}
#[doc = "Bits 8:9 - Peripheral size"]
#[inline(always)]
pub fn psize(&mut self) -> _PSIZEW {
_PSIZEW { w: self }
}
#[doc = "Bits 10:11 - Memory size"]
#[inline(always)]
pub fn msize(&mut self) -> _MSIZEW {
_MSIZEW { w: self }
}
#[doc = "Bits 12:13 - Channel Priority level"]
#[inline(always)]
pub fn pl(&mut self) -> _PLW {
_PLW { w: self }
}
#[doc = "Bit 14 - Memory to memory mode"]
#[inline(always)]
pub fn mem2mem(&mut self) -> _MEM2MEMW {
_MEM2MEMW { w: self }
}
}