Browse Source

add some definitions for audio

teensy4-core
Frank 5 years ago
parent
commit
c15ff6369c
No account linked to committer's email address
1 changed files with 25 additions and 2 deletions
  1. +25
    -2
      teensy4/imxrt.h

+ 25
- 2
teensy4/imxrt.h View File

#define CCM_CMEOR_MOD_EN_OV_PIT ((uint32_t)(1<<6)) #define CCM_CMEOR_MOD_EN_OV_PIT ((uint32_t)(1<<6))
#define CCM_CMEOR_MOD_EN_OV_GPT ((uint32_t)(1<<5)) #define CCM_CMEOR_MOD_EN_OV_GPT ((uint32_t)(1<<5))


#define CCM_CSCMR1_SAI1_CLK_SEL_MASK (CCM_CSCMR1_SAI1_CLK_SEL(0x03))
#define CCM_CS1CDR_SAI1_CLK_PRED_MASK (CCM_CS1CDR_SAI1_CLK_PRED(0x07))
#define CCM_CS1CDR_SAI1_CLK_PODF_MASK (CCM_CS1CDR_SAI1_CLK_PODF(0x3f))
#define CCM_CSCMR1_SAI2_CLK_SEL_MASK (CCM_CSCMR1_SAI2_CLK_SEL(0x03))
#define CCM_CS2CDR_SAI2_CLK_PRED_MASK (CCM_CS2CDR_SAI2_CLK_PRED(0x07))
#define CCM_CS2CDR_SAI2_CLK_PODF_MASK (CCM_CS2CDR_SAI2_CLK_PODF(0x3f))
#define CCM_CSCMR1_SAI3_CLK_SEL_MASK (CCM_CSCMR1_SAI3_CLK_SEL(0x03))
#define CCM_CS1CDR_SAI3_CLK_PRED_MASK (CCM_CS1CDR_SAI3_CLK_PRED(0x07))
#define CCM_CS1CDR_SAI3_CLK_PODF_MASK (CCM_CS1CDR_SAI3_CLK_PODF(0x3f))
#define CCM_CDCDR_SPDIF0_CLK_SEL_MASK (CCM_CDCDR_SPDIF0_CLK_SEL(0x03))
#define CCM_CDCDR_SPDIF0_CLK_PRED_MASK (CCM_CDCDR_SPDIF0_CLK_PRED(0x07))
#define CCM_CDCDR_SPDIF0_CLK_PODF_MASK (CCM_CDCDR_SPDIF0_CLK_PODF(0x07))

// 18.8: page 752 // 18.8: page 752
#define IMXRT_CCM_ANALOG (*(IMXRT_REGISTER32_t *)0x400D8000) #define IMXRT_CCM_ANALOG (*(IMXRT_REGISTER32_t *)0x400D8000)
#define CCM_ANALOG_PLL_ARM (IMXRT_CCM_ANALOG.offset000) #define CCM_ANALOG_PLL_ARM (IMXRT_CCM_ANALOG.offset000)
#define CCM_ANALOG_PLL_SYS_ENABLE ((uint32_t)(1<<13)) #define CCM_ANALOG_PLL_SYS_ENABLE ((uint32_t)(1<<13))
#define CCM_ANALOG_PLL_SYS_POWERDOWN ((uint32_t)(1<<12)) #define CCM_ANALOG_PLL_SYS_POWERDOWN ((uint32_t)(1<<12))
#define CCM_ANALOG_PLL_SYS_DIV_SELECT ((uint32_t)(1<<1)) #define CCM_ANALOG_PLL_SYS_DIV_SELECT ((uint32_t)(1<<1))
#define CCM_ANALOG_PLL_AUDIO_POST_DIV_SELECT(n) ((uint32_t)(((n) & 0x03) <<19))
#define CCM_ANALOG_PLL_AUDIO_BYPASS ((uint32_t)(1<<16))
#define CCM_ANALOG_PLL_AUDIO_BYPASS_CLK_SRC(n) ((uint32_t)(((n) & 0x03) <<14))
#define CCM_ANALOG_PLL_AUDIO_ENABLE ((uint32_t)(1<<13))
#define CCM_ANALOG_PLL_AUDIO_POWERDOWN ((uint32_t)(1<<12))
#define CCM_ANALOG_PLL_AUDIO_DIV_SELECT(n) ((uint32_t)((n) & ((1<<6)-1)))

#define CCM_ANALOG_MISC2_DIV_MSB ((uint32_t)(1<<23))
#define CCM_ANALOG_MISC2_DIV_LSB ((uint32_t)(1<<15))

#define CCM_ANALOG_PLL_AUDIO_NUM_MASK (((1<<29)-1))
#define CCM_ANALOG_PLL_AUDIO_DENOM_MASK (((1<<29)-1))


// 19.7: page 810 // 19.7: page 810
#define IMXRT_CSI (*(IMXRT_REGISTER32_t *)0x402BC000) #define IMXRT_CSI (*(IMXRT_REGISTER32_t *)0x402BC000)
asm("dsb"); asm("dsb");
asm("isb"); asm("isb");
} }



Loading…
Cancel
Save