circuitpython/ports/mimxrt/boards/MIMXRT1021_af.csv
robert-hh 81f706aee4 mimxrt: Support PWM using the FLEXPWM and QTMR modules.
Frequency range 15Hz/18Hz to > 1 MHz, with decreasing resolution of the
duty cycle.  The basic API is supported as documentated, except that
keyword parameters are accepted for both the instatiaton and the
PWM.init() call.

Extensions: support PWM for channel pairs.  Channel pairs are declared by
supplying 2-element tuples for the pins.  The two channels of a pair must
be the A/B channel of a FLEXPWM module.  These form than a complementary
pair.

Additional supported keyword arguments:

- center=value Defines the center position of a pulse within the pulse
  cycle.  The align keyword is actually shortcut for center.

- sync=True|False: If set to True, the channels will be synchronized to a
  submodule 0 channel, which has already to be enabled.

- align=PWM.MIDDLE | PMW.BEGIN | PWM.END. It defines, whether synchronized
  channels are Center-Aligned or Edge-aligned.  The channels must be either
  complementary a channel pair or a group of synchronized channels.  It may
  as well be applied to a single channel, but withiout any benefit.

- invert= 0..3. Controls ouput inversion of the pins.  Bit 0 controls the
  first pin, bit 1 the second.

- deadtime=time_ns time of complementary channels for delaying the rising
  slope.

- xor=0|1|2 xor causes the output of channel A and B to be xored.  If
  applied to a X channel, it shows the value oif A ^ B.  If applied to an A
  or B channel, both channel show the xored signal for xor=1.  For xor=2,
  the xored signal is split between channels A and B.  See also the
  Reference Manual, chapter about double pulses.  The behavior of xor=2 can
  also be achieved using the center method for locating a pulse within a
  clock period.

The output is enabled for board pins only.

CPU pins may still be used for FLEXPWM, e.g. as sync source, but the signal
will not be routed to the output.  That applies only to FLEXPWM pins.  The
use of QTMR pins which are not board pins will be rejected.

As part of this commit, the _WFE() statement is removed from
ticks_delay_us64() to prevent PWM glitching during calls to sleep().
2021-11-24 13:48:27 +11:00

11 KiB

