Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
111:4336505e4b1c
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 111:4336505e4b1c 1 /**
Kojto 111:4336505e4b1c 2 * \file
Kojto 111:4336505e4b1c 3 *
Kojto 111:4336505e4b1c 4 * \brief Component description for I2S
Kojto 111:4336505e4b1c 5 *
Kojto 111:4336505e4b1c 6 * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
Kojto 111:4336505e4b1c 7 *
Kojto 111:4336505e4b1c 8 * \asf_license_start
Kojto 111:4336505e4b1c 9 *
Kojto 111:4336505e4b1c 10 * \page License
Kojto 111:4336505e4b1c 11 *
Kojto 111:4336505e4b1c 12 * Redistribution and use in source and binary forms, with or without
Kojto 111:4336505e4b1c 13 * modification, are permitted provided that the following conditions are met:
Kojto 111:4336505e4b1c 14 *
Kojto 111:4336505e4b1c 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 111:4336505e4b1c 16 * this list of conditions and the following disclaimer.
Kojto 111:4336505e4b1c 17 *
Kojto 111:4336505e4b1c 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 111:4336505e4b1c 19 * this list of conditions and the following disclaimer in the documentation
Kojto 111:4336505e4b1c 20 * and/or other materials provided with the distribution.
Kojto 111:4336505e4b1c 21 *
Kojto 111:4336505e4b1c 22 * 3. The name of Atmel may not be used to endorse or promote products derived
Kojto 111:4336505e4b1c 23 * from this software without specific prior written permission.
Kojto 111:4336505e4b1c 24 *
Kojto 111:4336505e4b1c 25 * 4. This software may only be redistributed and used in connection with an
Kojto 111:4336505e4b1c 26 * Atmel microcontroller product.
Kojto 111:4336505e4b1c 27 *
Kojto 111:4336505e4b1c 28 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
Kojto 111:4336505e4b1c 29 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
Kojto 111:4336505e4b1c 30 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
Kojto 111:4336505e4b1c 31 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
Kojto 111:4336505e4b1c 32 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 111:4336505e4b1c 33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
Kojto 111:4336505e4b1c 34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
Kojto 111:4336505e4b1c 35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
Kojto 111:4336505e4b1c 36 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
Kojto 111:4336505e4b1c 37 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
Kojto 111:4336505e4b1c 38 * POSSIBILITY OF SUCH DAMAGE.
Kojto 111:4336505e4b1c 39 *
Kojto 111:4336505e4b1c 40 * \asf_license_stop
Kojto 111:4336505e4b1c 41 *
Kojto 111:4336505e4b1c 42 */
Kojto 111:4336505e4b1c 43 /*
Kojto 111:4336505e4b1c 44 * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
Kojto 111:4336505e4b1c 45 */
Kojto 111:4336505e4b1c 46
Kojto 111:4336505e4b1c 47 #ifndef _SAMD21_I2S_COMPONENT_
Kojto 111:4336505e4b1c 48 #define _SAMD21_I2S_COMPONENT_
Kojto 111:4336505e4b1c 49
Kojto 111:4336505e4b1c 50 /* ========================================================================== */
Kojto 111:4336505e4b1c 51 /** SOFTWARE API DEFINITION FOR I2S */
Kojto 111:4336505e4b1c 52 /* ========================================================================== */
Kojto 111:4336505e4b1c 53 /** \addtogroup SAMD21_I2S Inter-IC Sound Interface */
Kojto 111:4336505e4b1c 54 /*@{*/
Kojto 111:4336505e4b1c 55
Kojto 111:4336505e4b1c 56 #define I2S_U2224
Kojto 111:4336505e4b1c 57 #define REV_I2S 0x110
Kojto 111:4336505e4b1c 58
Kojto 111:4336505e4b1c 59 /* -------- I2S_CTRLA : (I2S Offset: 0x00) (R/W 8) Control A -------- */
Kojto 111:4336505e4b1c 60 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
Kojto 111:4336505e4b1c 61 typedef union {
Kojto 111:4336505e4b1c 62 struct {
Kojto 111:4336505e4b1c 63 uint8_t SWRST:1; /*!< bit: 0 Software Reset */
Kojto 111:4336505e4b1c 64 uint8_t ENABLE:1; /*!< bit: 1 Enable */
Kojto 111:4336505e4b1c 65 uint8_t CKEN0:1; /*!< bit: 2 Clock Unit 0 Enable */
Kojto 111:4336505e4b1c 66 uint8_t CKEN1:1; /*!< bit: 3 Clock Unit 1 Enable */
Kojto 111:4336505e4b1c 67 uint8_t SEREN0:1; /*!< bit: 4 Serializer 0 Enable */
Kojto 111:4336505e4b1c 68 uint8_t SEREN1:1; /*!< bit: 5 Serializer 1 Enable */
Kojto 111:4336505e4b1c 69 uint8_t :2; /*!< bit: 6.. 7 Reserved */
Kojto 111:4336505e4b1c 70 } bit; /*!< Structure used for bit access */
Kojto 111:4336505e4b1c 71 struct {
Kojto 111:4336505e4b1c 72 uint8_t :2; /*!< bit: 0.. 1 Reserved */
Kojto 111:4336505e4b1c 73 uint8_t CKEN:2; /*!< bit: 2.. 3 Clock Unit x Enable */
Kojto 111:4336505e4b1c 74 uint8_t SEREN:2; /*!< bit: 4.. 5 Serializer x Enable */
Kojto 111:4336505e4b1c 75 uint8_t :2; /*!< bit: 6.. 7 Reserved */
Kojto 111:4336505e4b1c 76 } vec; /*!< Structure used for vec access */
Kojto 111:4336505e4b1c 77 uint8_t reg; /*!< Type used for register access */
Kojto 111:4336505e4b1c 78 } I2S_CTRLA_Type;
Kojto 111:4336505e4b1c 79 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
Kojto 111:4336505e4b1c 80
Kojto 111:4336505e4b1c 81 #define I2S_CTRLA_OFFSET 0x00 /**< \brief (I2S_CTRLA offset) Control A */
Kojto 111:4336505e4b1c 82 #define I2S_CTRLA_RESETVALUE 0x00ul /**< \brief (I2S_CTRLA reset_value) Control A */
Kojto 111:4336505e4b1c 83
Kojto 111:4336505e4b1c 84 #define I2S_CTRLA_SWRST_Pos 0 /**< \brief (I2S_CTRLA) Software Reset */
Kojto 111:4336505e4b1c 85 #define I2S_CTRLA_SWRST (0x1ul << I2S_CTRLA_SWRST_Pos)
Kojto 111:4336505e4b1c 86 #define I2S_CTRLA_ENABLE_Pos 1 /**< \brief (I2S_CTRLA) Enable */
Kojto 111:4336505e4b1c 87 #define I2S_CTRLA_ENABLE (0x1ul << I2S_CTRLA_ENABLE_Pos)
Kojto 111:4336505e4b1c 88 #define I2S_CTRLA_CKEN0_Pos 2 /**< \brief (I2S_CTRLA) Clock Unit 0 Enable */
Kojto 111:4336505e4b1c 89 #define I2S_CTRLA_CKEN0 (1 << I2S_CTRLA_CKEN0_Pos)
Kojto 111:4336505e4b1c 90 #define I2S_CTRLA_CKEN1_Pos 3 /**< \brief (I2S_CTRLA) Clock Unit 1 Enable */
Kojto 111:4336505e4b1c 91 #define I2S_CTRLA_CKEN1 (1 << I2S_CTRLA_CKEN1_Pos)
Kojto 111:4336505e4b1c 92 #define I2S_CTRLA_CKEN_Pos 2 /**< \brief (I2S_CTRLA) Clock Unit x Enable */
Kojto 111:4336505e4b1c 93 #define I2S_CTRLA_CKEN_Msk (0x3ul << I2S_CTRLA_CKEN_Pos)
Kojto 111:4336505e4b1c 94 #define I2S_CTRLA_CKEN(value) ((I2S_CTRLA_CKEN_Msk & ((value) << I2S_CTRLA_CKEN_Pos)))
Kojto 111:4336505e4b1c 95 #define I2S_CTRLA_SEREN0_Pos 4 /**< \brief (I2S_CTRLA) Serializer 0 Enable */
Kojto 111:4336505e4b1c 96 #define I2S_CTRLA_SEREN0 (1 << I2S_CTRLA_SEREN0_Pos)
Kojto 111:4336505e4b1c 97 #define I2S_CTRLA_SEREN1_Pos 5 /**< \brief (I2S_CTRLA) Serializer 1 Enable */
Kojto 111:4336505e4b1c 98 #define I2S_CTRLA_SEREN1 (1 << I2S_CTRLA_SEREN1_Pos)
Kojto 111:4336505e4b1c 99 #define I2S_CTRLA_SEREN_Pos 4 /**< \brief (I2S_CTRLA) Serializer x Enable */
Kojto 111:4336505e4b1c 100 #define I2S_CTRLA_SEREN_Msk (0x3ul << I2S_CTRLA_SEREN_Pos)
Kojto 111:4336505e4b1c 101 #define I2S_CTRLA_SEREN(value) ((I2S_CTRLA_SEREN_Msk & ((value) << I2S_CTRLA_SEREN_Pos)))
Kojto 111:4336505e4b1c 102 #define I2S_CTRLA_MASK 0x3Ful /**< \brief (I2S_CTRLA) MASK Register */
Kojto 111:4336505e4b1c 103
Kojto 111:4336505e4b1c 104 /* -------- I2S_CLKCTRL : (I2S Offset: 0x04) (R/W 32) Clock Unit n Control -------- */
Kojto 111:4336505e4b1c 105 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
Kojto 111:4336505e4b1c 106 typedef union {
Kojto 111:4336505e4b1c 107 struct {
Kojto 111:4336505e4b1c 108 uint32_t SLOTSIZE:2; /*!< bit: 0.. 1 Slot Size */
Kojto 111:4336505e4b1c 109 uint32_t NBSLOTS:3; /*!< bit: 2.. 4 Number of Slots in Frame */
Kojto 111:4336505e4b1c 110 uint32_t FSWIDTH:2; /*!< bit: 5.. 6 Frame Sync Width */
Kojto 111:4336505e4b1c 111 uint32_t BITDELAY:1; /*!< bit: 7 Data Delay from Frame Sync */
Kojto 111:4336505e4b1c 112 uint32_t FSSEL:1; /*!< bit: 8 Frame Sync Select */
Kojto 111:4336505e4b1c 113 uint32_t :2; /*!< bit: 9..10 Reserved */
Kojto 111:4336505e4b1c 114 uint32_t FSINV:1; /*!< bit: 11 Frame Sync Invert */
Kojto 111:4336505e4b1c 115 uint32_t SCKSEL:1; /*!< bit: 12 Serial Clock Select */
Kojto 111:4336505e4b1c 116 uint32_t :3; /*!< bit: 13..15 Reserved */
Kojto 111:4336505e4b1c 117 uint32_t MCKSEL:1; /*!< bit: 16 Master Clock Select */
Kojto 111:4336505e4b1c 118 uint32_t :1; /*!< bit: 17 Reserved */
Kojto 111:4336505e4b1c 119 uint32_t MCKEN:1; /*!< bit: 18 Master Clock Enable */
Kojto 111:4336505e4b1c 120 uint32_t MCKDIV:5; /*!< bit: 19..23 Master Clock Division Factor */
Kojto 111:4336505e4b1c 121 uint32_t MCKOUTDIV:5; /*!< bit: 24..28 Master Clock Output Division Factor */
Kojto 111:4336505e4b1c 122 uint32_t FSOUTINV:1; /*!< bit: 29 Frame Sync Output Invert */
Kojto 111:4336505e4b1c 123 uint32_t SCKOUTINV:1; /*!< bit: 30 Serial Clock Output Invert */
Kojto 111:4336505e4b1c 124 uint32_t MCKOUTINV:1; /*!< bit: 31 Master Clock Output Invert */
Kojto 111:4336505e4b1c 125 } bit; /*!< Structure used for bit access */
Kojto 111:4336505e4b1c 126 uint32_t reg; /*!< Type used for register access */
Kojto 111:4336505e4b1c 127 } I2S_CLKCTRL_Type;
Kojto 111:4336505e4b1c 128 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
Kojto 111:4336505e4b1c 129
Kojto 111:4336505e4b1c 130 #define I2S_CLKCTRL_OFFSET 0x04 /**< \brief (I2S_CLKCTRL offset) Clock Unit n Control */
Kojto 111:4336505e4b1c 131 #define I2S_CLKCTRL_RESETVALUE 0x00000000ul /**< \brief (I2S_CLKCTRL reset_value) Clock Unit n Control */
Kojto 111:4336505e4b1c 132
Kojto 111:4336505e4b1c 133 #define I2S_CLKCTRL_SLOTSIZE_Pos 0 /**< \brief (I2S_CLKCTRL) Slot Size */
Kojto 111:4336505e4b1c 134 #define I2S_CLKCTRL_SLOTSIZE_Msk (0x3ul << I2S_CLKCTRL_SLOTSIZE_Pos)
Kojto 111:4336505e4b1c 135 #define I2S_CLKCTRL_SLOTSIZE(value) ((I2S_CLKCTRL_SLOTSIZE_Msk & ((value) << I2S_CLKCTRL_SLOTSIZE_Pos)))
Kojto 111:4336505e4b1c 136 #define I2S_CLKCTRL_SLOTSIZE_8_Val 0x0ul /**< \brief (I2S_CLKCTRL) 8-bit Slot for Clock Unit n */
Kojto 111:4336505e4b1c 137 #define I2S_CLKCTRL_SLOTSIZE_16_Val 0x1ul /**< \brief (I2S_CLKCTRL) 16-bit Slot for Clock Unit n */
Kojto 111:4336505e4b1c 138 #define I2S_CLKCTRL_SLOTSIZE_24_Val 0x2ul /**< \brief (I2S_CLKCTRL) 24-bit Slot for Clock Unit n */
Kojto 111:4336505e4b1c 139 #define I2S_CLKCTRL_SLOTSIZE_32_Val 0x3ul /**< \brief (I2S_CLKCTRL) 32-bit Slot for Clock Unit n */
Kojto 111:4336505e4b1c 140 #define I2S_CLKCTRL_SLOTSIZE_8 (I2S_CLKCTRL_SLOTSIZE_8_Val << I2S_CLKCTRL_SLOTSIZE_Pos)
Kojto 111:4336505e4b1c 141 #define I2S_CLKCTRL_SLOTSIZE_16 (I2S_CLKCTRL_SLOTSIZE_16_Val << I2S_CLKCTRL_SLOTSIZE_Pos)
Kojto 111:4336505e4b1c 142 #define I2S_CLKCTRL_SLOTSIZE_24 (I2S_CLKCTRL_SLOTSIZE_24_Val << I2S_CLKCTRL_SLOTSIZE_Pos)
Kojto 111:4336505e4b1c 143 #define I2S_CLKCTRL_SLOTSIZE_32 (I2S_CLKCTRL_SLOTSIZE_32_Val << I2S_CLKCTRL_SLOTSIZE_Pos)
Kojto 111:4336505e4b1c 144 #define I2S_CLKCTRL_NBSLOTS_Pos 2 /**< \brief (I2S_CLKCTRL) Number of Slots in Frame */
Kojto 111:4336505e4b1c 145 #define I2S_CLKCTRL_NBSLOTS_Msk (0x7ul << I2S_CLKCTRL_NBSLOTS_Pos)
Kojto 111:4336505e4b1c 146 #define I2S_CLKCTRL_NBSLOTS(value) ((I2S_CLKCTRL_NBSLOTS_Msk & ((value) << I2S_CLKCTRL_NBSLOTS_Pos)))
Kojto 111:4336505e4b1c 147 #define I2S_CLKCTRL_FSWIDTH_Pos 5 /**< \brief (I2S_CLKCTRL) Frame Sync Width */
Kojto 111:4336505e4b1c 148 #define I2S_CLKCTRL_FSWIDTH_Msk (0x3ul << I2S_CLKCTRL_FSWIDTH_Pos)
Kojto 111:4336505e4b1c 149 #define I2S_CLKCTRL_FSWIDTH(value) ((I2S_CLKCTRL_FSWIDTH_Msk & ((value) << I2S_CLKCTRL_FSWIDTH_Pos)))
Kojto 111:4336505e4b1c 150 #define I2S_CLKCTRL_FSWIDTH_SLOT_Val 0x0ul /**< \brief (I2S_CLKCTRL) Frame Sync Pulse is 1 Slot wide (default for I2S protocol) */
Kojto 111:4336505e4b1c 151 #define I2S_CLKCTRL_FSWIDTH_HALF_Val 0x1ul /**< \brief (I2S_CLKCTRL) Frame Sync Pulse is half a Frame wide */
Kojto 111:4336505e4b1c 152 #define I2S_CLKCTRL_FSWIDTH_BIT_Val 0x2ul /**< \brief (I2S_CLKCTRL) Frame Sync Pulse is 1 Bit wide */
Kojto 111:4336505e4b1c 153 #define I2S_CLKCTRL_FSWIDTH_BURST_Val 0x3ul /**< \brief (I2S_CLKCTRL) Clock Unit n operates in Burst mode, with a 1-bit wide Frame Sync pulse per Data sample, only when Data transfer is requested */
Kojto 111:4336505e4b1c 154 #define I2S_CLKCTRL_FSWIDTH_SLOT (I2S_CLKCTRL_FSWIDTH_SLOT_Val << I2S_CLKCTRL_FSWIDTH_Pos)
Kojto 111:4336505e4b1c 155 #define I2S_CLKCTRL_FSWIDTH_HALF (I2S_CLKCTRL_FSWIDTH_HALF_Val << I2S_CLKCTRL_FSWIDTH_Pos)
Kojto 111:4336505e4b1c 156 #define I2S_CLKCTRL_FSWIDTH_BIT (I2S_CLKCTRL_FSWIDTH_BIT_Val << I2S_CLKCTRL_FSWIDTH_Pos)
Kojto 111:4336505e4b1c 157 #define I2S_CLKCTRL_FSWIDTH_BURST (I2S_CLKCTRL_FSWIDTH_BURST_Val << I2S_CLKCTRL_FSWIDTH_Pos)
Kojto 111:4336505e4b1c 158 #define I2S_CLKCTRL_BITDELAY_Pos 7 /**< \brief (I2S_CLKCTRL) Data Delay from Frame Sync */
Kojto 111:4336505e4b1c 159 #define I2S_CLKCTRL_BITDELAY (0x1ul << I2S_CLKCTRL_BITDELAY_Pos)
Kojto 111:4336505e4b1c 160 #define I2S_CLKCTRL_BITDELAY_LJ_Val 0x0ul /**< \brief (I2S_CLKCTRL) Left Justified (0 Bit Delay) */
Kojto 111:4336505e4b1c 161 #define I2S_CLKCTRL_BITDELAY_I2S_Val 0x1ul /**< \brief (I2S_CLKCTRL) I2S (1 Bit Delay) */
Kojto 111:4336505e4b1c 162 #define I2S_CLKCTRL_BITDELAY_LJ (I2S_CLKCTRL_BITDELAY_LJ_Val << I2S_CLKCTRL_BITDELAY_Pos)
Kojto 111:4336505e4b1c 163 #define I2S_CLKCTRL_BITDELAY_I2S (I2S_CLKCTRL_BITDELAY_I2S_Val << I2S_CLKCTRL_BITDELAY_Pos)
Kojto 111:4336505e4b1c 164 #define I2S_CLKCTRL_FSSEL_Pos 8 /**< \brief (I2S_CLKCTRL) Frame Sync Select */
Kojto 111:4336505e4b1c 165 #define I2S_CLKCTRL_FSSEL (0x1ul << I2S_CLKCTRL_FSSEL_Pos)
Kojto 111:4336505e4b1c 166 #define I2S_CLKCTRL_FSSEL_SCKDIV_Val 0x0ul /**< \brief (I2S_CLKCTRL) Divided Serial Clock n is used as Frame Sync n source */
Kojto 111:4336505e4b1c 167 #define I2S_CLKCTRL_FSSEL_FSPIN_Val 0x1ul /**< \brief (I2S_CLKCTRL) FSn input pin is used as Frame Sync n source */
Kojto 111:4336505e4b1c 168 #define I2S_CLKCTRL_FSSEL_SCKDIV (I2S_CLKCTRL_FSSEL_SCKDIV_Val << I2S_CLKCTRL_FSSEL_Pos)
Kojto 111:4336505e4b1c 169 #define I2S_CLKCTRL_FSSEL_FSPIN (I2S_CLKCTRL_FSSEL_FSPIN_Val << I2S_CLKCTRL_FSSEL_Pos)
Kojto 111:4336505e4b1c 170 #define I2S_CLKCTRL_FSINV_Pos 11 /**< \brief (I2S_CLKCTRL) Frame Sync Invert */
Kojto 111:4336505e4b1c 171 #define I2S_CLKCTRL_FSINV (0x1ul << I2S_CLKCTRL_FSINV_Pos)
Kojto 111:4336505e4b1c 172 #define I2S_CLKCTRL_SCKSEL_Pos 12 /**< \brief (I2S_CLKCTRL) Serial Clock Select */
Kojto 111:4336505e4b1c 173 #define I2S_CLKCTRL_SCKSEL (0x1ul << I2S_CLKCTRL_SCKSEL_Pos)
Kojto 111:4336505e4b1c 174 #define I2S_CLKCTRL_SCKSEL_MCKDIV_Val 0x0ul /**< \brief (I2S_CLKCTRL) Divided Master Clock n is used as Serial Clock n source */
Kojto 111:4336505e4b1c 175 #define I2S_CLKCTRL_SCKSEL_SCKPIN_Val 0x1ul /**< \brief (I2S_CLKCTRL) SCKn input pin is used as Serial Clock n source */
Kojto 111:4336505e4b1c 176 #define I2S_CLKCTRL_SCKSEL_MCKDIV (I2S_CLKCTRL_SCKSEL_MCKDIV_Val << I2S_CLKCTRL_SCKSEL_Pos)
Kojto 111:4336505e4b1c 177 #define I2S_CLKCTRL_SCKSEL_SCKPIN (I2S_CLKCTRL_SCKSEL_SCKPIN_Val << I2S_CLKCTRL_SCKSEL_Pos)
Kojto 111:4336505e4b1c 178 #define I2S_CLKCTRL_MCKSEL_Pos 16 /**< \brief (I2S_CLKCTRL) Master Clock Select */
Kojto 111:4336505e4b1c 179 #define I2S_CLKCTRL_MCKSEL (0x1ul << I2S_CLKCTRL_MCKSEL_Pos)
Kojto 111:4336505e4b1c 180 #define I2S_CLKCTRL_MCKSEL_GCLK_Val 0x0ul /**< \brief (I2S_CLKCTRL) GCLK_I2S_n is used as Master Clock n source */
Kojto 111:4336505e4b1c 181 #define I2S_CLKCTRL_MCKSEL_MCKPIN_Val 0x1ul /**< \brief (I2S_CLKCTRL) MCKn input pin is used as Master Clock n source */
Kojto 111:4336505e4b1c 182 #define I2S_CLKCTRL_MCKSEL_GCLK (I2S_CLKCTRL_MCKSEL_GCLK_Val << I2S_CLKCTRL_MCKSEL_Pos)
Kojto 111:4336505e4b1c 183 #define I2S_CLKCTRL_MCKSEL_MCKPIN (I2S_CLKCTRL_MCKSEL_MCKPIN_Val << I2S_CLKCTRL_MCKSEL_Pos)
Kojto 111:4336505e4b1c 184 #define I2S_CLKCTRL_MCKEN_Pos 18 /**< \brief (I2S_CLKCTRL) Master Clock Enable */
Kojto 111:4336505e4b1c 185 #define I2S_CLKCTRL_MCKEN (0x1ul << I2S_CLKCTRL_MCKEN_Pos)
Kojto 111:4336505e4b1c 186 #define I2S_CLKCTRL_MCKDIV_Pos 19 /**< \brief (I2S_CLKCTRL) Master Clock Division Factor */
Kojto 111:4336505e4b1c 187 #define I2S_CLKCTRL_MCKDIV_Msk (0x1Ful << I2S_CLKCTRL_MCKDIV_Pos)
Kojto 111:4336505e4b1c 188 #define I2S_CLKCTRL_MCKDIV(value) ((I2S_CLKCTRL_MCKDIV_Msk & ((value) << I2S_CLKCTRL_MCKDIV_Pos)))
Kojto 111:4336505e4b1c 189 #define I2S_CLKCTRL_MCKOUTDIV_Pos 24 /**< \brief (I2S_CLKCTRL) Master Clock Output Division Factor */
Kojto 111:4336505e4b1c 190 #define I2S_CLKCTRL_MCKOUTDIV_Msk (0x1Ful << I2S_CLKCTRL_MCKOUTDIV_Pos)
Kojto 111:4336505e4b1c 191 #define I2S_CLKCTRL_MCKOUTDIV(value) ((I2S_CLKCTRL_MCKOUTDIV_Msk & ((value) << I2S_CLKCTRL_MCKOUTDIV_Pos)))
Kojto 111:4336505e4b1c 192 #define I2S_CLKCTRL_FSOUTINV_Pos 29 /**< \brief (I2S_CLKCTRL) Frame Sync Output Invert */
Kojto 111:4336505e4b1c 193 #define I2S_CLKCTRL_FSOUTINV (0x1ul << I2S_CLKCTRL_FSOUTINV_Pos)
Kojto 111:4336505e4b1c 194 #define I2S_CLKCTRL_SCKOUTINV_Pos 30 /**< \brief (I2S_CLKCTRL) Serial Clock Output Invert */
Kojto 111:4336505e4b1c 195 #define I2S_CLKCTRL_SCKOUTINV (0x1ul << I2S_CLKCTRL_SCKOUTINV_Pos)
Kojto 111:4336505e4b1c 196 #define I2S_CLKCTRL_MCKOUTINV_Pos 31 /**< \brief (I2S_CLKCTRL) Master Clock Output Invert */
Kojto 111:4336505e4b1c 197 #define I2S_CLKCTRL_MCKOUTINV (0x1ul << I2S_CLKCTRL_MCKOUTINV_Pos)
Kojto 111:4336505e4b1c 198 #define I2S_CLKCTRL_MASK 0xFFFD19FFul /**< \brief (I2S_CLKCTRL) MASK Register */
Kojto 111:4336505e4b1c 199
Kojto 111:4336505e4b1c 200 /* -------- I2S_INTENCLR : (I2S Offset: 0x0C) (R/W 16) Interrupt Enable Clear -------- */
Kojto 111:4336505e4b1c 201 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
Kojto 111:4336505e4b1c 202 typedef union {
Kojto 111:4336505e4b1c 203 struct {
Kojto 111:4336505e4b1c 204 uint16_t RXRDY0:1; /*!< bit: 0 Receive Ready 0 Interrupt Enable */
Kojto 111:4336505e4b1c 205 uint16_t RXRDY1:1; /*!< bit: 1 Receive Ready 1 Interrupt Enable */
Kojto 111:4336505e4b1c 206 uint16_t :2; /*!< bit: 2.. 3 Reserved */
Kojto 111:4336505e4b1c 207 uint16_t RXOR0:1; /*!< bit: 4 Receive Overrun 0 Interrupt Enable */
Kojto 111:4336505e4b1c 208 uint16_t RXOR1:1; /*!< bit: 5 Receive Overrun 1 Interrupt Enable */
Kojto 111:4336505e4b1c 209 uint16_t :2; /*!< bit: 6.. 7 Reserved */
Kojto 111:4336505e4b1c 210 uint16_t TXRDY0:1; /*!< bit: 8 Transmit Ready 0 Interrupt Enable */
Kojto 111:4336505e4b1c 211 uint16_t TXRDY1:1; /*!< bit: 9 Transmit Ready 1 Interrupt Enable */
Kojto 111:4336505e4b1c 212 uint16_t :2; /*!< bit: 10..11 Reserved */
Kojto 111:4336505e4b1c 213 uint16_t TXUR0:1; /*!< bit: 12 Transmit Underrun 0 Interrupt Enable */
Kojto 111:4336505e4b1c 214 uint16_t TXUR1:1; /*!< bit: 13 Transmit Underrun 1 Interrupt Enable */
Kojto 111:4336505e4b1c 215 uint16_t :2; /*!< bit: 14..15 Reserved */
Kojto 111:4336505e4b1c 216 } bit; /*!< Structure used for bit access */
Kojto 111:4336505e4b1c 217 struct {
Kojto 111:4336505e4b1c 218 uint16_t RXRDY:2; /*!< bit: 0.. 1 Receive Ready x Interrupt Enable */
Kojto 111:4336505e4b1c 219 uint16_t :2; /*!< bit: 2.. 3 Reserved */
Kojto 111:4336505e4b1c 220 uint16_t RXOR:2; /*!< bit: 4.. 5 Receive Overrun x Interrupt Enable */
Kojto 111:4336505e4b1c 221 uint16_t :2; /*!< bit: 6.. 7 Reserved */
Kojto 111:4336505e4b1c 222 uint16_t TXRDY:2; /*!< bit: 8.. 9 Transmit Ready x Interrupt Enable */
Kojto 111:4336505e4b1c 223 uint16_t :2; /*!< bit: 10..11 Reserved */
Kojto 111:4336505e4b1c 224 uint16_t TXUR:2; /*!< bit: 12..13 Transmit Underrun x Interrupt Enable */
Kojto 111:4336505e4b1c 225 uint16_t :2; /*!< bit: 14..15 Reserved */
Kojto 111:4336505e4b1c 226 } vec; /*!< Structure used for vec access */
Kojto 111:4336505e4b1c 227 uint16_t reg; /*!< Type used for register access */
Kojto 111:4336505e4b1c 228 } I2S_INTENCLR_Type;
Kojto 111:4336505e4b1c 229 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
Kojto 111:4336505e4b1c 230
Kojto 111:4336505e4b1c 231 #define I2S_INTENCLR_OFFSET 0x0C /**< \brief (I2S_INTENCLR offset) Interrupt Enable Clear */
Kojto 111:4336505e4b1c 232 #define I2S_INTENCLR_RESETVALUE 0x0000ul /**< \brief (I2S_INTENCLR reset_value) Interrupt Enable Clear */
Kojto 111:4336505e4b1c 233
Kojto 111:4336505e4b1c 234 #define I2S_INTENCLR_RXRDY0_Pos 0 /**< \brief (I2S_INTENCLR) Receive Ready 0 Interrupt Enable */
Kojto 111:4336505e4b1c 235 #define I2S_INTENCLR_RXRDY0 (1 << I2S_INTENCLR_RXRDY0_Pos)
Kojto 111:4336505e4b1c 236 #define I2S_INTENCLR_RXRDY1_Pos 1 /**< \brief (I2S_INTENCLR) Receive Ready 1 Interrupt Enable */
Kojto 111:4336505e4b1c 237 #define I2S_INTENCLR_RXRDY1 (1 << I2S_INTENCLR_RXRDY1_Pos)
Kojto 111:4336505e4b1c 238 #define I2S_INTENCLR_RXRDY_Pos 0 /**< \brief (I2S_INTENCLR) Receive Ready x Interrupt Enable */
Kojto 111:4336505e4b1c 239 #define I2S_INTENCLR_RXRDY_Msk (0x3ul << I2S_INTENCLR_RXRDY_Pos)
Kojto 111:4336505e4b1c 240 #define I2S_INTENCLR_RXRDY(value) ((I2S_INTENCLR_RXRDY_Msk & ((value) << I2S_INTENCLR_RXRDY_Pos)))
Kojto 111:4336505e4b1c 241 #define I2S_INTENCLR_RXOR0_Pos 4 /**< \brief (I2S_INTENCLR) Receive Overrun 0 Interrupt Enable */
Kojto 111:4336505e4b1c 242 #define I2S_INTENCLR_RXOR0 (1 << I2S_INTENCLR_RXOR0_Pos)
Kojto 111:4336505e4b1c 243 #define I2S_INTENCLR_RXOR1_Pos 5 /**< \brief (I2S_INTENCLR) Receive Overrun 1 Interrupt Enable */
Kojto 111:4336505e4b1c 244 #define I2S_INTENCLR_RXOR1 (1 << I2S_INTENCLR_RXOR1_Pos)
Kojto 111:4336505e4b1c 245 #define I2S_INTENCLR_RXOR_Pos 4 /**< \brief (I2S_INTENCLR) Receive Overrun x Interrupt Enable */
Kojto 111:4336505e4b1c 246 #define I2S_INTENCLR_RXOR_Msk (0x3ul << I2S_INTENCLR_RXOR_Pos)
Kojto 111:4336505e4b1c 247 #define I2S_INTENCLR_RXOR(value) ((I2S_INTENCLR_RXOR_Msk & ((value) << I2S_INTENCLR_RXOR_Pos)))
Kojto 111:4336505e4b1c 248 #define I2S_INTENCLR_TXRDY0_Pos 8 /**< \brief (I2S_INTENCLR) Transmit Ready 0 Interrupt Enable */
Kojto 111:4336505e4b1c 249 #define I2S_INTENCLR_TXRDY0 (1 << I2S_INTENCLR_TXRDY0_Pos)
Kojto 111:4336505e4b1c 250 #define I2S_INTENCLR_TXRDY1_Pos 9 /**< \brief (I2S_INTENCLR) Transmit Ready 1 Interrupt Enable */
Kojto 111:4336505e4b1c 251 #define I2S_INTENCLR_TXRDY1 (1 << I2S_INTENCLR_TXRDY1_Pos)
Kojto 111:4336505e4b1c 252 #define I2S_INTENCLR_TXRDY_Pos 8 /**< \brief (I2S_INTENCLR) Transmit Ready x Interrupt Enable */
Kojto 111:4336505e4b1c 253 #define I2S_INTENCLR_TXRDY_Msk (0x3ul << I2S_INTENCLR_TXRDY_Pos)
Kojto 111:4336505e4b1c 254 #define I2S_INTENCLR_TXRDY(value) ((I2S_INTENCLR_TXRDY_Msk & ((value) << I2S_INTENCLR_TXRDY_Pos)))
Kojto 111:4336505e4b1c 255 #define I2S_INTENCLR_TXUR0_Pos 12 /**< \brief (I2S_INTENCLR) Transmit Underrun 0 Interrupt Enable */
Kojto 111:4336505e4b1c 256 #define I2S_INTENCLR_TXUR0 (1 << I2S_INTENCLR_TXUR0_Pos)
Kojto 111:4336505e4b1c 257 #define I2S_INTENCLR_TXUR1_Pos 13 /**< \brief (I2S_INTENCLR) Transmit Underrun 1 Interrupt Enable */
Kojto 111:4336505e4b1c 258 #define I2S_INTENCLR_TXUR1 (1 << I2S_INTENCLR_TXUR1_Pos)
Kojto 111:4336505e4b1c 259 #define I2S_INTENCLR_TXUR_Pos 12 /**< \brief (I2S_INTENCLR) Transmit Underrun x Interrupt Enable */
Kojto 111:4336505e4b1c 260 #define I2S_INTENCLR_TXUR_Msk (0x3ul << I2S_INTENCLR_TXUR_Pos)
Kojto 111:4336505e4b1c 261 #define I2S_INTENCLR_TXUR(value) ((I2S_INTENCLR_TXUR_Msk & ((value) << I2S_INTENCLR_TXUR_Pos)))
Kojto 111:4336505e4b1c 262 #define I2S_INTENCLR_MASK 0x3333ul /**< \brief (I2S_INTENCLR) MASK Register */
Kojto 111:4336505e4b1c 263
Kojto 111:4336505e4b1c 264 /* -------- I2S_INTENSET : (I2S Offset: 0x10) (R/W 16) Interrupt Enable Set -------- */
Kojto 111:4336505e4b1c 265 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
Kojto 111:4336505e4b1c 266 typedef union {
Kojto 111:4336505e4b1c 267 struct {
Kojto 111:4336505e4b1c 268 uint16_t RXRDY0:1; /*!< bit: 0 Receive Ready 0 Interrupt Enable */
Kojto 111:4336505e4b1c 269 uint16_t RXRDY1:1; /*!< bit: 1 Receive Ready 1 Interrupt Enable */
Kojto 111:4336505e4b1c 270 uint16_t :2; /*!< bit: 2.. 3 Reserved */
Kojto 111:4336505e4b1c 271 uint16_t RXOR0:1; /*!< bit: 4 Receive Overrun 0 Interrupt Enable */
Kojto 111:4336505e4b1c 272 uint16_t RXOR1:1; /*!< bit: 5 Receive Overrun 1 Interrupt Enable */
Kojto 111:4336505e4b1c 273 uint16_t :2; /*!< bit: 6.. 7 Reserved */
Kojto 111:4336505e4b1c 274 uint16_t TXRDY0:1; /*!< bit: 8 Transmit Ready 0 Interrupt Enable */
Kojto 111:4336505e4b1c 275 uint16_t TXRDY1:1; /*!< bit: 9 Transmit Ready 1 Interrupt Enable */
Kojto 111:4336505e4b1c 276 uint16_t :2; /*!< bit: 10..11 Reserved */
Kojto 111:4336505e4b1c 277 uint16_t TXUR0:1; /*!< bit: 12 Transmit Underrun 0 Interrupt Enable */
Kojto 111:4336505e4b1c 278 uint16_t TXUR1:1; /*!< bit: 13 Transmit Underrun 1 Interrupt Enable */
Kojto 111:4336505e4b1c 279 uint16_t :2; /*!< bit: 14..15 Reserved */
Kojto 111:4336505e4b1c 280 } bit; /*!< Structure used for bit access */
Kojto 111:4336505e4b1c 281 struct {
Kojto 111:4336505e4b1c 282 uint16_t RXRDY:2; /*!< bit: 0.. 1 Receive Ready x Interrupt Enable */
Kojto 111:4336505e4b1c 283 uint16_t :2; /*!< bit: 2.. 3 Reserved */
Kojto 111:4336505e4b1c 284 uint16_t RXOR:2; /*!< bit: 4.. 5 Receive Overrun x Interrupt Enable */
Kojto 111:4336505e4b1c 285 uint16_t :2; /*!< bit: 6.. 7 Reserved */
Kojto 111:4336505e4b1c 286 uint16_t TXRDY:2; /*!< bit: 8.. 9 Transmit Ready x Interrupt Enable */
Kojto 111:4336505e4b1c 287 uint16_t :2; /*!< bit: 10..11 Reserved */
Kojto 111:4336505e4b1c 288 uint16_t TXUR:2; /*!< bit: 12..13 Transmit Underrun x Interrupt Enable */
Kojto 111:4336505e4b1c 289 uint16_t :2; /*!< bit: 14..15 Reserved */
Kojto 111:4336505e4b1c 290 } vec; /*!< Structure used for vec access */
Kojto 111:4336505e4b1c 291 uint16_t reg; /*!< Type used for register access */
Kojto 111:4336505e4b1c 292 } I2S_INTENSET_Type;
Kojto 111:4336505e4b1c 293 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
Kojto 111:4336505e4b1c 294
Kojto 111:4336505e4b1c 295 #define I2S_INTENSET_OFFSET 0x10 /**< \brief (I2S_INTENSET offset) Interrupt Enable Set */
Kojto 111:4336505e4b1c 296 #define I2S_INTENSET_RESETVALUE 0x0000ul /**< \brief (I2S_INTENSET reset_value) Interrupt Enable Set */
Kojto 111:4336505e4b1c 297
Kojto 111:4336505e4b1c 298 #define I2S_INTENSET_RXRDY0_Pos 0 /**< \brief (I2S_INTENSET) Receive Ready 0 Interrupt Enable */
Kojto 111:4336505e4b1c 299 #define I2S_INTENSET_RXRDY0 (1 << I2S_INTENSET_RXRDY0_Pos)
Kojto 111:4336505e4b1c 300 #define I2S_INTENSET_RXRDY1_Pos 1 /**< \brief (I2S_INTENSET) Receive Ready 1 Interrupt Enable */
Kojto 111:4336505e4b1c 301 #define I2S_INTENSET_RXRDY1 (1 << I2S_INTENSET_RXRDY1_Pos)
Kojto 111:4336505e4b1c 302 #define I2S_INTENSET_RXRDY_Pos 0 /**< \brief (I2S_INTENSET) Receive Ready x Interrupt Enable */
Kojto 111:4336505e4b1c 303 #define I2S_INTENSET_RXRDY_Msk (0x3ul << I2S_INTENSET_RXRDY_Pos)
Kojto 111:4336505e4b1c 304 #define I2S_INTENSET_RXRDY(value) ((I2S_INTENSET_RXRDY_Msk & ((value) << I2S_INTENSET_RXRDY_Pos)))
Kojto 111:4336505e4b1c 305 #define I2S_INTENSET_RXOR0_Pos 4 /**< \brief (I2S_INTENSET) Receive Overrun 0 Interrupt Enable */
Kojto 111:4336505e4b1c 306 #define I2S_INTENSET_RXOR0 (1 << I2S_INTENSET_RXOR0_Pos)
Kojto 111:4336505e4b1c 307 #define I2S_INTENSET_RXOR1_Pos 5 /**< \brief (I2S_INTENSET) Receive Overrun 1 Interrupt Enable */
Kojto 111:4336505e4b1c 308 #define I2S_INTENSET_RXOR1 (1 << I2S_INTENSET_RXOR1_Pos)
Kojto 111:4336505e4b1c 309 #define I2S_INTENSET_RXOR_Pos 4 /**< \brief (I2S_INTENSET) Receive Overrun x Interrupt Enable */
Kojto 111:4336505e4b1c 310 #define I2S_INTENSET_RXOR_Msk (0x3ul << I2S_INTENSET_RXOR_Pos)
Kojto 111:4336505e4b1c 311 #define I2S_INTENSET_RXOR(value) ((I2S_INTENSET_RXOR_Msk & ((value) << I2S_INTENSET_RXOR_Pos)))
Kojto 111:4336505e4b1c 312 #define I2S_INTENSET_TXRDY0_Pos 8 /**< \brief (I2S_INTENSET) Transmit Ready 0 Interrupt Enable */
Kojto 111:4336505e4b1c 313 #define I2S_INTENSET_TXRDY0 (1 << I2S_INTENSET_TXRDY0_Pos)
Kojto 111:4336505e4b1c 314 #define I2S_INTENSET_TXRDY1_Pos 9 /**< \brief (I2S_INTENSET) Transmit Ready 1 Interrupt Enable */
Kojto 111:4336505e4b1c 315 #define I2S_INTENSET_TXRDY1 (1 << I2S_INTENSET_TXRDY1_Pos)
Kojto 111:4336505e4b1c 316 #define I2S_INTENSET_TXRDY_Pos 8 /**< \brief (I2S_INTENSET) Transmit Ready x Interrupt Enable */
Kojto 111:4336505e4b1c 317 #define I2S_INTENSET_TXRDY_Msk (0x3ul << I2S_INTENSET_TXRDY_Pos)
Kojto 111:4336505e4b1c 318 #define I2S_INTENSET_TXRDY(value) ((I2S_INTENSET_TXRDY_Msk & ((value) << I2S_INTENSET_TXRDY_Pos)))
Kojto 111:4336505e4b1c 319 #define I2S_INTENSET_TXUR0_Pos 12 /**< \brief (I2S_INTENSET) Transmit Underrun 0 Interrupt Enable */
Kojto 111:4336505e4b1c 320 #define I2S_INTENSET_TXUR0 (1 << I2S_INTENSET_TXUR0_Pos)
Kojto 111:4336505e4b1c 321 #define I2S_INTENSET_TXUR1_Pos 13 /**< \brief (I2S_INTENSET) Transmit Underrun 1 Interrupt Enable */
Kojto 111:4336505e4b1c 322 #define I2S_INTENSET_TXUR1 (1 << I2S_INTENSET_TXUR1_Pos)
Kojto 111:4336505e4b1c 323 #define I2S_INTENSET_TXUR_Pos 12 /**< \brief (I2S_INTENSET) Transmit Underrun x Interrupt Enable */
Kojto 111:4336505e4b1c 324 #define I2S_INTENSET_TXUR_Msk (0x3ul << I2S_INTENSET_TXUR_Pos)
Kojto 111:4336505e4b1c 325 #define I2S_INTENSET_TXUR(value) ((I2S_INTENSET_TXUR_Msk & ((value) << I2S_INTENSET_TXUR_Pos)))
Kojto 111:4336505e4b1c 326 #define I2S_INTENSET_MASK 0x3333ul /**< \brief (I2S_INTENSET) MASK Register */
Kojto 111:4336505e4b1c 327
Kojto 111:4336505e4b1c 328 /* -------- I2S_INTFLAG : (I2S Offset: 0x14) (R/W 16) Interrupt Flag Status and Clear -------- */
Kojto 111:4336505e4b1c 329 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
Kojto 111:4336505e4b1c 330 typedef union {
Kojto 111:4336505e4b1c 331 struct {
Kojto 111:4336505e4b1c 332 uint16_t RXRDY0:1; /*!< bit: 0 Receive Ready 0 */
Kojto 111:4336505e4b1c 333 uint16_t RXRDY1:1; /*!< bit: 1 Receive Ready 1 */
Kojto 111:4336505e4b1c 334 uint16_t :2; /*!< bit: 2.. 3 Reserved */
Kojto 111:4336505e4b1c 335 uint16_t RXOR0:1; /*!< bit: 4 Receive Overrun 0 */
Kojto 111:4336505e4b1c 336 uint16_t RXOR1:1; /*!< bit: 5 Receive Overrun 1 */
Kojto 111:4336505e4b1c 337 uint16_t :2; /*!< bit: 6.. 7 Reserved */
Kojto 111:4336505e4b1c 338 uint16_t TXRDY0:1; /*!< bit: 8 Transmit Ready 0 */
Kojto 111:4336505e4b1c 339 uint16_t TXRDY1:1; /*!< bit: 9 Transmit Ready 1 */
Kojto 111:4336505e4b1c 340 uint16_t :2; /*!< bit: 10..11 Reserved */
Kojto 111:4336505e4b1c 341 uint16_t TXUR0:1; /*!< bit: 12 Transmit Underrun 0 */
Kojto 111:4336505e4b1c 342 uint16_t TXUR1:1; /*!< bit: 13 Transmit Underrun 1 */
Kojto 111:4336505e4b1c 343 uint16_t :2; /*!< bit: 14..15 Reserved */
Kojto 111:4336505e4b1c 344 } bit; /*!< Structure used for bit access */
Kojto 111:4336505e4b1c 345 struct {
Kojto 111:4336505e4b1c 346 uint16_t RXRDY:2; /*!< bit: 0.. 1 Receive Ready x */
Kojto 111:4336505e4b1c 347 uint16_t :2; /*!< bit: 2.. 3 Reserved */
Kojto 111:4336505e4b1c 348 uint16_t RXOR:2; /*!< bit: 4.. 5 Receive Overrun x */
Kojto 111:4336505e4b1c 349 uint16_t :2; /*!< bit: 6.. 7 Reserved */
Kojto 111:4336505e4b1c 350 uint16_t TXRDY:2; /*!< bit: 8.. 9 Transmit Ready x */
Kojto 111:4336505e4b1c 351 uint16_t :2; /*!< bit: 10..11 Reserved */
Kojto 111:4336505e4b1c 352 uint16_t TXUR:2; /*!< bit: 12..13 Transmit Underrun x */
Kojto 111:4336505e4b1c 353 uint16_t :2; /*!< bit: 14..15 Reserved */
Kojto 111:4336505e4b1c 354 } vec; /*!< Structure used for vec access */
Kojto 111:4336505e4b1c 355 uint16_t reg; /*!< Type used for register access */
Kojto 111:4336505e4b1c 356 } I2S_INTFLAG_Type;
Kojto 111:4336505e4b1c 357 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
Kojto 111:4336505e4b1c 358
Kojto 111:4336505e4b1c 359 #define I2S_INTFLAG_OFFSET 0x14 /**< \brief (I2S_INTFLAG offset) Interrupt Flag Status and Clear */
Kojto 111:4336505e4b1c 360 #define I2S_INTFLAG_RESETVALUE 0x0000ul /**< \brief (I2S_INTFLAG reset_value) Interrupt Flag Status and Clear */
Kojto 111:4336505e4b1c 361
Kojto 111:4336505e4b1c 362 #define I2S_INTFLAG_RXRDY0_Pos 0 /**< \brief (I2S_INTFLAG) Receive Ready 0 */
Kojto 111:4336505e4b1c 363 #define I2S_INTFLAG_RXRDY0 (1 << I2S_INTFLAG_RXRDY0_Pos)
Kojto 111:4336505e4b1c 364 #define I2S_INTFLAG_RXRDY1_Pos 1 /**< \brief (I2S_INTFLAG) Receive Ready 1 */
Kojto 111:4336505e4b1c 365 #define I2S_INTFLAG_RXRDY1 (1 << I2S_INTFLAG_RXRDY1_Pos)
Kojto 111:4336505e4b1c 366 #define I2S_INTFLAG_RXRDY_Pos 0 /**< \brief (I2S_INTFLAG) Receive Ready x */
Kojto 111:4336505e4b1c 367 #define I2S_INTFLAG_RXRDY_Msk (0x3ul << I2S_INTFLAG_RXRDY_Pos)
Kojto 111:4336505e4b1c 368 #define I2S_INTFLAG_RXRDY(value) ((I2S_INTFLAG_RXRDY_Msk & ((value) << I2S_INTFLAG_RXRDY_Pos)))
Kojto 111:4336505e4b1c 369 #define I2S_INTFLAG_RXOR0_Pos 4 /**< \brief (I2S_INTFLAG) Receive Overrun 0 */
Kojto 111:4336505e4b1c 370 #define I2S_INTFLAG_RXOR0 (1 << I2S_INTFLAG_RXOR0_Pos)
Kojto 111:4336505e4b1c 371 #define I2S_INTFLAG_RXOR1_Pos 5 /**< \brief (I2S_INTFLAG) Receive Overrun 1 */
Kojto 111:4336505e4b1c 372 #define I2S_INTFLAG_RXOR1 (1 << I2S_INTFLAG_RXOR1_Pos)
Kojto 111:4336505e4b1c 373 #define I2S_INTFLAG_RXOR_Pos 4 /**< \brief (I2S_INTFLAG) Receive Overrun x */
Kojto 111:4336505e4b1c 374 #define I2S_INTFLAG_RXOR_Msk (0x3ul << I2S_INTFLAG_RXOR_Pos)
Kojto 111:4336505e4b1c 375 #define I2S_INTFLAG_RXOR(value) ((I2S_INTFLAG_RXOR_Msk & ((value) << I2S_INTFLAG_RXOR_Pos)))
Kojto 111:4336505e4b1c 376 #define I2S_INTFLAG_TXRDY0_Pos 8 /**< \brief (I2S_INTFLAG) Transmit Ready 0 */
Kojto 111:4336505e4b1c 377 #define I2S_INTFLAG_TXRDY0 (1 << I2S_INTFLAG_TXRDY0_Pos)
Kojto 111:4336505e4b1c 378 #define I2S_INTFLAG_TXRDY1_Pos 9 /**< \brief (I2S_INTFLAG) Transmit Ready 1 */
Kojto 111:4336505e4b1c 379 #define I2S_INTFLAG_TXRDY1 (1 << I2S_INTFLAG_TXRDY1_Pos)
Kojto 111:4336505e4b1c 380 #define I2S_INTFLAG_TXRDY_Pos 8 /**< \brief (I2S_INTFLAG) Transmit Ready x */
Kojto 111:4336505e4b1c 381 #define I2S_INTFLAG_TXRDY_Msk (0x3ul << I2S_INTFLAG_TXRDY_Pos)
Kojto 111:4336505e4b1c 382 #define I2S_INTFLAG_TXRDY(value) ((I2S_INTFLAG_TXRDY_Msk & ((value) << I2S_INTFLAG_TXRDY_Pos)))
Kojto 111:4336505e4b1c 383 #define I2S_INTFLAG_TXUR0_Pos 12 /**< \brief (I2S_INTFLAG) Transmit Underrun 0 */
Kojto 111:4336505e4b1c 384 #define I2S_INTFLAG_TXUR0 (1 << I2S_INTFLAG_TXUR0_Pos)
Kojto 111:4336505e4b1c 385 #define I2S_INTFLAG_TXUR1_Pos 13 /**< \brief (I2S_INTFLAG) Transmit Underrun 1 */
Kojto 111:4336505e4b1c 386 #define I2S_INTFLAG_TXUR1 (1 << I2S_INTFLAG_TXUR1_Pos)
Kojto 111:4336505e4b1c 387 #define I2S_INTFLAG_TXUR_Pos 12 /**< \brief (I2S_INTFLAG) Transmit Underrun x */
Kojto 111:4336505e4b1c 388 #define I2S_INTFLAG_TXUR_Msk (0x3ul << I2S_INTFLAG_TXUR_Pos)
Kojto 111:4336505e4b1c 389 #define I2S_INTFLAG_TXUR(value) ((I2S_INTFLAG_TXUR_Msk & ((value) << I2S_INTFLAG_TXUR_Pos)))
Kojto 111:4336505e4b1c 390 #define I2S_INTFLAG_MASK 0x3333ul /**< \brief (I2S_INTFLAG) MASK Register */
Kojto 111:4336505e4b1c 391
Kojto 111:4336505e4b1c 392 /* -------- I2S_SYNCBUSY : (I2S Offset: 0x18) (R/ 16) Synchronization Status -------- */
Kojto 111:4336505e4b1c 393 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
Kojto 111:4336505e4b1c 394 typedef union {
Kojto 111:4336505e4b1c 395 struct {
Kojto 111:4336505e4b1c 396 uint16_t SWRST:1; /*!< bit: 0 Software Reset Synchronization Status */
Kojto 111:4336505e4b1c 397 uint16_t ENABLE:1; /*!< bit: 1 Enable Synchronization Status */
Kojto 111:4336505e4b1c 398 uint16_t CKEN0:1; /*!< bit: 2 Clock Unit 0 Enable Synchronization Status */
Kojto 111:4336505e4b1c 399 uint16_t CKEN1:1; /*!< bit: 3 Clock Unit 1 Enable Synchronization Status */
Kojto 111:4336505e4b1c 400 uint16_t SEREN0:1; /*!< bit: 4 Serializer 0 Enable Synchronization Status */
Kojto 111:4336505e4b1c 401 uint16_t SEREN1:1; /*!< bit: 5 Serializer 1 Enable Synchronization Status */
Kojto 111:4336505e4b1c 402 uint16_t :2; /*!< bit: 6.. 7 Reserved */
Kojto 111:4336505e4b1c 403 uint16_t DATA0:1; /*!< bit: 8 Data 0 Synchronization Status */
Kojto 111:4336505e4b1c 404 uint16_t DATA1:1; /*!< bit: 9 Data 1 Synchronization Status */
Kojto 111:4336505e4b1c 405 uint16_t :6; /*!< bit: 10..15 Reserved */
Kojto 111:4336505e4b1c 406 } bit; /*!< Structure used for bit access */
Kojto 111:4336505e4b1c 407 struct {
Kojto 111:4336505e4b1c 408 uint16_t :2; /*!< bit: 0.. 1 Reserved */
Kojto 111:4336505e4b1c 409 uint16_t CKEN:2; /*!< bit: 2.. 3 Clock Unit x Enable Synchronization Status */
Kojto 111:4336505e4b1c 410 uint16_t SEREN:2; /*!< bit: 4.. 5 Serializer x Enable Synchronization Status */
Kojto 111:4336505e4b1c 411 uint16_t :2; /*!< bit: 6.. 7 Reserved */
Kojto 111:4336505e4b1c 412 uint16_t DATA:2; /*!< bit: 8.. 9 Data x Synchronization Status */
Kojto 111:4336505e4b1c 413 uint16_t :6; /*!< bit: 10..15 Reserved */
Kojto 111:4336505e4b1c 414 } vec; /*!< Structure used for vec access */
Kojto 111:4336505e4b1c 415 uint16_t reg; /*!< Type used for register access */
Kojto 111:4336505e4b1c 416 } I2S_SYNCBUSY_Type;
Kojto 111:4336505e4b1c 417 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
Kojto 111:4336505e4b1c 418
Kojto 111:4336505e4b1c 419 #define I2S_SYNCBUSY_OFFSET 0x18 /**< \brief (I2S_SYNCBUSY offset) Synchronization Status */
Kojto 111:4336505e4b1c 420 #define I2S_SYNCBUSY_RESETVALUE 0x0000ul /**< \brief (I2S_SYNCBUSY reset_value) Synchronization Status */
Kojto 111:4336505e4b1c 421
Kojto 111:4336505e4b1c 422 #define I2S_SYNCBUSY_SWRST_Pos 0 /**< \brief (I2S_SYNCBUSY) Software Reset Synchronization Status */
Kojto 111:4336505e4b1c 423 #define I2S_SYNCBUSY_SWRST (0x1ul << I2S_SYNCBUSY_SWRST_Pos)
Kojto 111:4336505e4b1c 424 #define I2S_SYNCBUSY_ENABLE_Pos 1 /**< \brief (I2S_SYNCBUSY) Enable Synchronization Status */
Kojto 111:4336505e4b1c 425 #define I2S_SYNCBUSY_ENABLE (0x1ul << I2S_SYNCBUSY_ENABLE_Pos)
Kojto 111:4336505e4b1c 426 #define I2S_SYNCBUSY_CKEN0_Pos 2 /**< \brief (I2S_SYNCBUSY) Clock Unit 0 Enable Synchronization Status */
Kojto 111:4336505e4b1c 427 #define I2S_SYNCBUSY_CKEN0 (1 << I2S_SYNCBUSY_CKEN0_Pos)
Kojto 111:4336505e4b1c 428 #define I2S_SYNCBUSY_CKEN1_Pos 3 /**< \brief (I2S_SYNCBUSY) Clock Unit 1 Enable Synchronization Status */
Kojto 111:4336505e4b1c 429 #define I2S_SYNCBUSY_CKEN1 (1 << I2S_SYNCBUSY_CKEN1_Pos)
Kojto 111:4336505e4b1c 430 #define I2S_SYNCBUSY_CKEN_Pos 2 /**< \brief (I2S_SYNCBUSY) Clock Unit x Enable Synchronization Status */
Kojto 111:4336505e4b1c 431 #define I2S_SYNCBUSY_CKEN_Msk (0x3ul << I2S_SYNCBUSY_CKEN_Pos)
Kojto 111:4336505e4b1c 432 #define I2S_SYNCBUSY_CKEN(value) ((I2S_SYNCBUSY_CKEN_Msk & ((value) << I2S_SYNCBUSY_CKEN_Pos)))
Kojto 111:4336505e4b1c 433 #define I2S_SYNCBUSY_SEREN0_Pos 4 /**< \brief (I2S_SYNCBUSY) Serializer 0 Enable Synchronization Status */
Kojto 111:4336505e4b1c 434 #define I2S_SYNCBUSY_SEREN0 (1 << I2S_SYNCBUSY_SEREN0_Pos)
Kojto 111:4336505e4b1c 435 #define I2S_SYNCBUSY_SEREN1_Pos 5 /**< \brief (I2S_SYNCBUSY) Serializer 1 Enable Synchronization Status */
Kojto 111:4336505e4b1c 436 #define I2S_SYNCBUSY_SEREN1 (1 << I2S_SYNCBUSY_SEREN1_Pos)
Kojto 111:4336505e4b1c 437 #define I2S_SYNCBUSY_SEREN_Pos 4 /**< \brief (I2S_SYNCBUSY) Serializer x Enable Synchronization Status */
Kojto 111:4336505e4b1c 438 #define I2S_SYNCBUSY_SEREN_Msk (0x3ul << I2S_SYNCBUSY_SEREN_Pos)
Kojto 111:4336505e4b1c 439 #define I2S_SYNCBUSY_SEREN(value) ((I2S_SYNCBUSY_SEREN_Msk & ((value) << I2S_SYNCBUSY_SEREN_Pos)))
Kojto 111:4336505e4b1c 440 #define I2S_SYNCBUSY_DATA0_Pos 8 /**< \brief (I2S_SYNCBUSY) Data 0 Synchronization Status */
Kojto 111:4336505e4b1c 441 #define I2S_SYNCBUSY_DATA0 (1 << I2S_SYNCBUSY_DATA0_Pos)
Kojto 111:4336505e4b1c 442 #define I2S_SYNCBUSY_DATA1_Pos 9 /**< \brief (I2S_SYNCBUSY) Data 1 Synchronization Status */
Kojto 111:4336505e4b1c 443 #define I2S_SYNCBUSY_DATA1 (1 << I2S_SYNCBUSY_DATA1_Pos)
Kojto 111:4336505e4b1c 444 #define I2S_SYNCBUSY_DATA_Pos 8 /**< \brief (I2S_SYNCBUSY) Data x Synchronization Status */
Kojto 111:4336505e4b1c 445 #define I2S_SYNCBUSY_DATA_Msk (0x3ul << I2S_SYNCBUSY_DATA_Pos)
Kojto 111:4336505e4b1c 446 #define I2S_SYNCBUSY_DATA(value) ((I2S_SYNCBUSY_DATA_Msk & ((value) << I2S_SYNCBUSY_DATA_Pos)))
Kojto 111:4336505e4b1c 447 #define I2S_SYNCBUSY_MASK 0x033Ful /**< \brief (I2S_SYNCBUSY) MASK Register */
Kojto 111:4336505e4b1c 448
Kojto 111:4336505e4b1c 449 /* -------- I2S_SERCTRL : (I2S Offset: 0x20) (R/W 32) Serializer n Control -------- */
Kojto 111:4336505e4b1c 450 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
Kojto 111:4336505e4b1c 451 typedef union {
Kojto 111:4336505e4b1c 452 struct {
Kojto 111:4336505e4b1c 453 uint32_t SERMODE:2; /*!< bit: 0.. 1 Serializer Mode */
Kojto 111:4336505e4b1c 454 uint32_t TXDEFAULT:2; /*!< bit: 2.. 3 Line Default Line when Slot Disabled */
Kojto 111:4336505e4b1c 455 uint32_t TXSAME:1; /*!< bit: 4 Transmit Data when Underrun */
Kojto 111:4336505e4b1c 456 uint32_t CLKSEL:1; /*!< bit: 5 Clock Unit Selection */
Kojto 111:4336505e4b1c 457 uint32_t :1; /*!< bit: 6 Reserved */
Kojto 111:4336505e4b1c 458 uint32_t SLOTADJ:1; /*!< bit: 7 Data Slot Formatting Adjust */
Kojto 111:4336505e4b1c 459 uint32_t DATASIZE:3; /*!< bit: 8..10 Data Word Size */
Kojto 111:4336505e4b1c 460 uint32_t :1; /*!< bit: 11 Reserved */
Kojto 111:4336505e4b1c 461 uint32_t WORDADJ:1; /*!< bit: 12 Data Word Formatting Adjust */
Kojto 111:4336505e4b1c 462 uint32_t EXTEND:2; /*!< bit: 13..14 Data Formatting Bit Extension */
Kojto 111:4336505e4b1c 463 uint32_t BITREV:1; /*!< bit: 15 Data Formatting Bit Reverse */
Kojto 111:4336505e4b1c 464 uint32_t SLOTDIS0:1; /*!< bit: 16 Slot 0 Disabled for this Serializer */
Kojto 111:4336505e4b1c 465 uint32_t SLOTDIS1:1; /*!< bit: 17 Slot 1 Disabled for this Serializer */
Kojto 111:4336505e4b1c 466 uint32_t SLOTDIS2:1; /*!< bit: 18 Slot 2 Disabled for this Serializer */
Kojto 111:4336505e4b1c 467 uint32_t SLOTDIS3:1; /*!< bit: 19 Slot 3 Disabled for this Serializer */
Kojto 111:4336505e4b1c 468 uint32_t SLOTDIS4:1; /*!< bit: 20 Slot 4 Disabled for this Serializer */
Kojto 111:4336505e4b1c 469 uint32_t SLOTDIS5:1; /*!< bit: 21 Slot 5 Disabled for this Serializer */
Kojto 111:4336505e4b1c 470 uint32_t SLOTDIS6:1; /*!< bit: 22 Slot 6 Disabled for this Serializer */
Kojto 111:4336505e4b1c 471 uint32_t SLOTDIS7:1; /*!< bit: 23 Slot 7 Disabled for this Serializer */
Kojto 111:4336505e4b1c 472 uint32_t MONO:1; /*!< bit: 24 Mono Mode */
Kojto 111:4336505e4b1c 473 uint32_t DMA:1; /*!< bit: 25 Single or Multiple DMA Channels */
Kojto 111:4336505e4b1c 474 uint32_t RXLOOP:1; /*!< bit: 26 Loop-back Test Mode */
Kojto 111:4336505e4b1c 475 uint32_t :5; /*!< bit: 27..31 Reserved */
Kojto 111:4336505e4b1c 476 } bit; /*!< Structure used for bit access */
Kojto 111:4336505e4b1c 477 struct {
Kojto 111:4336505e4b1c 478 uint32_t :16; /*!< bit: 0..15 Reserved */
Kojto 111:4336505e4b1c 479 uint32_t SLOTDIS:8; /*!< bit: 16..23 Slot x Disabled for this Serializer */
Kojto 111:4336505e4b1c 480 uint32_t :8; /*!< bit: 24..31 Reserved */
Kojto 111:4336505e4b1c 481 } vec; /*!< Structure used for vec access */
Kojto 111:4336505e4b1c 482 uint32_t reg; /*!< Type used for register access */
Kojto 111:4336505e4b1c 483 } I2S_SERCTRL_Type;
Kojto 111:4336505e4b1c 484 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
Kojto 111:4336505e4b1c 485
Kojto 111:4336505e4b1c 486 #define I2S_SERCTRL_OFFSET 0x20 /**< \brief (I2S_SERCTRL offset) Serializer n Control */
Kojto 111:4336505e4b1c 487 #define I2S_SERCTRL_RESETVALUE 0x00000000ul /**< \brief (I2S_SERCTRL reset_value) Serializer n Control */
Kojto 111:4336505e4b1c 488
Kojto 111:4336505e4b1c 489 #define I2S_SERCTRL_SERMODE_Pos 0 /**< \brief (I2S_SERCTRL) Serializer Mode */
Kojto 111:4336505e4b1c 490 #define I2S_SERCTRL_SERMODE_Msk (0x3ul << I2S_SERCTRL_SERMODE_Pos)
Kojto 111:4336505e4b1c 491 #define I2S_SERCTRL_SERMODE(value) ((I2S_SERCTRL_SERMODE_Msk & ((value) << I2S_SERCTRL_SERMODE_Pos)))
Kojto 111:4336505e4b1c 492 #define I2S_SERCTRL_SERMODE_RX_Val 0x0ul /**< \brief (I2S_SERCTRL) Receive */
Kojto 111:4336505e4b1c 493 #define I2S_SERCTRL_SERMODE_TX_Val 0x1ul /**< \brief (I2S_SERCTRL) Transmit */
Kojto 111:4336505e4b1c 494 #define I2S_SERCTRL_SERMODE_PDM2_Val 0x2ul /**< \brief (I2S_SERCTRL) Receive one PDM data on each serial clock edge */
Kojto 111:4336505e4b1c 495 #define I2S_SERCTRL_SERMODE_RX (I2S_SERCTRL_SERMODE_RX_Val << I2S_SERCTRL_SERMODE_Pos)
Kojto 111:4336505e4b1c 496 #define I2S_SERCTRL_SERMODE_TX (I2S_SERCTRL_SERMODE_TX_Val << I2S_SERCTRL_SERMODE_Pos)
Kojto 111:4336505e4b1c 497 #define I2S_SERCTRL_SERMODE_PDM2 (I2S_SERCTRL_SERMODE_PDM2_Val << I2S_SERCTRL_SERMODE_Pos)
Kojto 111:4336505e4b1c 498 #define I2S_SERCTRL_TXDEFAULT_Pos 2 /**< \brief (I2S_SERCTRL) Line Default Line when Slot Disabled */
Kojto 111:4336505e4b1c 499 #define I2S_SERCTRL_TXDEFAULT_Msk (0x3ul << I2S_SERCTRL_TXDEFAULT_Pos)
Kojto 111:4336505e4b1c 500 #define I2S_SERCTRL_TXDEFAULT(value) ((I2S_SERCTRL_TXDEFAULT_Msk & ((value) << I2S_SERCTRL_TXDEFAULT_Pos)))
Kojto 111:4336505e4b1c 501 #define I2S_SERCTRL_TXDEFAULT_ZERO_Val 0x0ul /**< \brief (I2S_SERCTRL) Output Default Value is 0 */
Kojto 111:4336505e4b1c 502 #define I2S_SERCTRL_TXDEFAULT_ONE_Val 0x1ul /**< \brief (I2S_SERCTRL) Output Default Value is 1 */
Kojto 111:4336505e4b1c 503 #define I2S_SERCTRL_TXDEFAULT_HIZ_Val 0x3ul /**< \brief (I2S_SERCTRL) Output Default Value is high impedance */
Kojto 111:4336505e4b1c 504 #define I2S_SERCTRL_TXDEFAULT_ZERO (I2S_SERCTRL_TXDEFAULT_ZERO_Val << I2S_SERCTRL_TXDEFAULT_Pos)
Kojto 111:4336505e4b1c 505 #define I2S_SERCTRL_TXDEFAULT_ONE (I2S_SERCTRL_TXDEFAULT_ONE_Val << I2S_SERCTRL_TXDEFAULT_Pos)
Kojto 111:4336505e4b1c 506 #define I2S_SERCTRL_TXDEFAULT_HIZ (I2S_SERCTRL_TXDEFAULT_HIZ_Val << I2S_SERCTRL_TXDEFAULT_Pos)
Kojto 111:4336505e4b1c 507 #define I2S_SERCTRL_TXSAME_Pos 4 /**< \brief (I2S_SERCTRL) Transmit Data when Underrun */
Kojto 111:4336505e4b1c 508 #define I2S_SERCTRL_TXSAME (0x1ul << I2S_SERCTRL_TXSAME_Pos)
Kojto 111:4336505e4b1c 509 #define I2S_SERCTRL_TXSAME_ZERO_Val 0x0ul /**< \brief (I2S_SERCTRL) Zero data transmitted in case of underrun */
Kojto 111:4336505e4b1c 510 #define I2S_SERCTRL_TXSAME_SAME_Val 0x1ul /**< \brief (I2S_SERCTRL) Last data transmitted in case of underrun */
Kojto 111:4336505e4b1c 511 #define I2S_SERCTRL_TXSAME_ZERO (I2S_SERCTRL_TXSAME_ZERO_Val << I2S_SERCTRL_TXSAME_Pos)
Kojto 111:4336505e4b1c 512 #define I2S_SERCTRL_TXSAME_SAME (I2S_SERCTRL_TXSAME_SAME_Val << I2S_SERCTRL_TXSAME_Pos)
Kojto 111:4336505e4b1c 513 #define I2S_SERCTRL_CLKSEL_Pos 5 /**< \brief (I2S_SERCTRL) Clock Unit Selection */
Kojto 111:4336505e4b1c 514 #define I2S_SERCTRL_CLKSEL (0x1ul << I2S_SERCTRL_CLKSEL_Pos)
Kojto 111:4336505e4b1c 515 #define I2S_SERCTRL_CLKSEL_CLK0_Val 0x0ul /**< \brief (I2S_SERCTRL) Use Clock Unit 0 */
Kojto 111:4336505e4b1c 516 #define I2S_SERCTRL_CLKSEL_CLK1_Val 0x1ul /**< \brief (I2S_SERCTRL) Use Clock Unit 1 */
Kojto 111:4336505e4b1c 517 #define I2S_SERCTRL_CLKSEL_CLK0 (I2S_SERCTRL_CLKSEL_CLK0_Val << I2S_SERCTRL_CLKSEL_Pos)
Kojto 111:4336505e4b1c 518 #define I2S_SERCTRL_CLKSEL_CLK1 (I2S_SERCTRL_CLKSEL_CLK1_Val << I2S_SERCTRL_CLKSEL_Pos)
Kojto 111:4336505e4b1c 519 #define I2S_SERCTRL_SLOTADJ_Pos 7 /**< \brief (I2S_SERCTRL) Data Slot Formatting Adjust */
Kojto 111:4336505e4b1c 520 #define I2S_SERCTRL_SLOTADJ (0x1ul << I2S_SERCTRL_SLOTADJ_Pos)
Kojto 111:4336505e4b1c 521 #define I2S_SERCTRL_SLOTADJ_RIGHT_Val 0x0ul /**< \brief (I2S_SERCTRL) Data is right adjusted in slot */
Kojto 111:4336505e4b1c 522 #define I2S_SERCTRL_SLOTADJ_LEFT_Val 0x1ul /**< \brief (I2S_SERCTRL) Data is left adjusted in slot */
Kojto 111:4336505e4b1c 523 #define I2S_SERCTRL_SLOTADJ_RIGHT (I2S_SERCTRL_SLOTADJ_RIGHT_Val << I2S_SERCTRL_SLOTADJ_Pos)
Kojto 111:4336505e4b1c 524 #define I2S_SERCTRL_SLOTADJ_LEFT (I2S_SERCTRL_SLOTADJ_LEFT_Val << I2S_SERCTRL_SLOTADJ_Pos)
Kojto 111:4336505e4b1c 525 #define I2S_SERCTRL_DATASIZE_Pos 8 /**< \brief (I2S_SERCTRL) Data Word Size */
Kojto 111:4336505e4b1c 526 #define I2S_SERCTRL_DATASIZE_Msk (0x7ul << I2S_SERCTRL_DATASIZE_Pos)
Kojto 111:4336505e4b1c 527 #define I2S_SERCTRL_DATASIZE(value) ((I2S_SERCTRL_DATASIZE_Msk & ((value) << I2S_SERCTRL_DATASIZE_Pos)))
Kojto 111:4336505e4b1c 528 #define I2S_SERCTRL_DATASIZE_32_Val 0x0ul /**< \brief (I2S_SERCTRL) 32 bits */
Kojto 111:4336505e4b1c 529 #define I2S_SERCTRL_DATASIZE_24_Val 0x1ul /**< \brief (I2S_SERCTRL) 24 bits */
Kojto 111:4336505e4b1c 530 #define I2S_SERCTRL_DATASIZE_20_Val 0x2ul /**< \brief (I2S_SERCTRL) 20 bits */
Kojto 111:4336505e4b1c 531 #define I2S_SERCTRL_DATASIZE_18_Val 0x3ul /**< \brief (I2S_SERCTRL) 18 bits */
Kojto 111:4336505e4b1c 532 #define I2S_SERCTRL_DATASIZE_16_Val 0x4ul /**< \brief (I2S_SERCTRL) 16 bits */
Kojto 111:4336505e4b1c 533 #define I2S_SERCTRL_DATASIZE_16C_Val 0x5ul /**< \brief (I2S_SERCTRL) 16 bits compact stereo */
Kojto 111:4336505e4b1c 534 #define I2S_SERCTRL_DATASIZE_8_Val 0x6ul /**< \brief (I2S_SERCTRL) 8 bits */
Kojto 111:4336505e4b1c 535 #define I2S_SERCTRL_DATASIZE_8C_Val 0x7ul /**< \brief (I2S_SERCTRL) 8 bits compact stereo */
Kojto 111:4336505e4b1c 536 #define I2S_SERCTRL_DATASIZE_32 (I2S_SERCTRL_DATASIZE_32_Val << I2S_SERCTRL_DATASIZE_Pos)
Kojto 111:4336505e4b1c 537 #define I2S_SERCTRL_DATASIZE_24 (I2S_SERCTRL_DATASIZE_24_Val << I2S_SERCTRL_DATASIZE_Pos)
Kojto 111:4336505e4b1c 538 #define I2S_SERCTRL_DATASIZE_20 (I2S_SERCTRL_DATASIZE_20_Val << I2S_SERCTRL_DATASIZE_Pos)
Kojto 111:4336505e4b1c 539 #define I2S_SERCTRL_DATASIZE_18 (I2S_SERCTRL_DATASIZE_18_Val << I2S_SERCTRL_DATASIZE_Pos)
Kojto 111:4336505e4b1c 540 #define I2S_SERCTRL_DATASIZE_16 (I2S_SERCTRL_DATASIZE_16_Val << I2S_SERCTRL_DATASIZE_Pos)
Kojto 111:4336505e4b1c 541 #define I2S_SERCTRL_DATASIZE_16C (I2S_SERCTRL_DATASIZE_16C_Val << I2S_SERCTRL_DATASIZE_Pos)
Kojto 111:4336505e4b1c 542 #define I2S_SERCTRL_DATASIZE_8 (I2S_SERCTRL_DATASIZE_8_Val << I2S_SERCTRL_DATASIZE_Pos)
Kojto 111:4336505e4b1c 543 #define I2S_SERCTRL_DATASIZE_8C (I2S_SERCTRL_DATASIZE_8C_Val << I2S_SERCTRL_DATASIZE_Pos)
Kojto 111:4336505e4b1c 544 #define I2S_SERCTRL_WORDADJ_Pos 12 /**< \brief (I2S_SERCTRL) Data Word Formatting Adjust */
Kojto 111:4336505e4b1c 545 #define I2S_SERCTRL_WORDADJ (0x1ul << I2S_SERCTRL_WORDADJ_Pos)
Kojto 111:4336505e4b1c 546 #define I2S_SERCTRL_WORDADJ_RIGHT_Val 0x0ul /**< \brief (I2S_SERCTRL) Data is right adjusted in word */
Kojto 111:4336505e4b1c 547 #define I2S_SERCTRL_WORDADJ_LEFT_Val 0x1ul /**< \brief (I2S_SERCTRL) Data is left adjusted in word */
Kojto 111:4336505e4b1c 548 #define I2S_SERCTRL_WORDADJ_RIGHT (I2S_SERCTRL_WORDADJ_RIGHT_Val << I2S_SERCTRL_WORDADJ_Pos)
Kojto 111:4336505e4b1c 549 #define I2S_SERCTRL_WORDADJ_LEFT (I2S_SERCTRL_WORDADJ_LEFT_Val << I2S_SERCTRL_WORDADJ_Pos)
Kojto 111:4336505e4b1c 550 #define I2S_SERCTRL_EXTEND_Pos 13 /**< \brief (I2S_SERCTRL) Data Formatting Bit Extension */
Kojto 111:4336505e4b1c 551 #define I2S_SERCTRL_EXTEND_Msk (0x3ul << I2S_SERCTRL_EXTEND_Pos)
Kojto 111:4336505e4b1c 552 #define I2S_SERCTRL_EXTEND(value) ((I2S_SERCTRL_EXTEND_Msk & ((value) << I2S_SERCTRL_EXTEND_Pos)))
Kojto 111:4336505e4b1c 553 #define I2S_SERCTRL_EXTEND_ZERO_Val 0x0ul /**< \brief (I2S_SERCTRL) Extend with zeroes */
Kojto 111:4336505e4b1c 554 #define I2S_SERCTRL_EXTEND_ONE_Val 0x1ul /**< \brief (I2S_SERCTRL) Extend with ones */
Kojto 111:4336505e4b1c 555 #define I2S_SERCTRL_EXTEND_MSBIT_Val 0x2ul /**< \brief (I2S_SERCTRL) Extend with Most Significant Bit */
Kojto 111:4336505e4b1c 556 #define I2S_SERCTRL_EXTEND_LSBIT_Val 0x3ul /**< \brief (I2S_SERCTRL) Extend with Least Significant Bit */
Kojto 111:4336505e4b1c 557 #define I2S_SERCTRL_EXTEND_ZERO (I2S_SERCTRL_EXTEND_ZERO_Val << I2S_SERCTRL_EXTEND_Pos)
Kojto 111:4336505e4b1c 558 #define I2S_SERCTRL_EXTEND_ONE (I2S_SERCTRL_EXTEND_ONE_Val << I2S_SERCTRL_EXTEND_Pos)
Kojto 111:4336505e4b1c 559 #define I2S_SERCTRL_EXTEND_MSBIT (I2S_SERCTRL_EXTEND_MSBIT_Val << I2S_SERCTRL_EXTEND_Pos)
Kojto 111:4336505e4b1c 560 #define I2S_SERCTRL_EXTEND_LSBIT (I2S_SERCTRL_EXTEND_LSBIT_Val << I2S_SERCTRL_EXTEND_Pos)
Kojto 111:4336505e4b1c 561 #define I2S_SERCTRL_BITREV_Pos 15 /**< \brief (I2S_SERCTRL) Data Formatting Bit Reverse */
Kojto 111:4336505e4b1c 562 #define I2S_SERCTRL_BITREV (0x1ul << I2S_SERCTRL_BITREV_Pos)
Kojto 111:4336505e4b1c 563 #define I2S_SERCTRL_BITREV_MSBIT_Val 0x0ul /**< \brief (I2S_SERCTRL) Transfer Data Most Significant Bit (MSB) first (default for I2S protocol) */
Kojto 111:4336505e4b1c 564 #define I2S_SERCTRL_BITREV_LSBIT_Val 0x1ul /**< \brief (I2S_SERCTRL) Transfer Data Least Significant Bit (LSB) first */
Kojto 111:4336505e4b1c 565 #define I2S_SERCTRL_BITREV_MSBIT (I2S_SERCTRL_BITREV_MSBIT_Val << I2S_SERCTRL_BITREV_Pos)
Kojto 111:4336505e4b1c 566 #define I2S_SERCTRL_BITREV_LSBIT (I2S_SERCTRL_BITREV_LSBIT_Val << I2S_SERCTRL_BITREV_Pos)
Kojto 111:4336505e4b1c 567 #define I2S_SERCTRL_SLOTDIS0_Pos 16 /**< \brief (I2S_SERCTRL) Slot 0 Disabled for this Serializer */
Kojto 111:4336505e4b1c 568 #define I2S_SERCTRL_SLOTDIS0 (1 << I2S_SERCTRL_SLOTDIS0_Pos)
Kojto 111:4336505e4b1c 569 #define I2S_SERCTRL_SLOTDIS1_Pos 17 /**< \brief (I2S_SERCTRL) Slot 1 Disabled for this Serializer */
Kojto 111:4336505e4b1c 570 #define I2S_SERCTRL_SLOTDIS1 (1 << I2S_SERCTRL_SLOTDIS1_Pos)
Kojto 111:4336505e4b1c 571 #define I2S_SERCTRL_SLOTDIS2_Pos 18 /**< \brief (I2S_SERCTRL) Slot 2 Disabled for this Serializer */
Kojto 111:4336505e4b1c 572 #define I2S_SERCTRL_SLOTDIS2 (1 << I2S_SERCTRL_SLOTDIS2_Pos)
Kojto 111:4336505e4b1c 573 #define I2S_SERCTRL_SLOTDIS3_Pos 19 /**< \brief (I2S_SERCTRL) Slot 3 Disabled for this Serializer */
Kojto 111:4336505e4b1c 574 #define I2S_SERCTRL_SLOTDIS3 (1 << I2S_SERCTRL_SLOTDIS3_Pos)
Kojto 111:4336505e4b1c 575 #define I2S_SERCTRL_SLOTDIS4_Pos 20 /**< \brief (I2S_SERCTRL) Slot 4 Disabled for this Serializer */
Kojto 111:4336505e4b1c 576 #define I2S_SERCTRL_SLOTDIS4 (1 << I2S_SERCTRL_SLOTDIS4_Pos)
Kojto 111:4336505e4b1c 577 #define I2S_SERCTRL_SLOTDIS5_Pos 21 /**< \brief (I2S_SERCTRL) Slot 5 Disabled for this Serializer */
Kojto 111:4336505e4b1c 578 #define I2S_SERCTRL_SLOTDIS5 (1 << I2S_SERCTRL_SLOTDIS5_Pos)
Kojto 111:4336505e4b1c 579 #define I2S_SERCTRL_SLOTDIS6_Pos 22 /**< \brief (I2S_SERCTRL) Slot 6 Disabled for this Serializer */
Kojto 111:4336505e4b1c 580 #define I2S_SERCTRL_SLOTDIS6 (1 << I2S_SERCTRL_SLOTDIS6_Pos)
Kojto 111:4336505e4b1c 581 #define I2S_SERCTRL_SLOTDIS7_Pos 23 /**< \brief (I2S_SERCTRL) Slot 7 Disabled for this Serializer */
Kojto 111:4336505e4b1c 582 #define I2S_SERCTRL_SLOTDIS7 (1 << I2S_SERCTRL_SLOTDIS7_Pos)
Kojto 111:4336505e4b1c 583 #define I2S_SERCTRL_SLOTDIS_Pos 16 /**< \brief (I2S_SERCTRL) Slot x Disabled for this Serializer */
Kojto 111:4336505e4b1c 584 #define I2S_SERCTRL_SLOTDIS_Msk (0xFFul << I2S_SERCTRL_SLOTDIS_Pos)
Kojto 111:4336505e4b1c 585 #define I2S_SERCTRL_SLOTDIS(value) ((I2S_SERCTRL_SLOTDIS_Msk & ((value) << I2S_SERCTRL_SLOTDIS_Pos)))
Kojto 111:4336505e4b1c 586 #define I2S_SERCTRL_MONO_Pos 24 /**< \brief (I2S_SERCTRL) Mono Mode */
Kojto 111:4336505e4b1c 587 #define I2S_SERCTRL_MONO (0x1ul << I2S_SERCTRL_MONO_Pos)
Kojto 111:4336505e4b1c 588 #define I2S_SERCTRL_MONO_STEREO_Val 0x0ul /**< \brief (I2S_SERCTRL) Normal mode */
Kojto 111:4336505e4b1c 589 #define I2S_SERCTRL_MONO_MONO_Val 0x1ul /**< \brief (I2S_SERCTRL) Left channel data is duplicated to right channel */
Kojto 111:4336505e4b1c 590 #define I2S_SERCTRL_MONO_STEREO (I2S_SERCTRL_MONO_STEREO_Val << I2S_SERCTRL_MONO_Pos)
Kojto 111:4336505e4b1c 591 #define I2S_SERCTRL_MONO_MONO (I2S_SERCTRL_MONO_MONO_Val << I2S_SERCTRL_MONO_Pos)
Kojto 111:4336505e4b1c 592 #define I2S_SERCTRL_DMA_Pos 25 /**< \brief (I2S_SERCTRL) Single or Multiple DMA Channels */
Kojto 111:4336505e4b1c 593 #define I2S_SERCTRL_DMA (0x1ul << I2S_SERCTRL_DMA_Pos)
Kojto 111:4336505e4b1c 594 #define I2S_SERCTRL_DMA_SINGLE_Val 0x0ul /**< \brief (I2S_SERCTRL) Single DMA channel */
Kojto 111:4336505e4b1c 595 #define I2S_SERCTRL_DMA_MULTIPLE_Val 0x1ul /**< \brief (I2S_SERCTRL) One DMA channel per data channel */
Kojto 111:4336505e4b1c 596 #define I2S_SERCTRL_DMA_SINGLE (I2S_SERCTRL_DMA_SINGLE_Val << I2S_SERCTRL_DMA_Pos)
Kojto 111:4336505e4b1c 597 #define I2S_SERCTRL_DMA_MULTIPLE (I2S_SERCTRL_DMA_MULTIPLE_Val << I2S_SERCTRL_DMA_Pos)
Kojto 111:4336505e4b1c 598 #define I2S_SERCTRL_RXLOOP_Pos 26 /**< \brief (I2S_SERCTRL) Loop-back Test Mode */
Kojto 111:4336505e4b1c 599 #define I2S_SERCTRL_RXLOOP (0x1ul << I2S_SERCTRL_RXLOOP_Pos)
Kojto 111:4336505e4b1c 600 #define I2S_SERCTRL_MASK 0x07FFF7BFul /**< \brief (I2S_SERCTRL) MASK Register */
Kojto 111:4336505e4b1c 601
Kojto 111:4336505e4b1c 602 /* -------- I2S_DATA : (I2S Offset: 0x30) (R/W 32) Data n -------- */
Kojto 111:4336505e4b1c 603 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
Kojto 111:4336505e4b1c 604 typedef union {
Kojto 111:4336505e4b1c 605 struct {
Kojto 111:4336505e4b1c 606 uint32_t DATA:32; /*!< bit: 0..31 Sample Data */
Kojto 111:4336505e4b1c 607 } bit; /*!< Structure used for bit access */
Kojto 111:4336505e4b1c 608 uint32_t reg; /*!< Type used for register access */
Kojto 111:4336505e4b1c 609 } I2S_DATA_Type;
Kojto 111:4336505e4b1c 610 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
Kojto 111:4336505e4b1c 611
Kojto 111:4336505e4b1c 612 #define I2S_DATA_OFFSET 0x30 /**< \brief (I2S_DATA offset) Data n */
Kojto 111:4336505e4b1c 613 #define I2S_DATA_RESETVALUE 0x00000000ul /**< \brief (I2S_DATA reset_value) Data n */
Kojto 111:4336505e4b1c 614
Kojto 111:4336505e4b1c 615 #define I2S_DATA_DATA_Pos 0 /**< \brief (I2S_DATA) Sample Data */
Kojto 111:4336505e4b1c 616 #define I2S_DATA_DATA_Msk (0xFFFFFFFFul << I2S_DATA_DATA_Pos)
Kojto 111:4336505e4b1c 617 #define I2S_DATA_DATA(value) ((I2S_DATA_DATA_Msk & ((value) << I2S_DATA_DATA_Pos)))
Kojto 111:4336505e4b1c 618 #define I2S_DATA_MASK 0xFFFFFFFFul /**< \brief (I2S_DATA) MASK Register */
Kojto 111:4336505e4b1c 619
Kojto 111:4336505e4b1c 620 /** \brief I2S hardware registers */
Kojto 111:4336505e4b1c 621 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
Kojto 111:4336505e4b1c 622 typedef struct {
Kojto 111:4336505e4b1c 623 __IO I2S_CTRLA_Type CTRLA; /**< \brief Offset: 0x00 (R/W 8) Control A */
Kojto 111:4336505e4b1c 624 RoReg8 Reserved1[0x3];
Kojto 111:4336505e4b1c 625 __IO I2S_CLKCTRL_Type CLKCTRL[2]; /**< \brief Offset: 0x04 (R/W 32) Clock Unit n Control */
Kojto 111:4336505e4b1c 626 __IO I2S_INTENCLR_Type INTENCLR; /**< \brief Offset: 0x0C (R/W 16) Interrupt Enable Clear */
Kojto 111:4336505e4b1c 627 RoReg8 Reserved2[0x2];
Kojto 111:4336505e4b1c 628 __IO I2S_INTENSET_Type INTENSET; /**< \brief Offset: 0x10 (R/W 16) Interrupt Enable Set */
Kojto 111:4336505e4b1c 629 RoReg8 Reserved3[0x2];
Kojto 111:4336505e4b1c 630 __IO I2S_INTFLAG_Type INTFLAG; /**< \brief Offset: 0x14 (R/W 16) Interrupt Flag Status and Clear */
Kojto 111:4336505e4b1c 631 RoReg8 Reserved4[0x2];
Kojto 111:4336505e4b1c 632 __I I2S_SYNCBUSY_Type SYNCBUSY; /**< \brief Offset: 0x18 (R/ 16) Synchronization Status */
Kojto 111:4336505e4b1c 633 RoReg8 Reserved5[0x6];
Kojto 111:4336505e4b1c 634 __IO I2S_SERCTRL_Type SERCTRL[2]; /**< \brief Offset: 0x20 (R/W 32) Serializer n Control */
Kojto 111:4336505e4b1c 635 RoReg8 Reserved6[0x8];
Kojto 111:4336505e4b1c 636 __IO I2S_DATA_Type DATA[2]; /**< \brief Offset: 0x30 (R/W 32) Data n */
Kojto 111:4336505e4b1c 637 } I2s;
Kojto 111:4336505e4b1c 638 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
Kojto 111:4336505e4b1c 639
Kojto 111:4336505e4b1c 640 /*@}*/
Kojto 111:4336505e4b1c 641
Kojto 111:4336505e4b1c 642 #endif /* _SAMD21_I2S_COMPONENT_ */