#[cfg(feature = "rt")]
extern "C" {
    fn DMA0_DMA16();
    fn DMA1_DMA17();
    fn DMA2_DMA18();
    fn DMA3_DMA19();
    fn DMA4_DMA20();
    fn DMA5_DMA21();
    fn DMA6_DMA22();
    fn DMA7_DMA23();
    fn DMA8_DMA24();
    fn DMA9_DMA25();
    fn DMA10_DMA26();
    fn DMA11_DMA27();
    fn DMA12_DMA28();
    fn DMA13_DMA29();
    fn DMA14_DMA30();
    fn DMA15_DMA31();
    fn DMA_ERROR();
    fn LPUART1();
    fn LPUART2();
    fn LPUART3();
    fn LPUART4();
    fn LPUART5();
    fn LPUART6();
    fn LPUART7();
    fn LPUART8();
    fn LPI2C1();
    fn LPI2C2();
    fn LPI2C3();
    fn LPI2C4();
    fn LPSPI1();
    fn LPSPI2();
    fn LPSPI3();
    fn LPSPI4();
    fn CAN1();
    fn CAN2();
    fn FLEXRAM();
    fn KPP();
    fn GPR_IRQ();
    fn WDOG2();
    fn SNVS_HP_WRAPPER();
    fn SNVS_HP_WRAPPER_TZ();
    fn SNVS_LP_WRAPPER();
    fn CSU();
    fn DCP();
    fn DCP_VMI();
    fn TRNG();
    fn BEE();
    fn SAI1();
    fn SAI2();
    fn SAI3_RX();
    fn SAI3_TX();
    fn SPDIF();
    fn PMU();
    fn TEMP_LOW_HIGH();
    fn TEMP_PANIC();
    fn USB_PHY();
    fn ADC1();
    fn ADC2();
    fn DCDC();
    fn GPIO1_INT0();
    fn GPIO1_INT1();
    fn GPIO1_INT2();
    fn GPIO1_INT3();
    fn GPIO1_INT4();
    fn GPIO1_INT5();
    fn GPIO1_INT6();
    fn GPIO1_INT7();
    fn GPIO1_Combined_0_15();
    fn GPIO1_Combined_16_31();
    fn GPIO2_Combined_0_15();
    fn GPIO2_Combined_16_31();
    fn GPIO3_Combined_0_15();
    fn GPIO3_Combined_16_31();
    fn GPIO5_Combined_0_15();
    fn GPIO5_Combined_16_31();
    fn FLEXIO1();
    fn WDOG1();
    fn RTWDOG();
    fn EWM();
    fn CCM_1();
    fn CCM_2();
    fn GPC();
    fn SRC();
    fn GPT1();
    fn GPT2();
    fn PWM1_0();
    fn PWM1_1();
    fn PWM1_2();
    fn PWM1_3();
    fn PWM1_FAULT();
    fn FLEXSPI();
    fn SEMC();
    fn USDHC1();
    fn USDHC2();
    fn USB_OTG1();
    fn ENET();
    fn ENET_1588_Timer();
    fn XBAR1_IRQ_0_1();
    fn XBAR1_IRQ_2_3();
    fn ADC_ETC_IRQ0();
    fn ADC_ETC_IRQ1();
    fn ADC_ETC_IRQ2();
    fn ADC_ETC_ERROR_IRQ();
    fn PIT();
    fn ACMP1();
    fn ACMP2();
    fn ACMP3();
    fn ACMP4();
    fn ENC1();
    fn ENC2();
    fn TMR1();
    fn TMR2();
    fn PWM2_0();
    fn PWM2_1();
    fn PWM2_2();
    fn PWM2_3();
    fn PWM2_FAULT();
}

#[doc(hidden)]
pub union Vector {
    _handler: unsafe extern "C" fn(),
    _reserved: u32,
}