1PadALT0ALT1ALT2ALT3ALT4ALT5ALT6ALT7ALT8ALT9ADCACMPDefault
2GPIO_AD_B0_00JTAG_TMSGPIO1_IO00USBPHY1_TSTI_TX_ENGPT1_COMPARE1ALT0
3GPIO_AD_B0_01JTAG_TCKGPIO1_IO01USBPHY1_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O1_D02GPIO1_IO29FLEXPWM1_PWM3_BADC1_IN13,ADC2_IN13ACMP2_IN6,ACMP2_OUTALT5
32GPIO_AD_B1_14LPI2C1_SCLACMP3_OUTLPSPI3_SDOENET_1588_EVENT0_OUTFLEXIO1_D01GPIO1_IO30ADC1_IN14,ADC2_IN14ACMP3_IN6,ACMP3_OUTALT5
33GPIO_AD_B1_15LPI2C1_SDAACMP4_OUTLPSPI3_SDIENET_1588_EVENT0_INFLEXIO1_D00GPIO1_IO31ADC1_IN15,ADC2_IN15ACMP4_IN6,ACMP4_OUTALT5
34GPIO_EMC_00SEMC_DA00TMR2_TIMER0LPUART4_CTS_BSPDIF_SR_CLKLPSPI2_SCKGPIO2_IO00FLEXCAN1_TXPIT_TRIGGER2ALT5
35GPIO_EMC_01SEMC_DA01TMR2_TIMER1LPUART4_RTS_BSPDIF_OUTLPSPI2_PCS0GPIO2_IO01FLEXCAN1_RXPIT_TRIGGER3ALT5
36GPIO_EMC_02SEMC_DA02TMR2_TIMER2LPUART4_TXDSPDIF_LOCKLPSPI2_SDOGPIO2_IO02LPI2C1_SCLALT5
37GPIO_EMC_03SEMC_DA03TMR2_TIMER3LPUART4_RXDSPDIF_EXT_CLKLPSPI2_SDIGPIO2_IO03LPI2C1_SDAALT5
38GPIO_EMC_04SEMC_DA04XBAR_INOUT04SPDIF_OUTSAI2_TX_BCLKFLEXIO1_D16GPIO2_IO04USBPHY1_TSTO_PLL_CLK20DIVALT5
39GPIO_EMC_05SEMC_DA05XBAR_INOUT05SPDIF_INSAI2_TX_SYNCFLEXIO1_D17GPIO2_IO05USBPHY1_TSTI_TX_HS_MODEALT5
40GPIO_EMC_06SEMC_DA06XBAR_INOUT06LPUART3_TXDSAI2_TX_DATAFLEXIO1_D18GPIO2_IO06USBPHY1_TSTI_TX_DNALT5
41GPIO_EMC_07SEMC_DA07XBAR_INOUT07LPUART3_RXDSAI2_RX_SYNCFLEXIO1_D19GPIO2_IO07USBPHY1_TSTO_RX_SQUELCHALT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1_RST_B_DEBGPIO2_IO30GPT2_COMPARE3FLEXPWM1_PWM2_XALT5
65GPIO_EMC_31SEMC_DM1FLEXPWM2_PWM2_BLPUART4_RTS_BSAI3_RX_DATAWDOG2_BGPIO2_IO31GPT2_CLKFLEXPWM1_PWM3_XALT5
66GPIO_EMC_32SEMC_DA08TMR1_TIMER0LPUART4_TXDSAI3_TX_DATALPSPI4_SCKGPIO3_IO00USBPHY1_TSTO_RX_FS_RXDREF_24M_OUTALT5
67GPIO_EMC_33SEMC_DA09TMR1_TIMER1LPUART4_RXDSAI3_TX_BCLKLPSPI4_PCS0GPIO3_IO01USBPHY1_TSTI_TX_DPSRC_TESTER_ACKALT5
68GPIO_EMC_34SEMC_DA10TMR1_TIMER2LPUART7_TXDSAI3_TX_SYNCLPSPI4_SDOGPIO3_IO02ENET_CRSALT5
69GPIO_EMC_35SEMC_DA11TMR1_TIMER3LPUART7_RXDUSDHC2_WPLPSPI4_SDIGPIO3_IO03ENET_COLALT5
70GPIO_EMC_36SEMC_DA12FLEXPWM2_PWM1_ALPUART5_CTS_BCCM_PMIC_RDYLPSPI4_PCS1GPIO3_IO04ENET_RX_CLKUSDHC1_WPALT5
71GPIO_EMC_37SEMC_DA13FLEXPWM2_PWM1_BLPUART5_RTS_BMQS_RIGHTLPSPI4_PCS2GPIO3_IO05ENET_RX_DATA3USDHC1_VSELECTALT5
72GPIO_EMC_38SEMC_DA14FLEXPWM2_PWM0_ALPUART5_TXDMQS_LEFTLPSPI4_PCS3GPIO3_IO06ENET_RX_DATA2USDHC1_CD_BALT5
73GPIO_EMC_39SEMC_DA15FLEXPWM2_PWM0_BLPUART5_RXDUSB_OTG1_OCWDOG1_BGPIO3_IO07ENET_TX_ERGPT1_CLKALT5
74GPIO_EMC_40SEMC_CSX0XBAR_INOUT18SPDIF_OUTUSB_OTG1_IDENET_MDIOGPIO3_IO08ENET_TX_DATA3GPT1_COMPARE3ALT5
75GPIO_EMC_41SEMC_RDYXBAR_INOUT19SPDIF_INUSB_OTG1_PWRENET_MDCGPIO3_IO09ENET_TX_DATA2GPT1_COMPARE2ALT5
76GPIO_SD_B0_00USDHC1_DATA2TMR1_TIMER0SAI1_MCLKSAI2_MCLKLPI2C3_SCLGPIO3_IO13FLEXSPI_A_SS1_BXBAR_INOUT14ALT5
77GPIO_SD_B0_01USDHC1_DATA3TMR1_TIMER1REF_24M_OUTSAI2_RX_SYNCLPI2C3_SDAGPIO3_IO14FLEXSPI_B_SS1_BXBAR_INOUT15ALT5
78GPIO_SD_B0_02USDHC1_CMDTMR1_TIMER2LPUART7_CTS_BSAI2_RX_BCLKLPSPI1_SCKGPIO3_IO15ENET_MDIOXBAR_INOUT16ALT5
79GPIO_SD_B0_03USDHC1_CLKTMR1_TIMER3LPUART7_RTS_BSAI2_RX_DATALPSPI1_PCS0GPIO3_IO16ENET_MDCALT5
80GPIO_SD_B0_04USDHC1_DATA0FLEXCAN2_TXLPUART7_TXDSAI2_TX_DATALPSPI1_SDOGPIO3_IO17FLEXSPI_B_SS0_BALT5
81GPIO_SD_B0_05USDHC1_DATA1FLEXCAN2_RXLPUART7_RXDSAI2_TX_BCLKLPSPI1_SDIGPIO3_IO18FLEXSPI_B_DQSALT5
82GPIO_SD_B0_06USDHC1_CD_BUSDHC1_RESET_BREF_32K_OUTSAI2_TX_SYNCWDOG1_BGPIO3_IO19XBAR_INOUT17ALT5
83GPIO_SD_B1_00USDHC2_DATA2FLEXSPI_B_DATA3LPUART6_TXDXBAR_INOUT10FLEXCAN1_TXGPIO3_IO20ALT5
84GPIO_SD_B1_01USDHC2_DATA3FLEXSPI_B_SCLKLPUART6_RXDFLEXSPI_A_SS1_BFLEXCAN1_RXGPIO3_IO21ALT5
85GPIO_SD_B1_02USDHC2_CMDFLEXSPI_B_DATA0LPUART8_TXDLPI2C4_SCLENET_1588_EVENT1_OUTGPIO3_IO22CCM_CLKO1ALT5
86GPIO_SD_B1_03USDHC2_CLKFLEXSPI_B_DATA2LPUART8_RXDLPI2C4_SDAENET_1588_EVENT1_INGPIO3_IO23CCM_CLKO2ALT5
87GPIO_SD_B1_04USDHC2_DATA0FLEXSPI_B_DATA1ENET_TX_CLKENET_REF_CLKEWM_OUT_BGPIO3_IO24CCM_WAITALT5
88GPIO_SD_B1_05USDHC2_DATA1FLEXSPI_A_DQSENET_RX_DATA1SAI3_MCLKFLEXSPI_B_SS0_BGPIO3_IO25CCM_PMIC_RDYALT5
89GPIO_SD_B1_06USDHC2_CD_BFLEXSPI_A_DATA3ENET_RX_DATA0SAI3_TX_BCLKLPSPI2_PCS0GPIO3_IO26CCM_STOPALT5
90GPIO_SD_B1_07USDHC2_RESET_BFLEXSPI_A_SCLKENET_RX_ENSAI3_TX_SYNCLPSPI2_SCKGPIO3_IO27ALT5
91GPIO_SD_B1_08USDHC2_DATA4FLEXSPI_A_DATA0ENET_RX_ERSAI3_TX_DATALPSPI2_SDOGPIO3_IO28ALT5
92GPIO_SD_B1_09USDHC2_DATA5FLEXSPI_A_DATA2ENET_TX_ENSAI3_RX_BCLKLPSPI2_SDIGPIO3_IO29CCM_REF_EN_BALT5
93GPIO_SD_B1_10USDHC2_DATA6FLEXSPI_A_DATA1ENET_TX_DATA0SAI3_RX_SYNCLPSPI2_PCS2GPIO3_IO30SRC_SYSTEM_RESETALT5
94GPIO_SD_B1_11USDHC2_DATA7FLEXSPI_A_SS0_BENET_TX_DATA1SAI3_RX_DATALPSPI2_PCS3GPIO3_IO31SRC_EARLY_RESETALT5