corstone300_pac/audio_i2s/
rxbuf.rs

1// Copyright 2022 Arm Limited and/or its affiliates <open-source-office@arm.com>
2//
3// SPDX-License-Identifier: MIT
4
5#[doc = "Register `RXBUF` reader"]
6pub struct R(crate::R<RXBUF_SPEC>);
7impl core::ops::Deref for R {
8    type Target = crate::R<RXBUF_SPEC>;
9    #[inline(always)]
10    fn deref(&self) -> &Self::Target {
11        &self.0
12    }
13}
14impl From<crate::R<RXBUF_SPEC>> for R {
15    #[inline(always)]
16    fn from(reader: crate::R<RXBUF_SPEC>) -> Self {
17        R(reader)
18    }
19}
20#[doc = "Field `RightChannel` reader - Right channel value"]
21pub type RIGHT_CHANNEL_R = crate::FieldReader<u16, u16>;
22#[doc = "Field `LeftChannel` reader - Left channel value"]
23pub type LEFT_CHANNEL_R = crate::FieldReader<u16, u16>;
24impl R {
25    #[doc = "Bits 0:15 - Right channel value"]
26    #[inline(always)]
27    pub fn right_channel(&self) -> RIGHT_CHANNEL_R {
28        RIGHT_CHANNEL_R::new((self.bits & 0xffff) as u16)
29    }
30    #[doc = "Bits 16:31 - Left channel value"]
31    #[inline(always)]
32    pub fn left_channel(&self) -> LEFT_CHANNEL_R {
33        LEFT_CHANNEL_R::new(((self.bits >> 16) & 0xffff) as u16)
34    }
35}
36#[doc = "Receive Buffer FIFO Data register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rxbuf](index.html) module"]
37pub struct RXBUF_SPEC;
38impl crate::RegisterSpec for RXBUF_SPEC {
39    type Ux = u32;
40}
41#[doc = "`read()` method returns [rxbuf::R](R) reader structure"]
42impl crate::Readable for RXBUF_SPEC {
43    type Reader = R;
44}
45#[doc = "`reset()` method sets RXBUF to value 0"]
46impl crate::Resettable for RXBUF_SPEC {
47    #[inline(always)]
48    fn reset_value() -> Self::Ux {
49        0
50    }
51}