#[cfg(feature = "rt")]
#[doc(hidden)]
#[cfg_attr(target_arch = "arm", link_section = ".vector_table.interrupts")]
#[no_mangle]
pub static __INTERRUPTS: [Vector; 142] = [
    Vector {
        _handler: DMA0_DMA16,
    },
    Vector {
        _handler: DMA1_DMA17,
    },
    Vector {
        _handler: DMA2_DMA18,
    },
    Vector {
        _handler: DMA3_DMA19,
    },
    Vector {
        _handler: DMA4_DMA20,
    },
    Vector {
        _handler: DMA5_DMA21,
    },
    Vector {
        _handler: DMA6_DMA22,
    },
    Vector {
        _handler: DMA7_DMA23,
    },
    Vector {
        _handler: DMA8_DMA24,
    },
    Vector {
        _handler: DMA9_DMA25,
    },
    Vector {
        _handler: DMA10_DMA26,
    },
    Vector {
        _handler: DMA11_DMA27,
    },
    Vector {
        _handler: DMA12_DMA28,
    },
    Vector {
        _handler: DMA13_DMA29,
    },
    Vector {
        _handler: DMA14_DMA30,
    },
    Vector {
        _handler: DMA15_DMA31,
    },
    Vector {
        _handler: DMA_ERROR,
    },
    Vector { _reserved: 0 },
    Vector { _reserved: 0 },
    Vector { _reserved: 0 },
    Vector { _handler: LPUART1 },
    Vector { _handler: LPUART2 },
    Vector { _handler: LPUART3 },
    Vector { _handler: LPUART4 },
    Vector { _handler: LPUART5 },
    Vector { _handler: LPUART6 },
    Vector { _handler: LPUART7 },
    Vector { _handler: LPUART8 },
    Vector { _handler: LPI2C1 },
    Vector { _handler: LPI2C2 },
    Vector { _handler: LPI2C3 },
    Vector { _handler: LPI2C4 },
    Vector { _handler: LPSPI1 },
    Vector { _handler: LPSPI2 },
    Vector { _handler: LPSPI3 },
    Vector { _handler: LPSPI4 },
    Vector { _handler: CAN1 },
    Vector { _handler: CAN2 },
    Vector { _handler: FLEXRAM },
    Vector { _handler: KPP },
    Vector { _reserved: 0 },
    Vector { _handler: GPR_IRQ },
    Vector { _reserved: 0 },
    Vector { _reserved: 0 },
    Vector { _reserved: 0 },
    Vector { _handler: WDOG2 },
    Vector {
        _handler: SNVS_HP_WRAPPER,
    },
    Vector {
        _handler: SNVS_HP_WRAPPER_TZ,
    },
    Vector {
        _handler: SNVS_LP_WRAPPER,
    },
    Vector { _handler: CSU },
    Vector { _handler: DCP },
    Vector { _handler: DCP_VMI },
    Vector { _reserved: 0 },
    Vector { _handler: TRNG },
    Vector { _reserved: 0 },
    Vector { _handler: BEE },
    Vector { _handler: SAI1 },
    Vector { _handler: SAI2 },
    Vector { _handler: SAI3_RX },
    Vector { _handler: SAI3_TX },
    Vector { _handler: SPDIF },
    Vector { _handler: PMU },
    Vector { _reserved: 0 },
    Vector {
        _handler: TEMP_LOW_HIGH,
    },
    Vector {
        _handler: TEMP_PANIC,
    },
    Vector { _handler: USB_PHY },
    Vector { _reserved: 0 },
    Vector { _handler: ADC1 },
    Vector { _handler: ADC2 },
    Vector { _handler: DCDC },
    Vector { _reserved: 0 },
    Vector { _reserved: 0 },
    Vector {
        _handler: GPIO1_INT0,
    },
    Vector {
        _handler: GPIO1_INT1,
    },
    Vector {
        _handler: GPIO1_INT2,
    },
    Vector {
        _handler: GPIO1_INT3,
    },
    Vector {
        _handler: GPIO1_INT4,
    },
    Vector {
        _handler: GPIO1_INT5,
    },
    Vector {
        _handler: GPIO1_INT6,
    },
    Vector {
        _handler: GPIO1_INT7,
    },
    Vector {
        _handler: GPIO1_Combined_0_15,
    },
    Vector {
        _handler: GPIO1_Combined_16_31,
    },
    Vector {
        _handler: GPIO2_Combined_0_15,
    },
    Vector {
        _handler: GPIO2_Combined_16_31,
    },
    Vector {
        _handler: GPIO3_Combined_0_15,
    },
    Vector {
        _handler: GPIO3_Combined_16_31,
    },
    Vector { _reserved: 0 },
    Vector { _reserved: 0 },
    Vector {
        _handler: GPIO5_Combined_0_15,
    },
    Vector {
        _handler: GPIO5_Combined_16_31,
    },
    Vector { _handler: FLEXIO1 },
    Vector { _reserved: 0 },
    Vector { _handler: WDOG1 },
    Vector { _handler: RTWDOG },
    Vector { _handler: EWM },
    Vector { _handler: CCM_1 },
    Vector { _handler: CCM_2 },
    Vector { _handler: GPC },
    Vector { _handler: SRC },
    Vector { _reserved: 0 },
    Vector { _handler: GPT1 },
    Vector { _handler: GPT2 },
    Vector { _handler: PWM1_0 },
    Vector { _handler: PWM1_1 },
    Vector { _handler: PWM1_2 },
    Vector { _handler: PWM1_3 },
    Vector {
        _handler: PWM1_FAULT,
    },
    Vector { _reserved: 0 },
    Vector { _handler: FLEXSPI },
    Vector { _handler: SEMC },
    Vector { _handler: USDHC1 },
    Vector { _handler: USDHC2 },
    Vector { _reserved: 0 },
    Vector { _handler: USB_OTG1 },
    Vector { _handler: ENET },
    Vector {
        _handler: ENET_1588_Timer,
    },
    Vector {
        _handler: XBAR1_IRQ_0_1,
    },
    Vector {
        _handler: XBAR1_IRQ_2_3,
    },
    Vector {
        _handler: ADC_ETC_IRQ0,
    },
    Vector {
        _handler: ADC_ETC_IRQ1,
    },
    Vector {
        _handler: ADC_ETC_IRQ2,
    },
    Vector {
        _handler: ADC_ETC_ERROR_IRQ,
    },
    Vector { _handler: PIT },
    Vector { _handler: ACMP1 },
    Vector { _handler: ACMP2 },
    Vector { _handler: ACMP3 },
    Vector { _handler: ACMP4 },
    Vector { _reserved: 0 },
    Vector { _reserved: 0 },
    Vector { _handler: ENC1 },
    Vector { _handler: ENC2 },
    Vector { _reserved: 0 },
    Vector { _reserved: 0 },
    Vector { _handler: TMR1 },
    Vector { _handler: TMR2 },
    Vector { _reserved: 0 },
    Vector { _reserved: 0 },
    Vector { _handler: PWM2_0 },
    Vector { _handler: PWM2_1 },
    Vector { _handler: PWM2_2 },
    Vector { _handler: PWM2_3 },
    Vector {
        _handler: PWM2_FAULT,
    },
];

