corstone300_pac/ethernet/
gpt_cnt.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 `GPT_CNT` reader"]
6pub struct R(crate::R<GPT_CNT_SPEC>);
7impl core::ops::Deref for R {
8    type Target = crate::R<GPT_CNT_SPEC>;
9    #[inline(always)]
10    fn deref(&self) -> &Self::Target {
11        &self.0
12    }
13}
14impl From<crate::R<GPT_CNT_SPEC>> for R {
15    #[inline(always)]
16    fn from(reader: crate::R<GPT_CNT_SPEC>) -> Self {
17        R(reader)
18    }
19}
20#[doc = "Field `CNT` reader - Counter"]
21pub type CNT_R = crate::FieldReader<u16, u16>;
22impl R {
23    #[doc = "Bits 0:15 - Counter"]
24    #[inline(always)]
25    pub fn cnt(&self) -> CNT_R {
26        CNT_R::new((self.bits & 0xffff) as u16)
27    }
28}
29#[doc = "General Purpose Timer Count\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 [gpt_cnt](index.html) module"]
30pub struct GPT_CNT_SPEC;
31impl crate::RegisterSpec for GPT_CNT_SPEC {
32    type Ux = u32;
33}
34#[doc = "`read()` method returns [gpt_cnt::R](R) reader structure"]
35impl crate::Readable for GPT_CNT_SPEC {
36    type Reader = R;
37}
38#[doc = "`reset()` method sets GPT_CNT to value 0xffff"]
39impl crate::Resettable for GPT_CNT_SPEC {
40    #[inline(always)]
41    fn reset_value() -> Self::Ux {
42        0xffff
43    }
44}