1 //----------------------------------------------------------------------------- 2 // Copyright 2012 (c) Silicon Laboratories Inc. 3 // 4 // SPDX-License-Identifier: Zlib 5 // 6 // This siHAL software is provided 'as-is', without any express or implied 7 // warranty. In no event will the authors be held liable for any damages 8 // arising from the use of this software. 9 // 10 // Permission is granted to anyone to use this software for any purpose, 11 // including commercial applications, and to alter it and redistribute it 12 // freely, subject to the following restrictions: 13 // 14 // 1. The origin of this software must not be misrepresented; you must not 15 // claim that you wrote the original software. If you use this software 16 // in a product, an acknowledgment in the product documentation would be 17 // appreciated but is not required. 18 // 2. Altered source versions must be plainly marked as such, and must not be 19 // misrepresented as being the original software. 20 // 3. This notice may not be removed or altered from any source distribution. 21 //----------------------------------------------------------------------------- 22 // 23 // Script: 0.61 24 // Version: 1 25 26 #ifndef __SI32_I2C_A_REGISTERS_H__ 27 #define __SI32_I2C_A_REGISTERS_H__ 28 29 #include <stdint.h> 30 31 #ifdef __cplusplus 32 extern "C" { 33 #endif 34 35 struct SI32_I2C_A_CONTROL_Struct 36 { 37 union 38 { 39 struct 40 { 41 // Busy Flag 42 volatile uint32_t BUSYF: 1; 43 // Acknowledge 44 volatile uint32_t ACK: 1; 45 // Arbitration Lost Flag 46 volatile uint32_t ARBLF: 1; 47 // Acknowledge Request Flag 48 volatile uint32_t ACKRQF: 1; 49 // Stop 50 volatile uint32_t STO: 1; 51 // Start 52 volatile uint32_t STA: 1; 53 // Transmit Mode Flag 54 volatile uint32_t TXMDF: 1; 55 // Master/Slave Mode Flag 56 volatile uint32_t MSMDF: 1; 57 // Stop Interrupt Flag 58 volatile uint32_t STOI: 1; 59 // Acknowledge Interrupt Flag 60 volatile uint32_t ACKI: 1; 61 // Receive Done Interrupt Flag 62 volatile uint32_t RXI: 1; 63 // Transmit Done Interrupt Flag 64 volatile uint32_t TXI: 1; 65 // Start Interrupt Flag 66 volatile uint32_t STAI: 1; 67 // Arbitration Lost Interrupt Flag 68 volatile uint32_t ARBLI: 1; 69 // I2C Timer Byte 0 Interrupt Flag 70 volatile uint32_t T0I: 1; 71 // I2C Timer Byte 1 Interrupt Flag 72 volatile uint32_t T1I: 1; 73 // I2C Timer Byte 2 Interrupt Flag 74 volatile uint32_t T2I: 1; 75 // I2C Timer Byte 3 Interrupt Flag 76 volatile uint32_t T3I: 1; 77 // Receive Arm 78 volatile uint32_t RXARM: 1; 79 // Transmit Arm 80 volatile uint32_t TXARM: 1; 81 // Slave Address Type Flag 82 volatile uint32_t SLVAF: 1; 83 // Auto Transmit or Receive Enable 84 volatile uint32_t ATXRXEN: 1; 85 // Filter Mode 86 volatile uint32_t FMD: 1; 87 // I2C Debug Mode 88 volatile uint32_t DBGMD: 1; 89 // Slave Mode Inhibit 90 volatile uint32_t SMINH: 1; 91 // Auto Acknowledge Enable 92 volatile uint32_t HACKEN: 1; 93 uint32_t reserved0: 1; 94 // Last Byte Acknowledge Enable 95 volatile uint32_t LBACKEN: 1; 96 uint32_t reserved1: 1; 97 // General Call Address Enable 98 volatile uint32_t GCEN: 1; 99 // Module Soft Reset 100 volatile uint32_t RESET: 1; 101 // I2C Enable 102 volatile uint32_t I2CEN: 1; 103 }; 104 volatile uint32_t U32; 105 }; 106 }; 107 108 #define SI32_I2C_A_CONTROL_BUSYF_MASK 0x00000001 109 #define SI32_I2C_A_CONTROL_BUSYF_SHIFT 0 110 // A transaction is not currently taking place. 111 #define SI32_I2C_A_CONTROL_BUSYF_NOT_SET_VALUE 0 112 #define SI32_I2C_A_CONTROL_BUSYF_NOT_SET_U32 \ 113 (SI32_I2C_A_CONTROL_BUSYF_NOT_SET_VALUE << SI32_I2C_A_CONTROL_BUSYF_SHIFT) 114 // A transaction is currently taking place. 115 #define SI32_I2C_A_CONTROL_BUSYF_SET_VALUE 1 116 #define SI32_I2C_A_CONTROL_BUSYF_SET_U32 \ 117 (SI32_I2C_A_CONTROL_BUSYF_SET_VALUE << SI32_I2C_A_CONTROL_BUSYF_SHIFT) 118 119 #define SI32_I2C_A_CONTROL_ACK_MASK 0x00000002 120 #define SI32_I2C_A_CONTROL_ACK_SHIFT 1 121 // Read: ACK has not been received. Write: Do not send an ACK. 122 #define SI32_I2C_A_CONTROL_ACK_NOT_SET_VALUE 0 123 #define SI32_I2C_A_CONTROL_ACK_NOT_SET_U32 \ 124 (SI32_I2C_A_CONTROL_ACK_NOT_SET_VALUE << SI32_I2C_A_CONTROL_ACK_SHIFT) 125 // Read: ACK received. Write: Send an ACK. 126 #define SI32_I2C_A_CONTROL_ACK_SET_VALUE 1 127 #define SI32_I2C_A_CONTROL_ACK_SET_U32 \ 128 (SI32_I2C_A_CONTROL_ACK_SET_VALUE << SI32_I2C_A_CONTROL_ACK_SHIFT) 129 130 #define SI32_I2C_A_CONTROL_ARBLF_MASK 0x00000004 131 #define SI32_I2C_A_CONTROL_ARBLF_SHIFT 2 132 // Arbitration lost error has not occurred. 133 #define SI32_I2C_A_CONTROL_ARBLF_NOT_SET_VALUE 0 134 #define SI32_I2C_A_CONTROL_ARBLF_NOT_SET_U32 \ 135 (SI32_I2C_A_CONTROL_ARBLF_NOT_SET_VALUE << SI32_I2C_A_CONTROL_ARBLF_SHIFT) 136 // Arbitration lost error occurred. 137 #define SI32_I2C_A_CONTROL_ARBLF_SET_VALUE 1 138 #define SI32_I2C_A_CONTROL_ARBLF_SET_U32 \ 139 (SI32_I2C_A_CONTROL_ARBLF_SET_VALUE << SI32_I2C_A_CONTROL_ARBLF_SHIFT) 140 141 #define SI32_I2C_A_CONTROL_ACKRQF_MASK 0x00000008 142 #define SI32_I2C_A_CONTROL_ACKRQF_SHIFT 3 143 // ACK has not been requested. 144 #define SI32_I2C_A_CONTROL_ACKRQF_NOT_SET_VALUE 0 145 #define SI32_I2C_A_CONTROL_ACKRQF_NOT_SET_U32 \ 146 (SI32_I2C_A_CONTROL_ACKRQF_NOT_SET_VALUE << SI32_I2C_A_CONTROL_ACKRQF_SHIFT) 147 // ACK requested. 148 #define SI32_I2C_A_CONTROL_ACKRQF_SET_VALUE 1 149 #define SI32_I2C_A_CONTROL_ACKRQF_SET_U32 \ 150 (SI32_I2C_A_CONTROL_ACKRQF_SET_VALUE << SI32_I2C_A_CONTROL_ACKRQF_SHIFT) 151 152 #define SI32_I2C_A_CONTROL_STO_MASK 0x00000010 153 #define SI32_I2C_A_CONTROL_STO_SHIFT 4 154 // Read: A stop is not pending and a stop / repeat start has not been detected. 155 // Write: Clear the STO bit. 156 #define SI32_I2C_A_CONTROL_STO_NOT_SET_VALUE 0 157 #define SI32_I2C_A_CONTROL_STO_NOT_SET_U32 \ 158 (SI32_I2C_A_CONTROL_STO_NOT_SET_VALUE << SI32_I2C_A_CONTROL_STO_SHIFT) 159 // Read: Stop or stop / repeat start detected. This bit must be cleared by 160 // firmware. Write: Generate a stop. 161 #define SI32_I2C_A_CONTROL_STO_SET_VALUE 1 162 #define SI32_I2C_A_CONTROL_STO_SET_U32 \ 163 (SI32_I2C_A_CONTROL_STO_SET_VALUE << SI32_I2C_A_CONTROL_STO_SHIFT) 164 165 #define SI32_I2C_A_CONTROL_STA_MASK 0x00000020 166 #define SI32_I2C_A_CONTROL_STA_SHIFT 5 167 // Read: A start is not pending and a repeat start has not been detected. Write: 168 // Clear the STA bit. 169 #define SI32_I2C_A_CONTROL_STA_NOT_SET_VALUE 0 170 #define SI32_I2C_A_CONTROL_STA_NOT_SET_U32 \ 171 (SI32_I2C_A_CONTROL_STA_NOT_SET_VALUE << SI32_I2C_A_CONTROL_STA_SHIFT) 172 // Read: Start or repeat start detected. This bit must be cleared by firmware. 173 // Write: Generate a start or repeat start. 174 #define SI32_I2C_A_CONTROL_STA_SET_VALUE 1 175 #define SI32_I2C_A_CONTROL_STA_SET_U32 \ 176 (SI32_I2C_A_CONTROL_STA_SET_VALUE << SI32_I2C_A_CONTROL_STA_SHIFT) 177 178 #define SI32_I2C_A_CONTROL_TXMDF_MASK 0x00000040 179 #define SI32_I2C_A_CONTROL_TXMDF_SHIFT 6 180 // Module is in receiver mode. 181 #define SI32_I2C_A_CONTROL_TXMDF_RECEIVE_VALUE 0 182 #define SI32_I2C_A_CONTROL_TXMDF_RECEIVE_U32 \ 183 (SI32_I2C_A_CONTROL_TXMDF_RECEIVE_VALUE << SI32_I2C_A_CONTROL_TXMDF_SHIFT) 184 // Module is in transmitter mode. 185 #define SI32_I2C_A_CONTROL_TXMDF_TRANSMIT_VALUE 1 186 #define SI32_I2C_A_CONTROL_TXMDF_TRANSMIT_U32 \ 187 (SI32_I2C_A_CONTROL_TXMDF_TRANSMIT_VALUE << SI32_I2C_A_CONTROL_TXMDF_SHIFT) 188 189 #define SI32_I2C_A_CONTROL_MSMDF_MASK 0x00000080 190 #define SI32_I2C_A_CONTROL_MSMDF_SHIFT 7 191 // Module is operating in Slave mode. 192 #define SI32_I2C_A_CONTROL_MSMDF_SLAVE_VALUE 0 193 #define SI32_I2C_A_CONTROL_MSMDF_SLAVE_U32 \ 194 (SI32_I2C_A_CONTROL_MSMDF_SLAVE_VALUE << SI32_I2C_A_CONTROL_MSMDF_SHIFT) 195 // Module is operating in Master mode. 196 #define SI32_I2C_A_CONTROL_MSMDF_MASTER_VALUE 1 197 #define SI32_I2C_A_CONTROL_MSMDF_MASTER_U32 \ 198 (SI32_I2C_A_CONTROL_MSMDF_MASTER_VALUE << SI32_I2C_A_CONTROL_MSMDF_SHIFT) 199 200 #define SI32_I2C_A_CONTROL_STOI_MASK 0x00000100 201 #define SI32_I2C_A_CONTROL_STOI_SHIFT 8 202 // Read: A stop interrupt has not occurred. Write: Clear the stop interrupt flag 203 // (STOI). 204 #define SI32_I2C_A_CONTROL_STOI_NOT_SET_VALUE 0 205 #define SI32_I2C_A_CONTROL_STOI_NOT_SET_U32 \ 206 (SI32_I2C_A_CONTROL_STOI_NOT_SET_VALUE << SI32_I2C_A_CONTROL_STOI_SHIFT) 207 // Read: Stop interrupt detected. In Slave mode, a stop has been detected on the 208 // bus. In Master mode, a stop has been generated. Write: Force a stop interrupt. 209 #define SI32_I2C_A_CONTROL_STOI_SET_VALUE 1 210 #define SI32_I2C_A_CONTROL_STOI_SET_U32 \ 211 (SI32_I2C_A_CONTROL_STOI_SET_VALUE << SI32_I2C_A_CONTROL_STOI_SHIFT) 212 213 #define SI32_I2C_A_CONTROL_ACKI_MASK 0x00000200 214 #define SI32_I2C_A_CONTROL_ACKI_SHIFT 9 215 // Read: An acknowledge interrupt has not occurred. Write: Clear the acknowledge 216 // interrupt (ACKI). 217 #define SI32_I2C_A_CONTROL_ACKI_NOT_SET_VALUE 0 218 #define SI32_I2C_A_CONTROL_ACKI_NOT_SET_U32 \ 219 (SI32_I2C_A_CONTROL_ACKI_NOT_SET_VALUE << SI32_I2C_A_CONTROL_ACKI_SHIFT) 220 // Read: An acknowledge interrupt occurred. Write: Force an acknowledge interrupt. 221 #define SI32_I2C_A_CONTROL_ACKI_SET_VALUE 1 222 #define SI32_I2C_A_CONTROL_ACKI_SET_U32 \ 223 (SI32_I2C_A_CONTROL_ACKI_SET_VALUE << SI32_I2C_A_CONTROL_ACKI_SHIFT) 224 225 #define SI32_I2C_A_CONTROL_RXI_MASK 0x00000400 226 #define SI32_I2C_A_CONTROL_RXI_SHIFT 10 227 // Read: A receive done interrupt has not occurred. Write: Clear the receive done 228 // interrupt (RXI). 229 #define SI32_I2C_A_CONTROL_RXI_NOT_SET_VALUE 0 230 #define SI32_I2C_A_CONTROL_RXI_NOT_SET_U32 \ 231 (SI32_I2C_A_CONTROL_RXI_NOT_SET_VALUE << SI32_I2C_A_CONTROL_RXI_SHIFT) 232 // Read: Receive done interrupt occurred. Write: Force a receive done interrupt. 233 #define SI32_I2C_A_CONTROL_RXI_SET_VALUE 1 234 #define SI32_I2C_A_CONTROL_RXI_SET_U32 \ 235 (SI32_I2C_A_CONTROL_RXI_SET_VALUE << SI32_I2C_A_CONTROL_RXI_SHIFT) 236 237 #define SI32_I2C_A_CONTROL_TXI_MASK 0x00000800 238 #define SI32_I2C_A_CONTROL_TXI_SHIFT 11 239 // Read: A transmit done interrupt has not occurred. Write: Clear the transmit done 240 // interrupt (TXI). 241 #define SI32_I2C_A_CONTROL_TXI_NOT_SET_VALUE 0 242 #define SI32_I2C_A_CONTROL_TXI_NOT_SET_U32 \ 243 (SI32_I2C_A_CONTROL_TXI_NOT_SET_VALUE << SI32_I2C_A_CONTROL_TXI_SHIFT) 244 // Read: Transmit done interrupt detected. If the transmit is forced to abort by a 245 // NACK response, the acknowledge interrupt (ACKI) will also be set. Write: Force a 246 // transmit done interrupt. 247 #define SI32_I2C_A_CONTROL_TXI_SET_VALUE 1 248 #define SI32_I2C_A_CONTROL_TXI_SET_U32 \ 249 (SI32_I2C_A_CONTROL_TXI_SET_VALUE << SI32_I2C_A_CONTROL_TXI_SHIFT) 250 251 #define SI32_I2C_A_CONTROL_STAI_MASK 0x00001000 252 #define SI32_I2C_A_CONTROL_STAI_SHIFT 12 253 // Read: Start interrupt has not occurred. Write: Clear the start interrupt (STAI). 254 #define SI32_I2C_A_CONTROL_STAI_NOT_SET_VALUE 0 255 #define SI32_I2C_A_CONTROL_STAI_NOT_SET_U32 \ 256 (SI32_I2C_A_CONTROL_STAI_NOT_SET_VALUE << SI32_I2C_A_CONTROL_STAI_SHIFT) 257 // Read: Start or repeat start interrupt occurred. In Slave mode, a start or 258 // repeat start is detected. In Master mode, a start or repeat start has been 259 // generated. 260 #define SI32_I2C_A_CONTROL_STAI_SET_VALUE 1 261 #define SI32_I2C_A_CONTROL_STAI_SET_U32 \ 262 (SI32_I2C_A_CONTROL_STAI_SET_VALUE << SI32_I2C_A_CONTROL_STAI_SHIFT) 263 264 #define SI32_I2C_A_CONTROL_ARBLI_MASK 0x00002000 265 #define SI32_I2C_A_CONTROL_ARBLI_SHIFT 13 266 // Read: An arbitration lost interrupt has not occurred. Write: Clear the 267 // arbitration lost interrupt (ARBLI). 268 #define SI32_I2C_A_CONTROL_ARBLI_NOT_SET_VALUE 0 269 #define SI32_I2C_A_CONTROL_ARBLI_NOT_SET_U32 \ 270 (SI32_I2C_A_CONTROL_ARBLI_NOT_SET_VALUE << SI32_I2C_A_CONTROL_ARBLI_SHIFT) 271 // Read: Arbitration lost interrupt detected. Write: Force an arbitration lost 272 // interrupt. 273 #define SI32_I2C_A_CONTROL_ARBLI_SET_VALUE 1 274 #define SI32_I2C_A_CONTROL_ARBLI_SET_U32 \ 275 (SI32_I2C_A_CONTROL_ARBLI_SET_VALUE << SI32_I2C_A_CONTROL_ARBLI_SHIFT) 276 277 #define SI32_I2C_A_CONTROL_T0I_MASK 0x00004000 278 #define SI32_I2C_A_CONTROL_T0I_SHIFT 14 279 // Read: A I2C Timer Byte 0 interrupt has not occurred. Write: Clear the I2C Timer 280 // Byte 0 interrupt (T0I). 281 #define SI32_I2C_A_CONTROL_T0I_NOT_SET_VALUE 0 282 #define SI32_I2C_A_CONTROL_T0I_NOT_SET_U32 \ 283 (SI32_I2C_A_CONTROL_T0I_NOT_SET_VALUE << SI32_I2C_A_CONTROL_T0I_SHIFT) 284 // Read: I2C Timer Byte 0 overflow interrupt detected. Write: Force a I2C Timer 285 // Byte 0 interrupt. 286 #define SI32_I2C_A_CONTROL_T0I_SET_VALUE 1 287 #define SI32_I2C_A_CONTROL_T0I_SET_U32 \ 288 (SI32_I2C_A_CONTROL_T0I_SET_VALUE << SI32_I2C_A_CONTROL_T0I_SHIFT) 289 290 #define SI32_I2C_A_CONTROL_T1I_MASK 0x00008000 291 #define SI32_I2C_A_CONTROL_T1I_SHIFT 15 292 // Read: No interrupt occurred. Write: Clear the I2C Timer Byte 1 interrupt (T1I). 293 #define SI32_I2C_A_CONTROL_T1I_NOT_SET_VALUE 0 294 #define SI32_I2C_A_CONTROL_T1I_NOT_SET_U32 \ 295 (SI32_I2C_A_CONTROL_T1I_NOT_SET_VALUE << SI32_I2C_A_CONTROL_T1I_SHIFT) 296 // Read: I2C Timer Byte 1 overflow interrupt is detected. Write: Force a I2C Timer 297 // Byte 1 interrupt. 298 #define SI32_I2C_A_CONTROL_T1I_SET_VALUE 1 299 #define SI32_I2C_A_CONTROL_T1I_SET_U32 \ 300 (SI32_I2C_A_CONTROL_T1I_SET_VALUE << SI32_I2C_A_CONTROL_T1I_SHIFT) 301 302 #define SI32_I2C_A_CONTROL_T2I_MASK 0x00010000 303 #define SI32_I2C_A_CONTROL_T2I_SHIFT 16 304 // Read: A I2C Timer Byte 2 interrupt has not occurred. Write: Clear the I2C Timer 305 // Byte 2 interrupt (T2I). 306 #define SI32_I2C_A_CONTROL_T2I_NOT_SET_VALUE 0 307 #define SI32_I2C_A_CONTROL_T2I_NOT_SET_U32 \ 308 (SI32_I2C_A_CONTROL_T2I_NOT_SET_VALUE << SI32_I2C_A_CONTROL_T2I_SHIFT) 309 // Read: I2C Timer Byte 2 overflow interrupt detected. Write: Force a I2C Timer 310 // Byte 2 interrupt. 311 #define SI32_I2C_A_CONTROL_T2I_SET_VALUE 1 312 #define SI32_I2C_A_CONTROL_T2I_SET_U32 \ 313 (SI32_I2C_A_CONTROL_T2I_SET_VALUE << SI32_I2C_A_CONTROL_T2I_SHIFT) 314 315 #define SI32_I2C_A_CONTROL_T3I_MASK 0x00020000 316 #define SI32_I2C_A_CONTROL_T3I_SHIFT 17 317 // Read: A I2C Timer Byte 3 interrupt or SCL low timeout has not occurred. Write: 318 // Clear the I2C Timer Byte 3 interrupt (T3I). 319 #define SI32_I2C_A_CONTROL_T3I_NOT_SET_VALUE 0 320 #define SI32_I2C_A_CONTROL_T3I_NOT_SET_U32 \ 321 (SI32_I2C_A_CONTROL_T3I_NOT_SET_VALUE << SI32_I2C_A_CONTROL_T3I_SHIFT) 322 // Read: I2C Timer Byte 3 overflow or SCL low timeout interrupt detected. Write: 323 // Force a I2C Timer Byte 3 interrupt. 324 #define SI32_I2C_A_CONTROL_T3I_SET_VALUE 1 325 #define SI32_I2C_A_CONTROL_T3I_SET_U32 \ 326 (SI32_I2C_A_CONTROL_T3I_SET_VALUE << SI32_I2C_A_CONTROL_T3I_SHIFT) 327 328 #define SI32_I2C_A_CONTROL_RXARM_MASK 0x00040000 329 #define SI32_I2C_A_CONTROL_RXARM_SHIFT 18 330 // Disable data and address reception. 331 #define SI32_I2C_A_CONTROL_RXARM_DISABLED_VALUE 0 332 #define SI32_I2C_A_CONTROL_RXARM_DISABLED_U32 \ 333 (SI32_I2C_A_CONTROL_RXARM_DISABLED_VALUE << SI32_I2C_A_CONTROL_RXARM_SHIFT) 334 // Enable the module to perform a receive operation. 335 #define SI32_I2C_A_CONTROL_RXARM_ENABLED_VALUE 1 336 #define SI32_I2C_A_CONTROL_RXARM_ENABLED_U32 \ 337 (SI32_I2C_A_CONTROL_RXARM_ENABLED_VALUE << SI32_I2C_A_CONTROL_RXARM_SHIFT) 338 339 #define SI32_I2C_A_CONTROL_TXARM_MASK 0x00080000 340 #define SI32_I2C_A_CONTROL_TXARM_SHIFT 19 341 // Disable data and address transmission. 342 #define SI32_I2C_A_CONTROL_TXARM_DISABLED_VALUE 0 343 #define SI32_I2C_A_CONTROL_TXARM_DISABLED_U32 \ 344 (SI32_I2C_A_CONTROL_TXARM_DISABLED_VALUE << SI32_I2C_A_CONTROL_TXARM_SHIFT) 345 // Enable the module to perform a transmit operation. 346 #define SI32_I2C_A_CONTROL_TXARM_ENABLED_VALUE 1 347 #define SI32_I2C_A_CONTROL_TXARM_ENABLED_U32 \ 348 (SI32_I2C_A_CONTROL_TXARM_ENABLED_VALUE << SI32_I2C_A_CONTROL_TXARM_SHIFT) 349 350 #define SI32_I2C_A_CONTROL_SLVAF_MASK 0x00100000 351 #define SI32_I2C_A_CONTROL_SLVAF_SHIFT 20 352 // Slave address detected. 353 #define SI32_I2C_A_CONTROL_SLVAF_SLAVE_ADDRESS_VALUE 0 354 #define SI32_I2C_A_CONTROL_SLVAF_SLAVE_ADDRESS_U32 \ 355 (SI32_I2C_A_CONTROL_SLVAF_SLAVE_ADDRESS_VALUE << SI32_I2C_A_CONTROL_SLVAF_SHIFT) 356 // General Call address detected. 357 #define SI32_I2C_A_CONTROL_SLVAF_GENERAL_CALL_VALUE 1 358 #define SI32_I2C_A_CONTROL_SLVAF_GENERAL_CALL_U32 \ 359 (SI32_I2C_A_CONTROL_SLVAF_GENERAL_CALL_VALUE << SI32_I2C_A_CONTROL_SLVAF_SHIFT) 360 361 #define SI32_I2C_A_CONTROL_ATXRXEN_MASK 0x00200000 362 #define SI32_I2C_A_CONTROL_ATXRXEN_SHIFT 21 363 // Do not automatically switch to transmit or receive mode after a Start. 364 #define SI32_I2C_A_CONTROL_ATXRXEN_DISABLED_VALUE 0 365 #define SI32_I2C_A_CONTROL_ATXRXEN_DISABLED_U32 \ 366 (SI32_I2C_A_CONTROL_ATXRXEN_DISABLED_VALUE << SI32_I2C_A_CONTROL_ATXRXEN_SHIFT) 367 // If automatic hardware acknowledge mode is enabled (HACKEN = 1), automatically 368 // switch to transmit or receive mode after a Start. 369 #define SI32_I2C_A_CONTROL_ATXRXEN_ENABLED_VALUE 1 370 #define SI32_I2C_A_CONTROL_ATXRXEN_ENABLED_U32 \ 371 (SI32_I2C_A_CONTROL_ATXRXEN_ENABLED_VALUE << SI32_I2C_A_CONTROL_ATXRXEN_SHIFT) 372 373 #define SI32_I2C_A_CONTROL_FMD_MASK 0x00400000 374 #define SI32_I2C_A_CONTROL_FMD_SHIFT 22 375 // Enable the input filter. 376 #define SI32_I2C_A_CONTROL_FMD_ENABLED_VALUE 0 377 #define SI32_I2C_A_CONTROL_FMD_ENABLED_U32 \ 378 (SI32_I2C_A_CONTROL_FMD_ENABLED_VALUE << SI32_I2C_A_CONTROL_FMD_SHIFT) 379 // Disable the input filter. 380 #define SI32_I2C_A_CONTROL_FMD_DISABLED_VALUE 1 381 #define SI32_I2C_A_CONTROL_FMD_DISABLED_U32 \ 382 (SI32_I2C_A_CONTROL_FMD_DISABLED_VALUE << SI32_I2C_A_CONTROL_FMD_SHIFT) 383 384 #define SI32_I2C_A_CONTROL_DBGMD_MASK 0x00800000 385 #define SI32_I2C_A_CONTROL_DBGMD_SHIFT 23 386 // The I2C module will continue to operate while the core is halted in debug mode. 387 #define SI32_I2C_A_CONTROL_DBGMD_RUN_VALUE 0 388 #define SI32_I2C_A_CONTROL_DBGMD_RUN_U32 \ 389 (SI32_I2C_A_CONTROL_DBGMD_RUN_VALUE << SI32_I2C_A_CONTROL_DBGMD_SHIFT) 390 // A debug breakpoint will cause the I2C module to halt. 391 #define SI32_I2C_A_CONTROL_DBGMD_HALT_VALUE 1 392 #define SI32_I2C_A_CONTROL_DBGMD_HALT_U32 \ 393 (SI32_I2C_A_CONTROL_DBGMD_HALT_VALUE << SI32_I2C_A_CONTROL_DBGMD_SHIFT) 394 395 #define SI32_I2C_A_CONTROL_SMINH_MASK 0x01000000 396 #define SI32_I2C_A_CONTROL_SMINH_SHIFT 24 397 // Enable Slave modes. 398 #define SI32_I2C_A_CONTROL_SMINH_INACTIVE_VALUE 0 399 #define SI32_I2C_A_CONTROL_SMINH_INACTIVE_U32 \ 400 (SI32_I2C_A_CONTROL_SMINH_INACTIVE_VALUE << SI32_I2C_A_CONTROL_SMINH_SHIFT) 401 // Inhibit Slave modes. The module will not respond to a Master on the bus. 402 #define SI32_I2C_A_CONTROL_SMINH_ACTIVE_VALUE 1 403 #define SI32_I2C_A_CONTROL_SMINH_ACTIVE_U32 \ 404 (SI32_I2C_A_CONTROL_SMINH_ACTIVE_VALUE << SI32_I2C_A_CONTROL_SMINH_SHIFT) 405 406 #define SI32_I2C_A_CONTROL_HACKEN_MASK 0x02000000 407 #define SI32_I2C_A_CONTROL_HACKEN_SHIFT 25 408 // Disable automatic hardware acknowledge. 409 #define SI32_I2C_A_CONTROL_HACKEN_DISABLED_VALUE 0 410 #define SI32_I2C_A_CONTROL_HACKEN_DISABLED_U32 \ 411 (SI32_I2C_A_CONTROL_HACKEN_DISABLED_VALUE << SI32_I2C_A_CONTROL_HACKEN_SHIFT) 412 // Enable automatic hardware acknowledge. 413 #define SI32_I2C_A_CONTROL_HACKEN_ENABLED_VALUE 1 414 #define SI32_I2C_A_CONTROL_HACKEN_ENABLED_U32 \ 415 (SI32_I2C_A_CONTROL_HACKEN_ENABLED_VALUE << SI32_I2C_A_CONTROL_HACKEN_SHIFT) 416 417 #define SI32_I2C_A_CONTROL_LBACKEN_MASK 0x08000000 418 #define SI32_I2C_A_CONTROL_LBACKEN_SHIFT 27 419 // NACK after the last byte is received. 420 #define SI32_I2C_A_CONTROL_LBACKEN_DISABLED_VALUE 0 421 #define SI32_I2C_A_CONTROL_LBACKEN_DISABLED_U32 \ 422 (SI32_I2C_A_CONTROL_LBACKEN_DISABLED_VALUE << SI32_I2C_A_CONTROL_LBACKEN_SHIFT) 423 // ACK after the last byte is received. 424 #define SI32_I2C_A_CONTROL_LBACKEN_ENABLED_VALUE 1 425 #define SI32_I2C_A_CONTROL_LBACKEN_ENABLED_U32 \ 426 (SI32_I2C_A_CONTROL_LBACKEN_ENABLED_VALUE << SI32_I2C_A_CONTROL_LBACKEN_SHIFT) 427 428 #define SI32_I2C_A_CONTROL_GCEN_MASK 0x20000000 429 #define SI32_I2C_A_CONTROL_GCEN_SHIFT 29 430 // Disable General Call address decoding. 431 #define SI32_I2C_A_CONTROL_GCEN_DISABLED_VALUE 0 432 #define SI32_I2C_A_CONTROL_GCEN_DISABLED_U32 \ 433 (SI32_I2C_A_CONTROL_GCEN_DISABLED_VALUE << SI32_I2C_A_CONTROL_GCEN_SHIFT) 434 // Enable General Call address decoding. 435 #define SI32_I2C_A_CONTROL_GCEN_ENABLED_VALUE 1 436 #define SI32_I2C_A_CONTROL_GCEN_ENABLED_U32 \ 437 (SI32_I2C_A_CONTROL_GCEN_ENABLED_VALUE << SI32_I2C_A_CONTROL_GCEN_SHIFT) 438 439 #define SI32_I2C_A_CONTROL_RESET_MASK 0x40000000 440 #define SI32_I2C_A_CONTROL_RESET_SHIFT 30 441 // I2C module is not in soft reset. 442 #define SI32_I2C_A_CONTROL_RESET_INACTIVE_VALUE 0 443 #define SI32_I2C_A_CONTROL_RESET_INACTIVE_U32 \ 444 (SI32_I2C_A_CONTROL_RESET_INACTIVE_VALUE << SI32_I2C_A_CONTROL_RESET_SHIFT) 445 // I2C module is in soft reset and firmware cannot access all bits in the module. 446 #define SI32_I2C_A_CONTROL_RESET_ACTIVE_VALUE 1 447 #define SI32_I2C_A_CONTROL_RESET_ACTIVE_U32 \ 448 (SI32_I2C_A_CONTROL_RESET_ACTIVE_VALUE << SI32_I2C_A_CONTROL_RESET_SHIFT) 449 450 #define SI32_I2C_A_CONTROL_I2CEN_MASK 0x80000000 451 #define SI32_I2C_A_CONTROL_I2CEN_SHIFT 31 452 // Disable the I2C module. 453 #define SI32_I2C_A_CONTROL_I2CEN_DISABLED_VALUE 0U 454 #define SI32_I2C_A_CONTROL_I2CEN_DISABLED_U32 \ 455 (SI32_I2C_A_CONTROL_I2CEN_DISABLED_VALUE << SI32_I2C_A_CONTROL_I2CEN_SHIFT) 456 // Enable the I2C module. 457 #define SI32_I2C_A_CONTROL_I2CEN_ENABLED_VALUE 1U 458 #define SI32_I2C_A_CONTROL_I2CEN_ENABLED_U32 \ 459 (SI32_I2C_A_CONTROL_I2CEN_ENABLED_VALUE << SI32_I2C_A_CONTROL_I2CEN_SHIFT) 460 461 462 463 struct SI32_I2C_A_CONFIG_Struct 464 { 465 union 466 { 467 struct 468 { 469 // I2C Clock Scaler 470 volatile uint32_t SCALER: 6; 471 uint32_t reserved0: 2; 472 // Stop Interrupt Enable 473 volatile uint32_t STOIEN: 1; 474 // Acknowledge Interrupt Enable 475 volatile uint32_t ACKIEN: 1; 476 // Receive Done Interrupt Enable 477 volatile uint32_t RXIEN: 1; 478 // Transmit Done Interrupt Enable 479 volatile uint32_t TXIEN: 1; 480 // Start Interrupt Enable 481 volatile uint32_t STAIEN: 1; 482 // Arbitration Lost Interrupt Enable 483 volatile uint32_t ARBLIEN: 1; 484 // I2C Timer Byte 0 Interrupt Enable 485 volatile uint32_t T0IEN: 1; 486 // I2C Timer Byte 1 Interrupt Enable 487 volatile uint32_t T1IEN: 1; 488 // I2C Timer Byte 2 Interrupt Enable 489 volatile uint32_t T2IEN: 1; 490 // I2C Timer Byte 3 Interrupt Enable 491 volatile uint32_t T3IEN: 1; 492 uint32_t reserved1: 2; 493 // Transfer Byte Count 494 volatile uint32_t BC: 2; 495 // Transfer Byte Pointer 496 volatile uint32_t BP: 2; 497 // I2C Timer Byte 0 Run 498 volatile uint32_t T0RUN: 1; 499 // I2C Timer Byte 1 Run 500 volatile uint32_t T1RUN: 1; 501 // I2C Timer Byte 2 Run 502 volatile uint32_t T2RUN: 1; 503 // I2C Timer Byte 3 Run 504 volatile uint32_t T3RUN: 1; 505 // I2C Timer Mode 506 volatile uint32_t TMD: 2; 507 uint32_t reserved2: 1; 508 // I2C Timer Enable 509 volatile uint32_t TIMEREN: 1; 510 }; 511 volatile uint32_t U32; 512 }; 513 }; 514 515 #define SI32_I2C_A_CONFIG_SCALER_MASK 0x0000003F 516 #define SI32_I2C_A_CONFIG_SCALER_SHIFT 0 517 518 #define SI32_I2C_A_CONFIG_STOIEN_MASK 0x00000100 519 #define SI32_I2C_A_CONFIG_STOIEN_SHIFT 8 520 // Disable the stop interrupt. 521 #define SI32_I2C_A_CONFIG_STOIEN_DISABLED_VALUE 0 522 #define SI32_I2C_A_CONFIG_STOIEN_DISABLED_U32 \ 523 (SI32_I2C_A_CONFIG_STOIEN_DISABLED_VALUE << SI32_I2C_A_CONFIG_STOIEN_SHIFT) 524 // Enable the stop interrupt (STOI). 525 #define SI32_I2C_A_CONFIG_STOIEN_ENABLED_VALUE 1 526 #define SI32_I2C_A_CONFIG_STOIEN_ENABLED_U32 \ 527 (SI32_I2C_A_CONFIG_STOIEN_ENABLED_VALUE << SI32_I2C_A_CONFIG_STOIEN_SHIFT) 528 529 #define SI32_I2C_A_CONFIG_ACKIEN_MASK 0x00000200 530 #define SI32_I2C_A_CONFIG_ACKIEN_SHIFT 9 531 // Disable the acknowledge interrupt. 532 #define SI32_I2C_A_CONFIG_ACKIEN_DISABLED_VALUE 0 533 #define SI32_I2C_A_CONFIG_ACKIEN_DISABLED_U32 \ 534 (SI32_I2C_A_CONFIG_ACKIEN_DISABLED_VALUE << SI32_I2C_A_CONFIG_ACKIEN_SHIFT) 535 // Enable the acknowledge interrupt (ACKI). 536 #define SI32_I2C_A_CONFIG_ACKIEN_ENABLED_VALUE 1 537 #define SI32_I2C_A_CONFIG_ACKIEN_ENABLED_U32 \ 538 (SI32_I2C_A_CONFIG_ACKIEN_ENABLED_VALUE << SI32_I2C_A_CONFIG_ACKIEN_SHIFT) 539 540 #define SI32_I2C_A_CONFIG_RXIEN_MASK 0x00000400 541 #define SI32_I2C_A_CONFIG_RXIEN_SHIFT 10 542 // Disable the receive done interrupt. 543 #define SI32_I2C_A_CONFIG_RXIEN_DISABLED_VALUE 0 544 #define SI32_I2C_A_CONFIG_RXIEN_DISABLED_U32 \ 545 (SI32_I2C_A_CONFIG_RXIEN_DISABLED_VALUE << SI32_I2C_A_CONFIG_RXIEN_SHIFT) 546 // Enable the receive done interrupt (RXI). 547 #define SI32_I2C_A_CONFIG_RXIEN_ENABLED_VALUE 1 548 #define SI32_I2C_A_CONFIG_RXIEN_ENABLED_U32 \ 549 (SI32_I2C_A_CONFIG_RXIEN_ENABLED_VALUE << SI32_I2C_A_CONFIG_RXIEN_SHIFT) 550 551 #define SI32_I2C_A_CONFIG_TXIEN_MASK 0x00000800 552 #define SI32_I2C_A_CONFIG_TXIEN_SHIFT 11 553 // Disable the transmit done interrupt. 554 #define SI32_I2C_A_CONFIG_TXIEN_DISABLED_VALUE 0 555 #define SI32_I2C_A_CONFIG_TXIEN_DISABLED_U32 \ 556 (SI32_I2C_A_CONFIG_TXIEN_DISABLED_VALUE << SI32_I2C_A_CONFIG_TXIEN_SHIFT) 557 // Enable the transmit done interrupt (TXI). 558 #define SI32_I2C_A_CONFIG_TXIEN_ENABLED_VALUE 1 559 #define SI32_I2C_A_CONFIG_TXIEN_ENABLED_U32 \ 560 (SI32_I2C_A_CONFIG_TXIEN_ENABLED_VALUE << SI32_I2C_A_CONFIG_TXIEN_SHIFT) 561 562 #define SI32_I2C_A_CONFIG_STAIEN_MASK 0x00001000 563 #define SI32_I2C_A_CONFIG_STAIEN_SHIFT 12 564 // Disable the start interrupt. 565 #define SI32_I2C_A_CONFIG_STAIEN_DISABLED_VALUE 0 566 #define SI32_I2C_A_CONFIG_STAIEN_DISABLED_U32 \ 567 (SI32_I2C_A_CONFIG_STAIEN_DISABLED_VALUE << SI32_I2C_A_CONFIG_STAIEN_SHIFT) 568 // Enable the start interrupt (STAI). 569 #define SI32_I2C_A_CONFIG_STAIEN_ENABLED_VALUE 1 570 #define SI32_I2C_A_CONFIG_STAIEN_ENABLED_U32 \ 571 (SI32_I2C_A_CONFIG_STAIEN_ENABLED_VALUE << SI32_I2C_A_CONFIG_STAIEN_SHIFT) 572 573 #define SI32_I2C_A_CONFIG_ARBLIEN_MASK 0x00002000 574 #define SI32_I2C_A_CONFIG_ARBLIEN_SHIFT 13 575 // Disable the arbitration lost interrupt. 576 #define SI32_I2C_A_CONFIG_ARBLIEN_DISABLED_VALUE 0 577 #define SI32_I2C_A_CONFIG_ARBLIEN_DISABLED_U32 \ 578 (SI32_I2C_A_CONFIG_ARBLIEN_DISABLED_VALUE << SI32_I2C_A_CONFIG_ARBLIEN_SHIFT) 579 // Enable the arbitration lost interrupt (ARBLI). 580 #define SI32_I2C_A_CONFIG_ARBLIEN_ENABLED_VALUE 1 581 #define SI32_I2C_A_CONFIG_ARBLIEN_ENABLED_U32 \ 582 (SI32_I2C_A_CONFIG_ARBLIEN_ENABLED_VALUE << SI32_I2C_A_CONFIG_ARBLIEN_SHIFT) 583 584 #define SI32_I2C_A_CONFIG_T0IEN_MASK 0x00004000 585 #define SI32_I2C_A_CONFIG_T0IEN_SHIFT 14 586 // Disable the I2C Timer Byte 0 interrupt. 587 #define SI32_I2C_A_CONFIG_T0IEN_DISABLED_VALUE 0 588 #define SI32_I2C_A_CONFIG_T0IEN_DISABLED_U32 \ 589 (SI32_I2C_A_CONFIG_T0IEN_DISABLED_VALUE << SI32_I2C_A_CONFIG_T0IEN_SHIFT) 590 // Enable the I2C Timer Byte 0 interrupt (T0I). 591 #define SI32_I2C_A_CONFIG_T0IEN_ENABLED_VALUE 1 592 #define SI32_I2C_A_CONFIG_T0IEN_ENABLED_U32 \ 593 (SI32_I2C_A_CONFIG_T0IEN_ENABLED_VALUE << SI32_I2C_A_CONFIG_T0IEN_SHIFT) 594 595 #define SI32_I2C_A_CONFIG_T1IEN_MASK 0x00008000 596 #define SI32_I2C_A_CONFIG_T1IEN_SHIFT 15 597 // Disable the I2C Timer Byte 1 interrupt. 598 #define SI32_I2C_A_CONFIG_T1IEN_DISABLED_VALUE 0 599 #define SI32_I2C_A_CONFIG_T1IEN_DISABLED_U32 \ 600 (SI32_I2C_A_CONFIG_T1IEN_DISABLED_VALUE << SI32_I2C_A_CONFIG_T1IEN_SHIFT) 601 // Enable the I2C Timer Byte 1 interrupt (T1I). 602 #define SI32_I2C_A_CONFIG_T1IEN_ENABLED_VALUE 1 603 #define SI32_I2C_A_CONFIG_T1IEN_ENABLED_U32 \ 604 (SI32_I2C_A_CONFIG_T1IEN_ENABLED_VALUE << SI32_I2C_A_CONFIG_T1IEN_SHIFT) 605 606 #define SI32_I2C_A_CONFIG_T2IEN_MASK 0x00010000 607 #define SI32_I2C_A_CONFIG_T2IEN_SHIFT 16 608 // Disable the I2C Timer Byte 2 interrupt. 609 #define SI32_I2C_A_CONFIG_T2IEN_DISABLED_VALUE 0 610 #define SI32_I2C_A_CONFIG_T2IEN_DISABLED_U32 \ 611 (SI32_I2C_A_CONFIG_T2IEN_DISABLED_VALUE << SI32_I2C_A_CONFIG_T2IEN_SHIFT) 612 // Enable the I2C Timer Byte 2 interrupt (T2I). 613 #define SI32_I2C_A_CONFIG_T2IEN_ENABLED_VALUE 1 614 #define SI32_I2C_A_CONFIG_T2IEN_ENABLED_U32 \ 615 (SI32_I2C_A_CONFIG_T2IEN_ENABLED_VALUE << SI32_I2C_A_CONFIG_T2IEN_SHIFT) 616 617 #define SI32_I2C_A_CONFIG_T3IEN_MASK 0x00020000 618 #define SI32_I2C_A_CONFIG_T3IEN_SHIFT 17 619 // Disable the I2C Timer Byte 3 and SCL low timeout interrupt. 620 #define SI32_I2C_A_CONFIG_T3IEN_DISABLED_VALUE 0 621 #define SI32_I2C_A_CONFIG_T3IEN_DISABLED_U32 \ 622 (SI32_I2C_A_CONFIG_T3IEN_DISABLED_VALUE << SI32_I2C_A_CONFIG_T3IEN_SHIFT) 623 // Enable the I2C Timer Byte 3 and SCL low timeout interrupt (T3I). 624 #define SI32_I2C_A_CONFIG_T3IEN_ENABLED_VALUE 1 625 #define SI32_I2C_A_CONFIG_T3IEN_ENABLED_U32 \ 626 (SI32_I2C_A_CONFIG_T3IEN_ENABLED_VALUE << SI32_I2C_A_CONFIG_T3IEN_SHIFT) 627 628 #define SI32_I2C_A_CONFIG_BC_MASK 0x00300000 629 #define SI32_I2C_A_CONFIG_BC_SHIFT 20 630 631 #define SI32_I2C_A_CONFIG_BP_MASK 0x00C00000 632 #define SI32_I2C_A_CONFIG_BP_SHIFT 22 633 634 #define SI32_I2C_A_CONFIG_T0RUN_MASK 0x01000000 635 #define SI32_I2C_A_CONFIG_T0RUN_SHIFT 24 636 // Stop Timer Byte 0. 637 #define SI32_I2C_A_CONFIG_T0RUN_STOP_VALUE 0 638 #define SI32_I2C_A_CONFIG_T0RUN_STOP_U32 \ 639 (SI32_I2C_A_CONFIG_T0RUN_STOP_VALUE << SI32_I2C_A_CONFIG_T0RUN_SHIFT) 640 // Start Timer Byte 0 running. 641 #define SI32_I2C_A_CONFIG_T0RUN_START_VALUE 1 642 #define SI32_I2C_A_CONFIG_T0RUN_START_U32 \ 643 (SI32_I2C_A_CONFIG_T0RUN_START_VALUE << SI32_I2C_A_CONFIG_T0RUN_SHIFT) 644 645 #define SI32_I2C_A_CONFIG_T1RUN_MASK 0x02000000 646 #define SI32_I2C_A_CONFIG_T1RUN_SHIFT 25 647 // Stop Timer Byte 1. 648 #define SI32_I2C_A_CONFIG_T1RUN_STOP_VALUE 0 649 #define SI32_I2C_A_CONFIG_T1RUN_STOP_U32 \ 650 (SI32_I2C_A_CONFIG_T1RUN_STOP_VALUE << SI32_I2C_A_CONFIG_T1RUN_SHIFT) 651 // Start Timer Byte 1 running. 652 #define SI32_I2C_A_CONFIG_T1RUN_START_VALUE 1 653 #define SI32_I2C_A_CONFIG_T1RUN_START_U32 \ 654 (SI32_I2C_A_CONFIG_T1RUN_START_VALUE << SI32_I2C_A_CONFIG_T1RUN_SHIFT) 655 656 #define SI32_I2C_A_CONFIG_T2RUN_MASK 0x04000000 657 #define SI32_I2C_A_CONFIG_T2RUN_SHIFT 26 658 // Stop Timer Byte 2. 659 #define SI32_I2C_A_CONFIG_T2RUN_STOP_VALUE 0 660 #define SI32_I2C_A_CONFIG_T2RUN_STOP_U32 \ 661 (SI32_I2C_A_CONFIG_T2RUN_STOP_VALUE << SI32_I2C_A_CONFIG_T2RUN_SHIFT) 662 // Start Timer Byte 2 running. 663 #define SI32_I2C_A_CONFIG_T2RUN_START_VALUE 1 664 #define SI32_I2C_A_CONFIG_T2RUN_START_U32 \ 665 (SI32_I2C_A_CONFIG_T2RUN_START_VALUE << SI32_I2C_A_CONFIG_T2RUN_SHIFT) 666 667 #define SI32_I2C_A_CONFIG_T3RUN_MASK 0x08000000 668 #define SI32_I2C_A_CONFIG_T3RUN_SHIFT 27 669 // Stop Timer Byte 3. 670 #define SI32_I2C_A_CONFIG_T3RUN_STOP_VALUE 0 671 #define SI32_I2C_A_CONFIG_T3RUN_STOP_U32 \ 672 (SI32_I2C_A_CONFIG_T3RUN_STOP_VALUE << SI32_I2C_A_CONFIG_T3RUN_SHIFT) 673 // Start Timer Byte 3 running. 674 #define SI32_I2C_A_CONFIG_T3RUN_START_VALUE 1 675 #define SI32_I2C_A_CONFIG_T3RUN_START_U32 \ 676 (SI32_I2C_A_CONFIG_T3RUN_START_VALUE << SI32_I2C_A_CONFIG_T3RUN_SHIFT) 677 678 #define SI32_I2C_A_CONFIG_TMD_MASK 0x30000000 679 #define SI32_I2C_A_CONFIG_TMD_SHIFT 28 680 // I2C Timer Mode 0: Operate the I2C timer as a single 32-bit timer : Timer Bytes 681 // [3 : 2 : 1 : 0]. 682 #define SI32_I2C_A_CONFIG_TMD_MODE0_VALUE 0 683 #define SI32_I2C_A_CONFIG_TMD_MODE0_U32 \ 684 (SI32_I2C_A_CONFIG_TMD_MODE0_VALUE << SI32_I2C_A_CONFIG_TMD_SHIFT) 685 // I2C Timer Mode 1: Operate the I2C timer as two 16-bit timers : Timer Bytes [3 : 686 // 2] and Timer Bytes [1 : 0]. 687 #define SI32_I2C_A_CONFIG_TMD_MODE1_VALUE 1 688 #define SI32_I2C_A_CONFIG_TMD_MODE1_U32 \ 689 (SI32_I2C_A_CONFIG_TMD_MODE1_VALUE << SI32_I2C_A_CONFIG_TMD_SHIFT) 690 // I2C Timer Mode 2: Operate the I2C timer as four independent 8-bit timers : 691 // Timer Byte 3, Timer Byte 2, Timer Byte 1, and Timer Byte 0. 692 #define SI32_I2C_A_CONFIG_TMD_MODE2_VALUE 2 693 #define SI32_I2C_A_CONFIG_TMD_MODE2_U32 \ 694 (SI32_I2C_A_CONFIG_TMD_MODE2_VALUE << SI32_I2C_A_CONFIG_TMD_SHIFT) 695 // I2C Timer Mode 3: Operate the I2C timer as one 16-bit and two 8-bit timers : 696 // Timer Bytes [3 : 2], Timer Byte 1, and Timer Byte 0. 697 #define SI32_I2C_A_CONFIG_TMD_MODE3_VALUE 3 698 #define SI32_I2C_A_CONFIG_TMD_MODE3_U32 \ 699 (SI32_I2C_A_CONFIG_TMD_MODE3_VALUE << SI32_I2C_A_CONFIG_TMD_SHIFT) 700 701 #define SI32_I2C_A_CONFIG_TIMEREN_MASK 0x80000000 702 #define SI32_I2C_A_CONFIG_TIMEREN_SHIFT 31 703 // Disable I2C Timer. 704 #define SI32_I2C_A_CONFIG_TIMEREN_DISABLED_VALUE 0U 705 #define SI32_I2C_A_CONFIG_TIMEREN_DISABLED_U32 \ 706 (SI32_I2C_A_CONFIG_TIMEREN_DISABLED_VALUE << SI32_I2C_A_CONFIG_TIMEREN_SHIFT) 707 // Enable I2C Timer for general purpose use. This setting should not be used when 708 // the I2C module is enabled (I2CEN = 1). 709 #define SI32_I2C_A_CONFIG_TIMEREN_ENABLED_VALUE 1U 710 #define SI32_I2C_A_CONFIG_TIMEREN_ENABLED_U32 \ 711 (SI32_I2C_A_CONFIG_TIMEREN_ENABLED_VALUE << SI32_I2C_A_CONFIG_TIMEREN_SHIFT) 712 713 714 715 struct SI32_I2C_A_SADDRESS_Struct 716 { 717 union 718 { 719 struct 720 { 721 uint32_t reserved0: 1; 722 // Slave Address 723 volatile uint32_t ADDRESS: 7; 724 uint32_t reserved1: 24; 725 }; 726 volatile uint32_t U32; 727 }; 728 }; 729 730 #define SI32_I2C_A_SADDRESS_ADDRESS_MASK 0x000000FE 731 #define SI32_I2C_A_SADDRESS_ADDRESS_SHIFT 1 732 733 734 735 struct SI32_I2C_A_SMASK_Struct 736 { 737 union 738 { 739 struct 740 { 741 uint32_t reserved0: 1; 742 // Slave Address Mask 743 volatile uint32_t MASK: 7; 744 uint32_t reserved1: 24; 745 }; 746 volatile uint32_t U32; 747 }; 748 }; 749 750 #define SI32_I2C_A_SMASK_MASK_MASK 0x000000FE 751 #define SI32_I2C_A_SMASK_MASK_SHIFT 1 752 753 754 755 struct SI32_I2C_A_DATA_Struct 756 { 757 union 758 { 759 struct 760 { 761 // Data 762 volatile uint32_t DATA_BITS; 763 }; 764 volatile uint32_t U32; 765 }; 766 }; 767 768 #define SI32_I2C_A_DATA_DATA_MASK 0xFFFFFFFF 769 #define SI32_I2C_A_DATA_DATA_SHIFT 0 770 771 772 773 struct SI32_I2C_A_TIMER_Struct 774 { 775 union 776 { 777 struct 778 { 779 // Timer Byte 0 780 volatile uint8_t T0; 781 // Timer Byte 1 782 volatile uint8_t T1; 783 // Timer Byte 2 784 volatile uint8_t T2; 785 // Timer Byte 3 786 volatile uint8_t T3; 787 }; 788 volatile uint32_t U32; 789 }; 790 }; 791 792 #define SI32_I2C_A_TIMER_T0_MASK 0x000000FF 793 #define SI32_I2C_A_TIMER_T0_SHIFT 0 794 795 #define SI32_I2C_A_TIMER_T1_MASK 0x0000FF00 796 #define SI32_I2C_A_TIMER_T1_SHIFT 8 797 798 #define SI32_I2C_A_TIMER_T2_MASK 0x00FF0000 799 #define SI32_I2C_A_TIMER_T2_SHIFT 16 800 801 #define SI32_I2C_A_TIMER_T3_MASK 0xFF000000 802 #define SI32_I2C_A_TIMER_T3_SHIFT 24 803 804 805 806 struct SI32_I2C_A_TIMERRL_Struct 807 { 808 union 809 { 810 struct 811 { 812 // Timer Byte 0 Reload / Bus Free Timeout 813 volatile uint8_t T0RL; 814 // Timer Byte 1 Reload / SCL High Time 815 volatile uint8_t T1RL; 816 // Timer Byte 2 Reload / SCL Low Timeout Bits [11:4] 817 volatile uint8_t T2RL; 818 // Timer Byte 3 Reload / SCL Low Timeout Bits [19:12] 819 volatile uint8_t T3RL; 820 }; 821 volatile uint32_t U32; 822 }; 823 }; 824 825 #define SI32_I2C_A_TIMERRL_T0RL_MASK 0x000000FF 826 #define SI32_I2C_A_TIMERRL_T0RL_SHIFT 0 827 828 #define SI32_I2C_A_TIMERRL_T1RL_MASK 0x0000FF00 829 #define SI32_I2C_A_TIMERRL_T1RL_SHIFT 8 830 831 #define SI32_I2C_A_TIMERRL_T2RL_MASK 0x00FF0000 832 #define SI32_I2C_A_TIMERRL_T2RL_SHIFT 16 833 834 #define SI32_I2C_A_TIMERRL_T3RL_MASK 0xFF000000 835 #define SI32_I2C_A_TIMERRL_T3RL_SHIFT 24 836 837 838 839 struct SI32_I2C_A_SCONFIG_Struct 840 { 841 union 842 { 843 struct 844 { 845 // Data Setup Time Extension 846 volatile uint32_t SETUP: 4; 847 // Data Hold Time Extension 848 volatile uint32_t HOLD: 4; 849 // SCL Low Time 850 volatile uint8_t SCLL; 851 // SCL Low Timeout Bits [3:0] 852 volatile uint32_t SCLLTIMER: 4; 853 uint32_t reserved0: 12; 854 }; 855 volatile uint32_t U32; 856 }; 857 }; 858 859 #define SI32_I2C_A_SCONFIG_SETUP_MASK 0x0000000F 860 #define SI32_I2C_A_SCONFIG_SETUP_SHIFT 0 861 862 #define SI32_I2C_A_SCONFIG_HOLD_MASK 0x000000F0 863 #define SI32_I2C_A_SCONFIG_HOLD_SHIFT 4 864 865 #define SI32_I2C_A_SCONFIG_SCLL_MASK 0x0000FF00 866 #define SI32_I2C_A_SCONFIG_SCLL_SHIFT 8 867 868 #define SI32_I2C_A_SCONFIG_SCLLTIMER_MASK 0x000F0000 869 #define SI32_I2C_A_SCONFIG_SCLLTIMER_SHIFT 16 870 871 872 873 struct SI32_I2C_A_I2CDMA_Struct 874 { 875 union 876 { 877 struct 878 { 879 // DMA Transfer Length 880 volatile uint8_t DMALEN; 881 uint32_t reserved0: 23; 882 // DMA Mode Enable 883 volatile uint32_t DMAEN: 1; 884 }; 885 volatile uint32_t U32; 886 }; 887 }; 888 889 #define SI32_I2C_A_I2CDMA_DMALEN_MASK 0x000000FF 890 #define SI32_I2C_A_I2CDMA_DMALEN_SHIFT 0 891 892 #define SI32_I2C_A_I2CDMA_DMAEN_MASK 0x80000000 893 #define SI32_I2C_A_I2CDMA_DMAEN_SHIFT 31 894 // Disable I2C DMA data requests. 895 #define SI32_I2C_A_I2CDMA_DMAEN_DISABLED_VALUE 0U 896 #define SI32_I2C_A_I2CDMA_DMAEN_DISABLED_U32 \ 897 (SI32_I2C_A_I2CDMA_DMAEN_DISABLED_VALUE << SI32_I2C_A_I2CDMA_DMAEN_SHIFT) 898 // Enable I2C DMA data requests. 899 #define SI32_I2C_A_I2CDMA_DMAEN_ENABLED_VALUE 1U 900 #define SI32_I2C_A_I2CDMA_DMAEN_ENABLED_U32 \ 901 (SI32_I2C_A_I2CDMA_DMAEN_ENABLED_VALUE << SI32_I2C_A_I2CDMA_DMAEN_SHIFT) 902 903 904 905 typedef struct SI32_I2C_A_Struct 906 { 907 struct SI32_I2C_A_CONTROL_Struct CONTROL ; // Base Address + 0x0 908 volatile uint32_t CONTROL_SET; 909 volatile uint32_t CONTROL_CLR; 910 uint32_t reserved0; 911 struct SI32_I2C_A_CONFIG_Struct CONFIG ; // Base Address + 0x10 912 volatile uint32_t CONFIG_SET; 913 volatile uint32_t CONFIG_CLR; 914 uint32_t reserved1; 915 struct SI32_I2C_A_SADDRESS_Struct SADDRESS ; // Base Address + 0x20 916 uint32_t reserved2; 917 uint32_t reserved3; 918 uint32_t reserved4; 919 struct SI32_I2C_A_SMASK_Struct SMASK ; // Base Address + 0x30 920 uint32_t reserved5; 921 uint32_t reserved6; 922 uint32_t reserved7; 923 struct SI32_I2C_A_DATA_Struct DATA ; // Base Address + 0x40 924 uint32_t reserved8; 925 uint32_t reserved9; 926 uint32_t reserved10; 927 struct SI32_I2C_A_TIMER_Struct TIMER ; // Base Address + 0x50 928 uint32_t reserved11; 929 uint32_t reserved12; 930 uint32_t reserved13; 931 struct SI32_I2C_A_TIMERRL_Struct TIMERRL ; // Base Address + 0x60 932 uint32_t reserved14; 933 uint32_t reserved15; 934 uint32_t reserved16; 935 struct SI32_I2C_A_SCONFIG_Struct SCONFIG ; // Base Address + 0x70 936 uint32_t reserved17; 937 uint32_t reserved18; 938 uint32_t reserved19; 939 struct SI32_I2C_A_I2CDMA_Struct I2CDMA ; // Base Address + 0x80 940 uint32_t reserved20; 941 uint32_t reserved21; 942 uint32_t reserved22; 943 uint32_t reserved23[4]; 944 } SI32_I2C_A_Type; 945 946 #ifdef __cplusplus 947 } 948 #endif 949 950 #endif // __SI32_I2C_A_REGISTERS_H__ 951 952 //-eof-------------------------------------------------------------------------- 953 954