回复于:\rv32m1_vega\driver_examples\gpio\input_interrupt 仿照这么这个例子改为其他按键,例如SW3,一直不行?

Home 论坛 开发和更新问题 \rv32m1_vega\driver_examples\gpio\input_interrupt 仿照这么这个例子改为其他按键,例如SW3,一直不行? 回复于:\rv32m1_vega\driver_examples\gpio\input_interrupt 仿照这么这个例子改为其他按键,例如SW3,一直不行?

#1937
hyq666hyq666
参与者

void BOARD_InitPins(void) {
CLOCK_EnableClock(kCLOCK_PortA);
CLOCK_EnableClock(kCLOCK_PortC); /* Clock Gate Control: 0x01u */
CLOCK_EnableClock(kCLOCK_PortE); /* Clock Gate Control: 0x01u */

const port_pin_config_t porte12_pinL12_config = {
kPORT_PullDisable, /* Internal pull-up/down resistor is disabled */
kPORT_FastSlewRate, /* Fast slew rate is configured */
kPORT_PassiveFilterDisable, /* Passive filter is disabled */
kPORT_OpenDrainDisable, /* Open drain is disabled */
kPORT_LowDriveStrength, /* Low drive strength is configured */
kPORT_MuxAsGpio, /* Pin is configured as PTE12 */
kPORT_UnlockRegister /* Pin Control Register fields [15:0] are not locked */

};
PORT_SetPinConfig(PORTE, PIN12_IDX, &porte12_pinL12_config); /* PORTE12 (pin L12) is configured as PTE12 */
PORT_SetPinMux(PORTA, PIN24_IDX, kPORT_MuxAsGpio); /* PORTA24 (pin D6) is configured as PTA24 */
PORT_SetPinMux(PORTC, PIN7_IDX, kPORT_MuxAlt3); /* PORTC7 (pin N2) is configured as LPUART0_RX */
PORT_SetPinMux(PORTC, PIN8_IDX, kPORT_MuxAlt3); /* PORTC8 (pin P3) is configured as LPUART0_TX */
}

 

 

#define BOARD_SW5_GPIO GPIOE
#define BOARD_SW5_PORT PORTE
#define BOARD_SW5_GPIO_PIN 12U
#define BOARD_SW5_IRQ PORTE_IRQn
#define BOARD_SW5_IRQ_HANDLER PORTE_IRQHandler
#define BOARD_SW5_NAME “SW5”

/* Board led color mapping */
#define BOARD_LED_RED_GPIO GPIOA
#define BOARD_LED_RED_GPIO_PIN 24U

/*! @brief The TPM channel used for board */
#define BOARD_TPM_CHANNEL 0U