mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Wed Jul 01 09:45:11 2015 +0100
Revision:
579:53297373a894
Parent:
514:7668256dbe61
Synchronized with git revision d5b4d2ab9c47edb4dc5776e7177b0c2263459081

Full URL: https://github.com/mbedmicro/mbed/commit/d5b4d2ab9c47edb4dc5776e7177b0c2263459081/

Initial version of drivers for SAMR21

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 514:7668256dbe61 1 /*******************************************************************************
mbed_official 514:7668256dbe61 2 * Copyright (C) 2015 Maxim Integrated Products, Inc., All Rights Reserved.
mbed_official 514:7668256dbe61 3 *
mbed_official 514:7668256dbe61 4 * Permission is hereby granted, free of charge, to any person obtaining a
mbed_official 514:7668256dbe61 5 * copy of this software and associated documentation files (the "Software"),
mbed_official 514:7668256dbe61 6 * to deal in the Software without restriction, including without limitation
mbed_official 514:7668256dbe61 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
mbed_official 514:7668256dbe61 8 * and/or sell copies of the Software, and to permit persons to whom the
mbed_official 514:7668256dbe61 9 * Software is furnished to do so, subject to the following conditions:
mbed_official 514:7668256dbe61 10 *
mbed_official 514:7668256dbe61 11 * The above copyright notice and this permission notice shall be included
mbed_official 514:7668256dbe61 12 * in all copies or substantial portions of the Software.
mbed_official 514:7668256dbe61 13 *
mbed_official 514:7668256dbe61 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
mbed_official 514:7668256dbe61 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
mbed_official 514:7668256dbe61 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
mbed_official 514:7668256dbe61 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
mbed_official 514:7668256dbe61 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
mbed_official 514:7668256dbe61 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
mbed_official 514:7668256dbe61 20 * OTHER DEALINGS IN THE SOFTWARE.
mbed_official 514:7668256dbe61 21 *
mbed_official 514:7668256dbe61 22 * Except as contained in this notice, the name of Maxim Integrated
mbed_official 514:7668256dbe61 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
mbed_official 514:7668256dbe61 24 * Products, Inc. Branding Policy.
mbed_official 514:7668256dbe61 25 *
mbed_official 514:7668256dbe61 26 * The mere transfer of this software does not imply any licenses
mbed_official 514:7668256dbe61 27 * of trade secrets, proprietary technology, copyrights, patents,
mbed_official 514:7668256dbe61 28 * trademarks, maskwork rights, or any other form of intellectual
mbed_official 514:7668256dbe61 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
mbed_official 514:7668256dbe61 30 * ownership rights.
mbed_official 514:7668256dbe61 31 *******************************************************************************
mbed_official 514:7668256dbe61 32 */
mbed_official 514:7668256dbe61 33
mbed_official 514:7668256dbe61 34 #ifndef _MXC_RTC_REGS_H
mbed_official 514:7668256dbe61 35 #define _MXC_RTC_REGS_H
mbed_official 514:7668256dbe61 36
mbed_official 514:7668256dbe61 37 #ifdef __cplusplus
mbed_official 514:7668256dbe61 38 extern "C" {
mbed_official 514:7668256dbe61 39 #endif
mbed_official 514:7668256dbe61 40
mbed_official 514:7668256dbe61 41 #include <stdint.h>
mbed_official 514:7668256dbe61 42
mbed_official 514:7668256dbe61 43 /**
mbed_official 514:7668256dbe61 44 * @file rtc_regs.h
mbed_official 514:7668256dbe61 45 * @addtogroup rtc RTCTMR
mbed_official 514:7668256dbe61 46 * @{
mbed_official 514:7668256dbe61 47 */
mbed_official 514:7668256dbe61 48
mbed_official 514:7668256dbe61 49 /**
mbed_official 514:7668256dbe61 50 * @brief Defines clock divider for 4096Hz input clock.
mbed_official 514:7668256dbe61 51 */
mbed_official 514:7668256dbe61 52 typedef enum {
mbed_official 514:7668256dbe61 53 /** (4kHz) divide input clock by 2^0 = 1 */
mbed_official 514:7668256dbe61 54 MXC_E_RTC_PRESCALE_DIV_2_0 = 0,
mbed_official 514:7668256dbe61 55 /** (2kHz) divide input clock by 2^1 = 2 */
mbed_official 514:7668256dbe61 56 MXC_E_RTC_PRESCALE_DIV_2_1,
mbed_official 514:7668256dbe61 57 /** (1kHz) divide input clock by 2^2 = 4 */
mbed_official 514:7668256dbe61 58 MXC_E_RTC_PRESCALE_DIV_2_2,
mbed_official 514:7668256dbe61 59 /** (512Hz) divide input clock by 2^3 = 8 */
mbed_official 514:7668256dbe61 60 MXC_E_RTC_PRESCALE_DIV_2_3,
mbed_official 514:7668256dbe61 61 /** (256Hz) divide input clock by 2^4 = 16 */
mbed_official 514:7668256dbe61 62 MXC_E_RTC_PRESCALE_DIV_2_4,
mbed_official 514:7668256dbe61 63 /** (128Hz) divide input clock by 2^5 = 32 */
mbed_official 514:7668256dbe61 64 MXC_E_RTC_PRESCALE_DIV_2_5,
mbed_official 514:7668256dbe61 65 /** (64Hz) divide input clock by 2^6 = 64 */
mbed_official 514:7668256dbe61 66 MXC_E_RTC_PRESCALE_DIV_2_6,
mbed_official 514:7668256dbe61 67 /** (32Hz) divide input clock by 2^7 = 128 */
mbed_official 514:7668256dbe61 68 MXC_E_RTC_PRESCALE_DIV_2_7,
mbed_official 514:7668256dbe61 69 /** (16Hz) divide input clock by 2^8 = 256 */
mbed_official 514:7668256dbe61 70 MXC_E_RTC_PRESCALE_DIV_2_8,
mbed_official 514:7668256dbe61 71 /** (8Hz) divide input clock by 2^9 = 512 */
mbed_official 514:7668256dbe61 72 MXC_E_RTC_PRESCALE_DIV_2_9,
mbed_official 514:7668256dbe61 73 /** (4Hz) divide input clock by 2^10 = 1024 */
mbed_official 514:7668256dbe61 74 MXC_E_RTC_PRESCALE_DIV_2_10,
mbed_official 514:7668256dbe61 75 /** (2Hz) divide input clock by 2^11 = 2048 */
mbed_official 514:7668256dbe61 76 MXC_E_RTC_PRESCALE_DIV_2_11,
mbed_official 514:7668256dbe61 77 /** (1Hz) divide input clock by 2^12 = 4096 */
mbed_official 514:7668256dbe61 78 MXC_E_RTC_PRESCALE_DIV_2_12,
mbed_official 514:7668256dbe61 79 } mxc_rtc_prescale_t;
mbed_official 514:7668256dbe61 80
mbed_official 514:7668256dbe61 81 /* Offset Register Description
mbed_official 514:7668256dbe61 82 ====== ========================================= */
mbed_official 514:7668256dbe61 83 typedef struct {
mbed_official 514:7668256dbe61 84 __IO uint32_t ctrl; /* 0x0000 RTC Timer Control */
mbed_official 514:7668256dbe61 85 __IO uint32_t timer; /* 0x0004 RTC Timer Count Value */
mbed_official 514:7668256dbe61 86 __IO uint32_t comp[2]; /* 0x0008 RTC Alarm (0..1) Compare Registers */
mbed_official 514:7668256dbe61 87 __IO uint32_t flags; /* 0x0010 CPU Interrupt and RTC Domain Flags */
mbed_official 514:7668256dbe61 88 __I uint32_t rsv0014; /* 0x0014 */
mbed_official 514:7668256dbe61 89 __IO uint32_t inten; /* 0x0018 Interrupt Enable Controls */
mbed_official 514:7668256dbe61 90 __IO uint32_t prescale; /* 0x001C RTC Timer Prescale Setting */
mbed_official 514:7668256dbe61 91 __I uint32_t rsv0020; /* 0x0020 */
mbed_official 514:7668256dbe61 92 __IO uint32_t prescale_mask; /* 0x0024 RTC Timer Prescale Compare Mask */
mbed_official 514:7668256dbe61 93 __IO uint32_t trim_ctrl; /* 0x0028 RTC Timer Trim Controls */
mbed_official 514:7668256dbe61 94 __IO uint32_t trim_value; /* 0x002C RTC Timer Trim Adjustment Interval */
mbed_official 514:7668256dbe61 95 } mxc_rtctmr_regs_t;
mbed_official 514:7668256dbe61 96
mbed_official 514:7668256dbe61 97 /*
mbed_official 514:7668256dbe61 98 Register offsets for module RTCTMR.
mbed_official 514:7668256dbe61 99 */
mbed_official 514:7668256dbe61 100 #define MXC_R_RTCTMR_OFFS_CTRL ((uint32_t)0x00000000UL)
mbed_official 514:7668256dbe61 101 #define MXC_R_RTCTMR_OFFS_TIMER ((uint32_t)0x00000004UL)
mbed_official 514:7668256dbe61 102 #define MXC_R_RTCTMR_OFFS_COMP_0 ((uint32_t)0x00000008UL)
mbed_official 514:7668256dbe61 103 #define MXC_R_RTCTMR_OFFS_COMP_1 ((uint32_t)0x0000000CUL)
mbed_official 514:7668256dbe61 104 #define MXC_R_RTCTMR_OFFS_FLAGS ((uint32_t)0x00000010UL)
mbed_official 514:7668256dbe61 105 #define MXC_R_RTCTMR_OFFS_INTEN ((uint32_t)0x00000018UL)
mbed_official 514:7668256dbe61 106 #define MXC_R_RTCTMR_OFFS_PRESCALE ((uint32_t)0x0000001CUL)
mbed_official 514:7668256dbe61 107 #define MXC_R_RTCTMR_OFFS_PRESCALE_MASK ((uint32_t)0x00000024UL)
mbed_official 514:7668256dbe61 108 #define MXC_R_RTCTMR_OFFS_TRIM_CTRL ((uint32_t)0x00000028UL)
mbed_official 514:7668256dbe61 109 #define MXC_R_RTCTMR_OFFS_TRIM_VALUE ((uint32_t)0x0000002CUL)
mbed_official 514:7668256dbe61 110
mbed_official 514:7668256dbe61 111 /*
mbed_official 514:7668256dbe61 112 Field positions and masks for module RTCTMR.
mbed_official 514:7668256dbe61 113 */
mbed_official 514:7668256dbe61 114 #define MXC_F_RTC_CTRL_ENABLE_POS 0
mbed_official 514:7668256dbe61 115 #define MXC_F_RTC_CTRL_ENABLE ((uint32_t)(0x00000001UL << MXC_F_RTC_CTRL_ENABLE_POS))
mbed_official 514:7668256dbe61 116 #define MXC_F_RTC_CTRL_CLEAR_POS 1
mbed_official 514:7668256dbe61 117 #define MXC_F_RTC_CTRL_CLEAR ((uint32_t)(0x00000001UL << MXC_F_RTC_CTRL_CLEAR_POS))
mbed_official 514:7668256dbe61 118 #define MXC_F_RTC_CTRL_PENDING_POS 2
mbed_official 514:7668256dbe61 119 #define MXC_F_RTC_CTRL_PENDING ((uint32_t)(0x00000001UL << MXC_F_RTC_CTRL_PENDING_POS))
mbed_official 514:7668256dbe61 120 #define MXC_F_RTC_CTRL_USE_ASYNC_FLAGS_POS 3
mbed_official 514:7668256dbe61 121 #define MXC_F_RTC_CTRL_USE_ASYNC_FLAGS ((uint32_t)(0x00000001UL << MXC_F_RTC_CTRL_USE_ASYNC_FLAGS_POS))
mbed_official 514:7668256dbe61 122 #define MXC_F_RTC_CTRL_AGGRESSIVE_RST_POS 4
mbed_official 514:7668256dbe61 123 #define MXC_F_RTC_CTRL_AGGRESSIVE_RST ((uint32_t)(0x00000001UL << MXC_F_RTC_CTRL_AGGRESSIVE_RST_POS))
mbed_official 514:7668256dbe61 124 #define MXC_F_RTC_CTRL_EN_ACTIVE_POS 16
mbed_official 514:7668256dbe61 125 #define MXC_F_RTC_CTRL_EN_ACTIVE ((uint32_t)(0x00000001UL << MXC_F_RTC_CTRL_EN_ACTIVE_POS))
mbed_official 514:7668256dbe61 126 #define MXC_F_RTC_CTRL_OSC_GOTO_LOW_ACTIVE_POS 17
mbed_official 514:7668256dbe61 127 #define MXC_F_RTC_CTRL_OSC_GOTO_LOW_ACTIVE ((uint32_t)(0x00000001UL << MXC_F_RTC_CTRL_OSC_GOTO_LOW_ACTIVE_POS))
mbed_official 514:7668256dbe61 128 #define MXC_F_RTC_CTRL_OSC_FRCE_SM_EN_ACTIVE_POS 18
mbed_official 514:7668256dbe61 129 #define MXC_F_RTC_CTRL_OSC_FRCE_SM_EN_ACTIVE ((uint32_t)(0x00000001UL << MXC_F_RTC_CTRL_OSC_FRCE_SM_EN_ACTIVE_POS))
mbed_official 514:7668256dbe61 130 #define MXC_F_RTC_CTRL_OSC_FRCE_ST_ACTIVE_POS 19
mbed_official 514:7668256dbe61 131 #define MXC_F_RTC_CTRL_OSC_FRCE_ST_ACTIVE ((uint32_t)(0x00000001UL << MXC_F_RTC_CTRL_OSC_FRCE_ST_ACTIVE_POS))
mbed_official 514:7668256dbe61 132 #define MXC_F_RTC_CTRL_SET_ACTIVE_POS 20
mbed_official 514:7668256dbe61 133 #define MXC_F_RTC_CTRL_SET_ACTIVE ((uint32_t)(0x00000001UL << MXC_F_RTC_CTRL_SET_ACTIVE_POS))
mbed_official 514:7668256dbe61 134 #define MXC_F_RTC_CTRL_CLR_ACTIVE_POS 21
mbed_official 514:7668256dbe61 135 #define MXC_F_RTC_CTRL_CLR_ACTIVE ((uint32_t)(0x00000001UL << MXC_F_RTC_CTRL_CLR_ACTIVE_POS))
mbed_official 514:7668256dbe61 136 #define MXC_F_RTC_CTRL_ROLLOVER_CLR_ACTIVE_POS 22
mbed_official 514:7668256dbe61 137 #define MXC_F_RTC_CTRL_ROLLOVER_CLR_ACTIVE ((uint32_t)(0x00000001UL << MXC_F_RTC_CTRL_ROLLOVER_CLR_ACTIVE_POS))
mbed_official 514:7668256dbe61 138 #define MXC_F_RTC_CTRL_PRESCALE_CMPR0_ACTIVE_POS 23
mbed_official 514:7668256dbe61 139 #define MXC_F_RTC_CTRL_PRESCALE_CMPR0_ACTIVE ((uint32_t)(0x00000001UL << MXC_F_RTC_CTRL_PRESCALE_CMPR0_ACTIVE_POS))
mbed_official 514:7668256dbe61 140 #define MXC_F_RTC_CTRL_PRESCALE_UPDATE_ACTIVE_POS 24
mbed_official 514:7668256dbe61 141 #define MXC_F_RTC_CTRL_PRESCALE_UPDATE_ACTIVE ((uint32_t)(0x00000001UL << MXC_F_RTC_CTRL_PRESCALE_UPDATE_ACTIVE_POS))
mbed_official 514:7668256dbe61 142 #define MXC_F_RTC_CTRL_CMPR1_CLR_ACTIVE_POS 25
mbed_official 514:7668256dbe61 143 #define MXC_F_RTC_CTRL_CMPR1_CLR_ACTIVE ((uint32_t)(0x00000001UL << MXC_F_RTC_CTRL_CMPR1_CLR_ACTIVE_POS))
mbed_official 514:7668256dbe61 144 #define MXC_F_RTC_CTRL_CMPR0_CLR_ACTIVE_POS 26
mbed_official 514:7668256dbe61 145 #define MXC_F_RTC_CTRL_CMPR0_CLR_ACTIVE ((uint32_t)(0x00000001UL << MXC_F_RTC_CTRL_CMPR0_CLR_ACTIVE_POS))
mbed_official 514:7668256dbe61 146
mbed_official 514:7668256dbe61 147 #define MXC_F_RTC_FLAGS_COMP0_POS 0
mbed_official 514:7668256dbe61 148 #define MXC_F_RTC_FLAGS_COMP0 ((uint32_t)(0x00000001UL << MXC_F_RTC_FLAGS_COMP0_POS))
mbed_official 514:7668256dbe61 149 #define MXC_F_RTC_FLAGS_COMP1_POS 1
mbed_official 514:7668256dbe61 150 #define MXC_F_RTC_FLAGS_COMP1 ((uint32_t)(0x00000001UL << MXC_F_RTC_FLAGS_COMP1_POS))
mbed_official 514:7668256dbe61 151 #define MXC_F_RTC_FLAGS_PRESCALE_COMP_POS 2
mbed_official 514:7668256dbe61 152 #define MXC_F_RTC_FLAGS_PRESCALE_COMP ((uint32_t)(0x00000001UL << MXC_F_RTC_FLAGS_PRESCALE_COMP_POS))
mbed_official 514:7668256dbe61 153 #define MXC_F_RTC_FLAGS_OVERFLOW_POS 3
mbed_official 514:7668256dbe61 154 #define MXC_F_RTC_FLAGS_OVERFLOW ((uint32_t)(0x00000001UL << MXC_F_RTC_FLAGS_OVERFLOW_POS))
mbed_official 514:7668256dbe61 155 #define MXC_F_RTC_FLAGS_TRIM_POS 4
mbed_official 514:7668256dbe61 156 #define MXC_F_RTC_FLAGS_TRIM ((uint32_t)(0x00000001UL << MXC_F_RTC_FLAGS_TRIM_POS))
mbed_official 514:7668256dbe61 157 #define MXC_F_RTC_FLAGS_COMP0_FLAG_A_POS 8
mbed_official 514:7668256dbe61 158 #define MXC_F_RTC_FLAGS_COMP0_FLAG_A ((uint32_t)(0x00000001UL << MXC_F_RTC_FLAGS_COMP0_FLAG_A_POS))
mbed_official 514:7668256dbe61 159 #define MXC_F_RTC_FLAGS_COMP1_FLAG_A_POS 9
mbed_official 514:7668256dbe61 160 #define MXC_F_RTC_FLAGS_COMP1_FLAG_A ((uint32_t)(0x00000001UL << MXC_F_RTC_FLAGS_COMP1_FLAG_A_POS))
mbed_official 514:7668256dbe61 161 #define MXC_F_RTC_FLAGS_PRESCL_FLAG_A_POS 10
mbed_official 514:7668256dbe61 162 #define MXC_F_RTC_FLAGS_PRESCL_FLAG_A ((uint32_t)(0x00000001UL << MXC_F_RTC_FLAGS_PRESCL_FLAG_A_POS))
mbed_official 514:7668256dbe61 163 #define MXC_F_RTC_FLAGS_OVERFLOW_FLAG_A_POS 11
mbed_official 514:7668256dbe61 164 #define MXC_F_RTC_FLAGS_OVERFLOW_FLAG_A ((uint32_t)(0x00000001UL << MXC_F_RTC_FLAGS_OVERFLOW_FLAG_A_POS))
mbed_official 514:7668256dbe61 165 #define MXC_F_RTC_FLAGS_TRIM_FLAG_A_POS 12
mbed_official 514:7668256dbe61 166 #define MXC_F_RTC_FLAGS_TRIM_FLAG_A ((uint32_t)(0x00000001UL << MXC_F_RTC_FLAGS_TRIM_FLAG_A_POS))
mbed_official 514:7668256dbe61 167 #define MXC_F_RTC_FLAGS_ASYNC_CLR_FLAGS_POS 31
mbed_official 514:7668256dbe61 168 #define MXC_F_RTC_FLAGS_ASYNC_CLR_FLAGS ((uint32_t)(0x00000001UL << MXC_F_RTC_FLAGS_ASYNC_CLR_FLAGS_POS))
mbed_official 514:7668256dbe61 169
mbed_official 514:7668256dbe61 170 #define MXC_F_RTC_INTEN_COMP0_POS 0
mbed_official 514:7668256dbe61 171 #define MXC_F_RTC_INTEN_COMP0 ((uint32_t)(0x00000001UL << MXC_F_RTC_INTEN_COMP0_POS))
mbed_official 514:7668256dbe61 172 #define MXC_F_RTC_INTEN_COMP1_POS 1
mbed_official 514:7668256dbe61 173 #define MXC_F_RTC_INTEN_COMP1 ((uint32_t)(0x00000001UL << MXC_F_RTC_INTEN_COMP1_POS))
mbed_official 514:7668256dbe61 174 #define MXC_F_RTC_INTEN_PRESCALE_COMP_POS 2
mbed_official 514:7668256dbe61 175 #define MXC_F_RTC_INTEN_PRESCALE_COMP ((uint32_t)(0x00000001UL << MXC_F_RTC_INTEN_PRESCALE_COMP_POS))
mbed_official 514:7668256dbe61 176 #define MXC_F_RTC_INTEN_OVERFLOW_POS 3
mbed_official 514:7668256dbe61 177 #define MXC_F_RTC_INTEN_OVERFLOW ((uint32_t)(0x00000001UL << MXC_F_RTC_INTEN_OVERFLOW_POS))
mbed_official 514:7668256dbe61 178 #define MXC_F_RTC_INTEN_TRIM_POS 4
mbed_official 514:7668256dbe61 179 #define MXC_F_RTC_INTEN_TRIM ((uint32_t)(0x00000001UL << MXC_F_RTC_INTEN_TRIM_POS))
mbed_official 514:7668256dbe61 180
mbed_official 514:7668256dbe61 181 #define MXC_F_RTC_PRESCALE_WIDTH_SELECTION_POS 0
mbed_official 514:7668256dbe61 182 #define MXC_F_RTC_PRESCALE_WIDTH_SELECTION ((uint32_t)(0x0000000FUL << MXC_F_RTC_PRESCALE_WIDTH_SELECTION_POS))
mbed_official 514:7668256dbe61 183
mbed_official 514:7668256dbe61 184 #define MXC_F_RTC_PRESCALE_MASK_COMP_MASK_POS 0
mbed_official 514:7668256dbe61 185 #define MXC_F_RTC_PRESCALE_MASK_COMP_MASK ((uint32_t)(0x0000000FUL << MXC_F_RTC_PRESCALE_MASK_COMP_MASK_POS))
mbed_official 514:7668256dbe61 186
mbed_official 514:7668256dbe61 187 #define MXC_F_RTC_TRIM_CTRL_TRIM_ENABLE_R_POS 0
mbed_official 514:7668256dbe61 188 #define MXC_F_RTC_TRIM_CTRL_TRIM_ENABLE_R ((uint32_t)(0x00000001UL << MXC_F_RTC_TRIM_CTRL_TRIM_ENABLE_R_POS))
mbed_official 514:7668256dbe61 189 #define MXC_F_RTC_TRIM_CTRL_TRIM_FASTER_OVR_R_POS 1
mbed_official 514:7668256dbe61 190 #define MXC_F_RTC_TRIM_CTRL_TRIM_FASTER_OVR_R ((uint32_t)(0x00000001UL << MXC_F_RTC_TRIM_CTRL_TRIM_FASTER_OVR_R_POS))
mbed_official 514:7668256dbe61 191 #define MXC_F_RTC_TRIM_CTRL_TRIM_SLOWER_R_POS 2
mbed_official 514:7668256dbe61 192 #define MXC_F_RTC_TRIM_CTRL_TRIM_SLOWER_R ((uint32_t)(0x00000001UL << MXC_F_RTC_TRIM_CTRL_TRIM_SLOWER_R_POS))
mbed_official 514:7668256dbe61 193
mbed_official 514:7668256dbe61 194 #define MXC_F_RTC_TRIM_VALUE_TRIM_VALUE_POS 0
mbed_official 514:7668256dbe61 195 #define MXC_F_RTC_TRIM_VALUE_TRIM_VALUE ((uint32_t)(0x0003FFFFUL << MXC_F_RTC_TRIM_VALUE_TRIM_VALUE_POS))
mbed_official 514:7668256dbe61 196 #define MXC_F_RTC_TRIM_VALUE_TRIM_CONTROL_POS 18
mbed_official 514:7668256dbe61 197 #define MXC_F_RTC_TRIM_VALUE_TRIM_CONTROL ((uint32_t)(0x00000001UL << MXC_F_RTC_TRIM_VALUE_TRIM_CONTROL_POS))
mbed_official 514:7668256dbe61 198
mbed_official 514:7668256dbe61 199 #define MXC_F_RTC_NANO_CNTR_NANORING_COUNTER_POS 0
mbed_official 514:7668256dbe61 200 #define MXC_F_RTC_NANO_CNTR_NANORING_COUNTER ((uint32_t)(0x0000FFFFUL << MXC_F_RTC_NANO_CNTR_NANORING_COUNTER_POS))
mbed_official 514:7668256dbe61 201
mbed_official 514:7668256dbe61 202 #define MXC_F_RTC_CLK_CTRL_OSC1_EN_POS 0
mbed_official 514:7668256dbe61 203 #define MXC_F_RTC_CLK_CTRL_OSC1_EN ((uint32_t)(0x00000001UL << MXC_F_RTC_CLK_CTRL_OSC1_EN_POS))
mbed_official 514:7668256dbe61 204 #define MXC_F_RTC_CLK_CTRL_OSC2_EN_POS 1
mbed_official 514:7668256dbe61 205 #define MXC_F_RTC_CLK_CTRL_OSC2_EN ((uint32_t)(0x00000001UL << MXC_F_RTC_CLK_CTRL_OSC2_EN_POS))
mbed_official 514:7668256dbe61 206 #define MXC_F_RTC_CLK_CTRL_NANO_EN_POS 2
mbed_official 514:7668256dbe61 207 #define MXC_F_RTC_CLK_CTRL_NANO_EN ((uint32_t)(0x00000001UL << MXC_F_RTC_CLK_CTRL_NANO_EN_POS))
mbed_official 514:7668256dbe61 208
mbed_official 514:7668256dbe61 209 #define MXC_F_RTC_DSEN_CTRL_DSEN_DISABLE_POS 0
mbed_official 514:7668256dbe61 210 #define MXC_F_RTC_DSEN_CTRL_DSEN_DISABLE ((uint32_t)(0x00000001UL << MXC_F_RTC_DSEN_CTRL_DSEN_DISABLE_POS))
mbed_official 514:7668256dbe61 211
mbed_official 514:7668256dbe61 212 #define MXC_F_RTC_OSC_CTRL_OSC_BYPASS_POS 0
mbed_official 514:7668256dbe61 213 #define MXC_F_RTC_OSC_CTRL_OSC_BYPASS ((uint32_t)(0x00000001UL << MXC_F_RTC_OSC_CTRL_OSC_BYPASS_POS))
mbed_official 514:7668256dbe61 214 #define MXC_F_RTC_OSC_CTRL_OSC_DISABLE_R_POS 1
mbed_official 514:7668256dbe61 215 #define MXC_F_RTC_OSC_CTRL_OSC_DISABLE_R ((uint32_t)(0x00000001UL << MXC_F_RTC_OSC_CTRL_OSC_DISABLE_R_POS))
mbed_official 514:7668256dbe61 216 #define MXC_F_RTC_OSC_CTRL_OSC_DISABLE_SEL_POS 2
mbed_official 514:7668256dbe61 217 #define MXC_F_RTC_OSC_CTRL_OSC_DISABLE_SEL ((uint32_t)(0x00000001UL << MXC_F_RTC_OSC_CTRL_OSC_DISABLE_SEL_POS))
mbed_official 514:7668256dbe61 218 #define MXC_F_RTC_OSC_CTRL_OSC_DISABLE_O_POS 3
mbed_official 514:7668256dbe61 219 #define MXC_F_RTC_OSC_CTRL_OSC_DISABLE_O ((uint32_t)(0x00000001UL << MXC_F_RTC_OSC_CTRL_OSC_DISABLE_O_POS))
mbed_official 514:7668256dbe61 220
mbed_official 514:7668256dbe61 221 /* Offset Register Description
mbed_official 514:7668256dbe61 222 ====== ===================================================================== */
mbed_official 514:7668256dbe61 223 typedef struct {
mbed_official 514:7668256dbe61 224 __IO uint32_t nano_counter; /* 0x0000 Nanoring Counter Read Register */
mbed_official 514:7668256dbe61 225 __IO uint32_t clk_ctrl; /* 0x0004 RTC Clock Control Settings */
mbed_official 514:7668256dbe61 226 __IO uint32_t dsen_ctrl; /* 0x0008 Dynamic Tamper Sensor Control */
mbed_official 514:7668256dbe61 227 __IO uint32_t osc_ctrl; /* 0x000C RTC Oscillator Control */
mbed_official 514:7668256dbe61 228 } mxc_rtccfg_regs_t;
mbed_official 514:7668256dbe61 229
mbed_official 514:7668256dbe61 230 /*
mbed_official 514:7668256dbe61 231 Register offsets for module RTCCFG.
mbed_official 514:7668256dbe61 232 */
mbed_official 514:7668256dbe61 233 #define MXC_R_RTCCFG_OFFS_NANO_COUNTER ((uint32_t)0x00000000UL)
mbed_official 514:7668256dbe61 234 #define MXC_R_RTCCFG_OFFS_CLK_CTRL ((uint32_t)0x00000004UL)
mbed_official 514:7668256dbe61 235 #define MXC_R_RTCCFG_OFFS_DSEN_CTRL ((uint32_t)0x00000008UL)
mbed_official 514:7668256dbe61 236 #define MXC_R_RTCCFG_OFFS_OSC_CTRL ((uint32_t)0x0000000CUL)
mbed_official 514:7668256dbe61 237
mbed_official 514:7668256dbe61 238 #ifdef __cplusplus
mbed_official 514:7668256dbe61 239 }
mbed_official 514:7668256dbe61 240 #endif
mbed_official 514:7668256dbe61 241
mbed_official 514:7668256dbe61 242 /**
mbed_official 514:7668256dbe61 243 * @}
mbed_official 514:7668256dbe61 244 */
mbed_official 514:7668256dbe61 245
mbed_official 514:7668256dbe61 246 #endif /* _MXC_RTC_REGS_H */