Browse Source

Improve I2C defines

teensy4-core
PaulStoffregen 6 years ago
parent
commit
35ddbd7a4f
1 changed files with 151 additions and 157 deletions
  1. +151
    -157
      teensy4/imxrt.h

+ 151
- 157
teensy4/imxrt.h View File

@@ -5127,172 +5127,166 @@ typedef struct {
#define LCDIF_PIGEON_11_2 (IMXRT_LCDIF_b.offset2E0)

// 37.4: page 2371
#if 0
typedef struct {
const uint32_t VERID;
const uint32_t PARAM;
const uint32_t unused1;
const uint32_t unused2;
volatile uint32_t MCR; (IMXRT_LPI2C1.offset010)
volatile uint32_t MSR; (IMXRT_LPI2C1.offset014)
volatile uint32_t MIER; (IMXRT_LPI2C1.offset018)
volatile uint32_t MDER; (IMXRT_LPI2C1.offset01C)
volatile uint32_t MCFGR0; (IMXRT_LPI2C1.offset020)
volatile uint32_t MCFGR1; (IMXRT_LPI2C1.offset024)
volatile uint32_t MCFGR2; (IMXRT_LPI2C1.offset028)
volatile uint32_t MCFGR3; (IMXRT_LPI2C1.offset02C)
volatile uint32_t MCR; // 010
volatile uint32_t MSR; // 014
volatile uint32_t MIER; // 018
volatile uint32_t MDER; // 01C
volatile uint32_t MCFGR0; // 020
volatile uint32_t MCFGR1; // 024
volatile uint32_t MCFGR2; // 028
volatile uint32_t MCFGR3; // 02C
volatile uint32_t unused3[4];
volatile uint32_t MDMR; (IMXRT_LPI2C1.offset040)
volatile uint32_t MDMR; // 040
volatile uint32_t unused4;
volatile uint32_t MCCR0 ; (IMXRT_LPI2C1.offset048)
volatile uint32_t unused4;
volatile uint32_t MCCR1; (IMXRT_LPI2C1.offset050)
volatile uint32_t unused4;
volatile uint32_t MFCR; (IMXRT_LPI2C1.offset058)
volatile uint32_t MFSR; (IMXRT_LPI2C1.offset05C)
volatile uint32_t MTDR; (IMXRT_LPI2C1.offset060)
volatile uint32_t unused4[3];
volatile uint32_t MRDR; (IMXRT_LPI2C1.offset070)
volatile uint32_t unused4[39];
volatile uint32_t SCR; (IMXRT_LPI2C1.offset110)
volatile uint32_t SSR; (IMXRT_LPI2C1.offset114)
volatile uint32_t SIER; (IMXRT_LPI2C1.offset118)
volatile uint32_t SDER; (IMXRT_LPI2C1.offset11C)
volatile uint32_t unused4;
volatile uint32_t SCFGR1; (IMXRT_LPI2C1.offset124)
volatile uint32_t SCFGR2; (IMXRT_LPI2C1.offset128)
volatile uint32_t unused4[5];
volatile uint32_t SAMR; (IMXRT_LPI2C1.offset140)
volatile uint32_t unused4[3];
volatile uint32_t SASR; (IMXRT_LPI2C1.offset150)
volatile uint32_t unused4[3];
volatile uint32_t STAR; (IMXRT_LPI2C1.offset154)
volatile uint32_t unused4[3];
volatile uint32_t STDR; (IMXRT_LPI2C1.offset160)
volatile uint32_t unused4[3];
volatile uint32_t SRDR; (IMXRT_LPI2C1.offset170)
volatile uint32_t MCCR0; // 048
volatile uint32_t unused5;
volatile uint32_t MCCR1; // 050
volatile uint32_t unused6;
volatile uint32_t MFCR; // 058
volatile uint32_t MFSR; // 05C
volatile uint32_t MTDR; // 060
volatile uint32_t unused7[3];
volatile uint32_t MRDR; // 070
volatile uint32_t unused8[39];
volatile uint32_t SCR; // 110
volatile uint32_t SSR; // 114
volatile uint32_t SIER; // 118
volatile uint32_t SDER; // 11C
volatile uint32_t unused9;
volatile uint32_t SCFGR1; // 124
volatile uint32_t SCFGR2; // 128
volatile uint32_t unused10[5];
volatile uint32_t SAMR; // 140
volatile uint32_t unused11[3];
volatile uint32_t SASR; // 150
volatile uint32_t unused12[3];
volatile uint32_t STAR; // 154
volatile uint32_t unused13[3];
volatile uint32_t STDR; // 160
volatile uint32_t unused14[3];
volatile uint32_t SRDR; // 170
} IMXRT_LPI2C_t;
#define IMXRT_LPI2C1 (*(IMXRT_LPI2C_t *)0x403F0000)

#else

#define IMXRT_LPI2C1 (*(IMXRT_REGISTER32_t *)0x403F0000)
#define LPI2C1_VERID (IMXRT_LPI2C1.offset000)
#define LPI2C1_PARAM (IMXRT_LPI2C1.offset004)
#define LPI2C1_MCR (IMXRT_LPI2C1.offset010)
#define LPI2C1_MSR (IMXRT_LPI2C1.offset014)
#define LPI2C1_MIER (IMXRT_LPI2C1.offset018)
#define LPI2C1_MDER (IMXRT_LPI2C1.offset01C)
#define LPI2C1_MCFGR0 (IMXRT_LPI2C1.offset020)
#define LPI2C1_MCFGR1 (IMXRT_LPI2C1.offset024)
#define LPI2C1_MCFGR2 (IMXRT_LPI2C1.offset028)
#define LPI2C1_MCFGR3 (IMXRT_LPI2C1.offset02C)
#define LPI2C1_MDMR (IMXRT_LPI2C1.offset040)
#define LPI2C1_MCCR0 (IMXRT_LPI2C1.offset048)
#define LPI2C1_MCCR1 (IMXRT_LPI2C1.offset050)
#define LPI2C1_MFCR (IMXRT_LPI2C1.offset058)
#define LPI2C1_MFSR (IMXRT_LPI2C1.offset05C)
#define LPI2C1_MTDR (IMXRT_LPI2C1.offset060)
#define LPI2C1_MRDR (IMXRT_LPI2C1.offset070)
#define LPI2C1_SCR (IMXRT_LPI2C1.offset110)
#define LPI2C1_SSR (IMXRT_LPI2C1.offset114)
#define LPI2C1_SIER (IMXRT_LPI2C1.offset118)
#define LPI2C1_SDER (IMXRT_LPI2C1.offset11C)
#define LPI2C1_SCFGR1 (IMXRT_LPI2C1.offset124)
#define LPI2C1_SCFGR2 (IMXRT_LPI2C1.offset128)
#define LPI2C1_SAMR (IMXRT_LPI2C1.offset140)
#define LPI2C1_SASR (IMXRT_LPI2C1.offset150)
#define LPI2C1_STAR (IMXRT_LPI2C1.offset154)
#define LPI2C1_STDR (IMXRT_LPI2C1.offset160)
#define LPI2C1_SRDR (IMXRT_LPI2C1.offset170)
#define IMXRT_LPI2C2 (*(IMXRT_REGISTER32_t *)0x403F4000)
#define LPI2C2_VERID (IMXRT_LPI2C2.offset000)
#define LPI2C2_PARAM (IMXRT_LPI2C2.offset004)
#define LPI2C2_MCR (IMXRT_LPI2C2.offset010)
#define LPI2C2_MSR (IMXRT_LPI2C2.offset014)
#define LPI2C2_MIER (IMXRT_LPI2C2.offset018)
#define LPI2C2_MDER (IMXRT_LPI2C2.offset01C)
#define LPI2C2_MCFGR0 (IMXRT_LPI2C2.offset020)
#define LPI2C2_MCFGR1 (IMXRT_LPI2C2.offset024)
#define LPI2C2_MCFGR2 (IMXRT_LPI2C2.offset028)
#define LPI2C2_MCFGR3 (IMXRT_LPI2C2.offset02C)
#define LPI2C2_MDMR (IMXRT_LPI2C2.offset040)
#define LPI2C2_MCCR0 (IMXRT_LPI2C2.offset048)
#define LPI2C2_MCCR1 (IMXRT_LPI2C2.offset050)
#define LPI2C2_MFCR (IMXRT_LPI2C2.offset058)
#define LPI2C2_MFSR (IMXRT_LPI2C2.offset05C)
#define LPI2C2_MTDR (IMXRT_LPI2C2.offset060)
#define LPI2C2_MRDR (IMXRT_LPI2C2.offset070)
#define LPI2C2_SCR (IMXRT_LPI2C2.offset110)
#define LPI2C2_SSR (IMXRT_LPI2C2.offset114)
#define LPI2C2_SIER (IMXRT_LPI2C2.offset118)
#define LPI2C2_SDER (IMXRT_LPI2C2.offset11C)
#define LPI2C2_SCFGR1 (IMXRT_LPI2C2.offset124)
#define LPI2C2_SCFGR2 (IMXRT_LPI2C2.offset128)
#define LPI2C2_SAMR (IMXRT_LPI2C2.offset140)
#define LPI2C2_SASR (IMXRT_LPI2C2.offset150)
#define LPI2C2_STAR (IMXRT_LPI2C2.offset154)
#define LPI2C2_STDR (IMXRT_LPI2C2.offset160)
#define LPI2C2_SRDR (IMXRT_LPI2C2.offset170)
#define IMXRT_LPI2C3 (*(IMXRT_REGISTER32_t *)0x403F8000)
#define LPI2C3_VERID (IMXRT_LPI2C3.offset000)
#define LPI2C3_PARAM (IMXRT_LPI2C3.offset004)
#define LPI2C3_MCR (IMXRT_LPI2C3.offset010)
#define LPI2C3_MSR (IMXRT_LPI2C3.offset014)
#define LPI2C3_MIER (IMXRT_LPI2C3.offset018)
#define LPI2C3_MDER (IMXRT_LPI2C3.offset01C)
#define LPI2C3_MCFGR0 (IMXRT_LPI2C3.offset020)
#define LPI2C3_MCFGR1 (IMXRT_LPI2C3.offset024)
#define LPI2C3_MCFGR2 (IMXRT_LPI2C3.offset028)
#define LPI2C3_MCFGR3 (IMXRT_LPI2C3.offset02C)
#define LPI2C3_MDMR (IMXRT_LPI2C3.offset040)
#define LPI2C3_MCCR0 (IMXRT_LPI2C3.offset048)
#define LPI2C3_MCCR1 (IMXRT_LPI2C3.offset050)
#define LPI2C3_MFCR (IMXRT_LPI2C3.offset058)
#define LPI2C3_MFSR (IMXRT_LPI2C3.offset05C)
#define LPI2C3_MTDR (IMXRT_LPI2C3.offset060)
#define LPI2C3_MRDR (IMXRT_LPI2C3.offset070)
#define LPI2C3_SCR (IMXRT_LPI2C3.offset110)
#define LPI2C3_SSR (IMXRT_LPI2C3.offset114)
#define LPI2C3_SIER (IMXRT_LPI2C3.offset118)
#define LPI2C3_SDER (IMXRT_LPI2C3.offset11C)
#define LPI2C3_SCFGR1 (IMXRT_LPI2C3.offset124)
#define LPI2C3_SCFGR2 (IMXRT_LPI2C3.offset128)
#define LPI2C3_SAMR (IMXRT_LPI2C3.offset140)
#define LPI2C3_SASR (IMXRT_LPI2C3.offset150)
#define LPI2C3_STAR (IMXRT_LPI2C3.offset154)
#define LPI2C3_STDR (IMXRT_LPI2C3.offset160)
#define LPI2C3_SRDR (IMXRT_LPI2C3.offset170)
#define IMXRT_LPI2C4 (*(IMXRT_REGISTER32_t *)0x403FC000)
#define LPI2C4_VERID (IMXRT_LPI2C4.offset000)
#define LPI2C4_PARAM (IMXRT_LPI2C4.offset004)
#define LPI2C4_MCR (IMXRT_LPI2C4.offset010)
#define LPI2C4_MSR (IMXRT_LPI2C4.offset014)
#define LPI2C4_MIER (IMXRT_LPI2C4.offset018)
#define LPI2C4_MDER (IMXRT_LPI2C4.offset01C)
#define LPI2C4_MCFGR0 (IMXRT_LPI2C4.offset020)
#define LPI2C4_MCFGR1 (IMXRT_LPI2C4.offset024)
#define LPI2C4_MCFGR2 (IMXRT_LPI2C4.offset028)
#define LPI2C4_MCFGR3 (IMXRT_LPI2C4.offset02C)
#define LPI2C4_MDMR (IMXRT_LPI2C4.offset040)
#define LPI2C4_MCCR0 (IMXRT_LPI2C4.offset048)
#define LPI2C4_MCCR1 (IMXRT_LPI2C4.offset050)
#define LPI2C4_MFCR (IMXRT_LPI2C4.offset058)
#define LPI2C4_MFSR (IMXRT_LPI2C4.offset05C)
#define LPI2C4_MTDR (IMXRT_LPI2C4.offset060)
#define LPI2C4_MRDR (IMXRT_LPI2C4.offset070)
#define LPI2C4_SCR (IMXRT_LPI2C4.offset110)
#define LPI2C4_SSR (IMXRT_LPI2C4.offset114)
#define LPI2C4_SIER (IMXRT_LPI2C4.offset118)
#define LPI2C4_SDER (IMXRT_LPI2C4.offset11C)
#define LPI2C4_SCFGR1 (IMXRT_LPI2C4.offset124)
#define LPI2C4_SCFGR2 (IMXRT_LPI2C4.offset128)
#define LPI2C4_SAMR (IMXRT_LPI2C4.offset140)
#define LPI2C4_SASR (IMXRT_LPI2C4.offset150)
#define LPI2C4_STAR (IMXRT_LPI2C4.offset154)
#define LPI2C4_STDR (IMXRT_LPI2C4.offset160)
#define LPI2C4_SRDR (IMXRT_LPI2C4.offset170)
#endif
#define LPI2C1_VERID (IMXRT_LPI2C1.VERID)
#define LPI2C1_PARAM (IMXRT_LPI2C1.PARAM)
#define LPI2C1_MCR (IMXRT_LPI2C1.MCR)
#define LPI2C1_MSR (IMXRT_LPI2C1.MSR)
#define LPI2C1_MIER (IMXRT_LPI2C1.MIER)
#define LPI2C1_MDER (IMXRT_LPI2C1.MDER)
#define LPI2C1_MCFGR0 (IMXRT_LPI2C1.MCFGR0)
#define LPI2C1_MCFGR1 (IMXRT_LPI2C1.MCFGR1)
#define LPI2C1_MCFGR2 (IMXRT_LPI2C1.MCFGR2)
#define LPI2C1_MCFGR3 (IMXRT_LPI2C1.MCFGR3)
#define LPI2C1_MDMR (IMXRT_LPI2C1.MDMR)
#define LPI2C1_MCCR0 (IMXRT_LPI2C1.MCCR0)
#define LPI2C1_MCCR1 (IMXRT_LPI2C1.MCCR1)
#define LPI2C1_MFCR (IMXRT_LPI2C1.MFCR)
#define LPI2C1_MFSR (IMXRT_LPI2C1.MFSR)
#define LPI2C1_MTDR (IMXRT_LPI2C1.MTDR)
#define LPI2C1_MRDR (IMXRT_LPI2C1.MRDR)
#define LPI2C1_SCR (IMXRT_LPI2C1.SCR)
#define LPI2C1_SSR (IMXRT_LPI2C1.SSR)
#define LPI2C1_SIER (IMXRT_LPI2C1.SIER)
#define LPI2C1_SDER (IMXRT_LPI2C1.SDER)
#define LPI2C1_SCFGR1 (IMXRT_LPI2C1.SCFGR1)
#define LPI2C1_SCFGR2 (IMXRT_LPI2C1.SCFGR2)
#define LPI2C1_SAMR (IMXRT_LPI2C1.SAMR)
#define LPI2C1_SASR (IMXRT_LPI2C1.SASR)
#define LPI2C1_STAR (IMXRT_LPI2C1.STAR)
#define LPI2C1_STDR (IMXRT_LPI2C1.STDR)
#define LPI2C1_SRDR (IMXRT_LPI2C1.SRDR)
#define IMXRT_LPI2C2 (*(IMXRT_LPI2C_t *)0x403F4000)
#define LPI2C2_VERID (IMXRT_LPI2C2.VERID)
#define LPI2C2_PARAM (IMXRT_LPI2C2.PARAM)
#define LPI2C2_MCR (IMXRT_LPI2C2.MCR)
#define LPI2C2_MSR (IMXRT_LPI2C2.MSR)
#define LPI2C2_MIER (IMXRT_LPI2C2.MIER)
#define LPI2C2_MDER (IMXRT_LPI2C2.MDER)
#define LPI2C2_MCFGR0 (IMXRT_LPI2C2.MCFGR0)
#define LPI2C2_MCFGR1 (IMXRT_LPI2C2.MCFGR1)
#define LPI2C2_MCFGR2 (IMXRT_LPI2C2.MCFGR2)
#define LPI2C2_MCFGR3 (IMXRT_LPI2C2.MCFGR3)
#define LPI2C2_MDMR (IMXRT_LPI2C2.MDMR)
#define LPI2C2_MCCR0 (IMXRT_LPI2C2.MCCR0)
#define LPI2C2_MCCR1 (IMXRT_LPI2C2.MCCR1)
#define LPI2C2_MFCR (IMXRT_LPI2C2.MFCR)
#define LPI2C2_MFSR (IMXRT_LPI2C2.MFSR)
#define LPI2C2_MTDR (IMXRT_LPI2C2.MTDR)
#define LPI2C2_MRDR (IMXRT_LPI2C2.MRDR)
#define LPI2C2_SCR (IMXRT_LPI2C2.SCR)
#define LPI2C2_SSR (IMXRT_LPI2C2.SSR)
#define LPI2C2_SIER (IMXRT_LPI2C2.SIER)
#define LPI2C2_SDER (IMXRT_LPI2C2.SDER)
#define LPI2C2_SCFGR1 (IMXRT_LPI2C2.SCFGR1)
#define LPI2C2_SCFGR2 (IMXRT_LPI2C2.SCFGR2)
#define LPI2C2_SAMR (IMXRT_LPI2C2.SAMR)
#define LPI2C2_SASR (IMXRT_LPI2C2.SASR)
#define LPI2C2_STAR (IMXRT_LPI2C2.STAR)
#define LPI2C2_STDR (IMXRT_LPI2C2.STDR)
#define LPI2C2_SRDR (IMXRT_LPI2C2.SRDR)
#define IMXRT_LPI2C3 (*(IMXRT_LPI2C_t *)0x403F8000)
#define LPI2C3_VERID (IMXRT_LPI2C3.VERID)
#define LPI2C3_PARAM (IMXRT_LPI2C3.PARAM)
#define LPI2C3_MCR (IMXRT_LPI2C3.MCR)
#define LPI2C3_MSR (IMXRT_LPI2C3.MSR)
#define LPI2C3_MIER (IMXRT_LPI2C3.MIER)
#define LPI2C3_MDER (IMXRT_LPI2C3.MDER)
#define LPI2C3_MCFGR0 (IMXRT_LPI2C3.MCFGR0)
#define LPI2C3_MCFGR1 (IMXRT_LPI2C3.MCFGR1)
#define LPI2C3_MCFGR2 (IMXRT_LPI2C3.MCFGR2)
#define LPI2C3_MCFGR3 (IMXRT_LPI2C3.MCFGR3)
#define LPI2C3_MDMR (IMXRT_LPI2C3.MDMR)
#define LPI2C3_MCCR0 (IMXRT_LPI2C3.MCCR0)
#define LPI2C3_MCCR1 (IMXRT_LPI2C3.MCCR1)
#define LPI2C3_MFCR (IMXRT_LPI2C3.MFCR)
#define LPI2C3_MFSR (IMXRT_LPI2C3.MFSR)
#define LPI2C3_MTDR (IMXRT_LPI2C3.MTDR)
#define LPI2C3_MRDR (IMXRT_LPI2C3.MRDR)
#define LPI2C3_SCR (IMXRT_LPI2C3.SCR)
#define LPI2C3_SSR (IMXRT_LPI2C3.SSR)
#define LPI2C3_SIER (IMXRT_LPI2C3.SIER)
#define LPI2C3_SDER (IMXRT_LPI2C3.SDER)
#define LPI2C3_SCFGR1 (IMXRT_LPI2C3.SCFGR1)
#define LPI2C3_SCFGR2 (IMXRT_LPI2C3.SCFGR2)
#define LPI2C3_SAMR (IMXRT_LPI2C3.SAMR)
#define LPI2C3_SASR (IMXRT_LPI2C3.SASR)
#define LPI2C3_STAR (IMXRT_LPI2C3.STAR)
#define LPI2C3_STDR (IMXRT_LPI2C3.STDR)
#define LPI2C3_SRDR (IMXRT_LPI2C3.SRDR)
#define IMXRT_LPI2C4 (*(IMXRT_LPI2C_t *)0x403FC000)
#define LPI2C4_VERID (IMXRT_LPI2C4.VERID)
#define LPI2C4_PARAM (IMXRT_LPI2C4.PARAM)
#define LPI2C4_MCR (IMXRT_LPI2C4.MCR)
#define LPI2C4_MSR (IMXRT_LPI2C4.MSR)
#define LPI2C4_MIER (IMXRT_LPI2C4.MIER)
#define LPI2C4_MDER (IMXRT_LPI2C4.MDER)
#define LPI2C4_MCFGR0 (IMXRT_LPI2C4.MCFGR0)
#define LPI2C4_MCFGR1 (IMXRT_LPI2C4.MCFGR1)
#define LPI2C4_MCFGR2 (IMXRT_LPI2C4.MCFGR2)
#define LPI2C4_MCFGR3 (IMXRT_LPI2C4.MCFGR3)
#define LPI2C4_MDMR (IMXRT_LPI2C4.MDMR)
#define LPI2C4_MCCR0 (IMXRT_LPI2C4.MCCR0)
#define LPI2C4_MCCR1 (IMXRT_LPI2C4.MCCR1)
#define LPI2C4_MFCR (IMXRT_LPI2C4.MFCR)
#define LPI2C4_MFSR (IMXRT_LPI2C4.MFSR)
#define LPI2C4_MTDR (IMXRT_LPI2C4.MTDR)
#define LPI2C4_MRDR (IMXRT_LPI2C4.MRDR)
#define LPI2C4_SCR (IMXRT_LPI2C4.SCR)
#define LPI2C4_SSR (IMXRT_LPI2C4.SSR)
#define LPI2C4_SIER (IMXRT_LPI2C4.SIER)
#define LPI2C4_SDER (IMXRT_LPI2C4.SDER)
#define LPI2C4_SCFGR1 (IMXRT_LPI2C4.SCFGR1)
#define LPI2C4_SCFGR2 (IMXRT_LPI2C4.SCFGR2)
#define LPI2C4_SAMR (IMXRT_LPI2C4.SAMR)
#define LPI2C4_SASR (IMXRT_LPI2C4.SASR)
#define LPI2C4_STAR (IMXRT_LPI2C4.STAR)
#define LPI2C4_STDR (IMXRT_LPI2C4.STDR)
#define LPI2C4_SRDR (IMXRT_LPI2C4.SRDR)
#define LPI2C_MCR_RRF ((uint32_t)(1<<9))
#define LPI2C_MCR_RTF ((uint32_t)(1<<8))
#define LPI2C_MCR_DBGEN ((uint32_t)(1<<3))

Loading…
Cancel
Save