/// Available interrupts for this device
#[repr(u8)]
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
#[allow(non_camel_case_types)]
pub enum Interrupt {
    /// 0:
    DMA0_DMA16 = 0,
    /// 1:
    DMA1_DMA17 = 1,
    /// 2:
    DMA2_DMA18 = 2,
    /// 3:
    DMA3_DMA19 = 3,
    /// 4:
    DMA4_DMA20 = 4,
    /// 5:
    DMA5_DMA21 = 5,
    /// 6:
    DMA6_DMA22 = 6,
    /// 7:
    DMA7_DMA23 = 7,
    /// 8:
    DMA8_DMA24 = 8,
    /// 9:
    DMA9_DMA25 = 9,
    /// 10:
    DMA10_DMA26 = 10,
    /// 11:
    DMA11_DMA27 = 11,
    /// 12:
    DMA12_DMA28 = 12,
    /// 13:
    DMA13_DMA29 = 13,
    /// 14:
    DMA14_DMA30 = 14,
    /// 15:
    DMA15_DMA31 = 15,
    /// 16:
    DMA_ERROR = 16,
    /// 20:
    LPUART1 = 20,
    /// 21:
    LPUART2 = 21,
    /// 22:
    LPUART3 = 22,
    /// 23:
    LPUART4 = 23,
    /// 24:
    LPUART5 = 24,
    /// 25:
    LPUART6 = 25,
    /// 26:
    LPUART7 = 26,
    /// 27:
    LPUART8 = 27,
    /// 28:
    LPI2C1 = 28,
    /// 29:
    LPI2C2 = 29,
    /// 30:
    LPI2C3 = 30,
    /// 31:
    LPI2C4 = 31,
    /// 32:
    LPSPI1 = 32,
    /// 33:
    LPSPI2 = 33,
    /// 34:
    LPSPI3 = 34,
    /// 35:
    LPSPI4 = 35,
    /// 36:
    CAN1 = 36,
    /// 37:
    CAN2 = 37,
    /// 38:
    FLEXRAM = 38,
    /// 39:
    KPP = 39,
    /// 41: GPR (aka "GPC") interrupt request
    GPR_IRQ = 41,
    /// 45:
    WDOG2 = 45,
    /// 46:
    SNVS_HP_WRAPPER = 46,
    /// 47:
    SNVS_HP_WRAPPER_TZ = 47,
    /// 48:
    SNVS_LP_WRAPPER = 48,
    /// 49:
    CSU = 49,
    /// 50:
    DCP = 50,
    /// 51:
    DCP_VMI = 51,
    /// 53:
    TRNG = 53,
    /// 55:
    BEE = 55,
    /// 56:
    SAI1 = 56,
    /// 57:
    SAI2 = 57,
    /// 58:
    SAI3_RX = 58,
    /// 59:
    SAI3_TX = 59,
    /// 60:
    SPDIF = 60,
    /// 61:
    PMU = 61,
    /// 63:
    TEMP_LOW_HIGH = 63,
    /// 64:
    TEMP_PANIC = 64,
    /// 65:
    USB_PHY = 65,
    /// 67:
    ADC1 = 67,
    /// 68:
    ADC2 = 68,
    /// 69:
    DCDC = 69,
    /// 72:
    GPIO1_INT0 = 72,
    /// 73:
    GPIO1_INT1 = 73,
    /// 74:
    GPIO1_INT2 = 74,
    /// 75:
    GPIO1_INT3 = 75,
    /// 76:
    GPIO1_INT4 = 76,
    /// 77:
    GPIO1_INT5 = 77,
    /// 78:
    GPIO1_INT6 = 78,
    /// 79:
    GPIO1_INT7 = 79,
    /// 80:
    GPIO1_Combined_0_15 = 80,
    /// 81:
    GPIO1_Combined_16_31 = 81,
    /// 82:
    GPIO2_Combined_0_15 = 82,
    /// 83:
    GPIO2_Combined_16_31 = 83,
    /// 84:
    GPIO3_Combined_0_15 = 84,
    /// 85:
    GPIO3_Combined_16_31 = 85,
    /// 88:
    GPIO5_Combined_0_15 = 88,
    /// 89:
    GPIO5_Combined_16_31 = 89,
    /// 90:
    FLEXIO1 = 90,
    /// 92:
    WDOG1 = 92,
    /// 93:
    RTWDOG = 93,
    /// 94:
    EWM = 94,
    /// 95:
    CCM_1 = 95,
    /// 96:
    CCM_2 = 96,
    /// 97:
    GPC = 97,
    /// 98:
    SRC = 98,
    /// 100:
    GPT1 = 100,
    /// 101:
    GPT2 = 101,
    /// 102:
    PWM1_0 = 102,
    /// 103:
    PWM1_1 = 103,
    /// 104:
    PWM1_2 = 104,
    /// 105:
    PWM1_3 = 105,
    /// 106:
    PWM1_FAULT = 106,
    /// 108:
    FLEXSPI = 108,
    /// 109:
    SEMC = 109,
    /// 110:
    USDHC1 = 110,
    /// 111:
    USDHC2 = 111,
    /// 113:
    USB_OTG1 = 113,
    /// 114:
    ENET = 114,
    /// 115:
    ENET_1588_Timer = 115,
    /// 116:
    XBAR1_IRQ_0_1 = 116,
    /// 117:
    XBAR1_IRQ_2_3 = 117,
    /// 118:
    ADC_ETC_IRQ0 = 118,
    /// 119:
    ADC_ETC_IRQ1 = 119,
    /// 120:
    ADC_ETC_IRQ2 = 120,
    /// 121:
    ADC_ETC_ERROR_IRQ = 121,
    /// 122:
    PIT = 122,
    /// 123:
    ACMP1 = 123,
    /// 124:
    ACMP2 = 124,
    /// 125:
    ACMP3 = 125,
    /// 126:
    ACMP4 = 126,
    /// 129:
    ENC1 = 129,
    /// 130:
    ENC2 = 130,
    /// 133:
    TMR1 = 133,
    /// 134:
    TMR2 = 134,
    /// 137:
    PWM2_0 = 137,
    /// 138:
    PWM2_1 = 138,
    /// 139:
    PWM2_2 = 139,
    /// 140:
    PWM2_3 = 140,
    /// 141:
    PWM2_FAULT = 141,
}
#[cfg(target_arch = "arm")]
unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
    #[inline]
    fn number(self) -> u16 {
        self as u16
    }
}
