MSS_GPIO_enable_irq

Function MSS_GPIO_enable_irq 

Source
pub unsafe extern "C" fn MSS_GPIO_enable_irq(
    gpio: *mut GPIO_TypeDef,
    port_id: mss_gpio_id_t,
)
Expand description

MSS_GPIO_enable_irq() enables interrupt generation for the specified GPIO input. Interrupts are generated based on the state of the GPIO input and the interrupt mode configured for it by MSS_GPIO_config(). This function enables the corresponding GPIO direct interrupt on the PLIC as well.

@param gpio The gpio parameter specifies the GPIO block that needs to be configured.

@param port_id The port_id parameter identifies the GPIO port for which you want to enable interrupt generation. An enumeration item of the form MSS_GPIO_n, where n is the number of the GPIO port, identifies the GPIO port. For example, MSS_GPIO_0 identifies the first GPIO port and MSS_GPIO_31 identifies the last GPIO port.

@return This function does not return a value.

@example The call to MSS_GPIO_enable_irq() in the following example allows GPIO 8 to generate interrupts: @code #include “mss_gpio.h” int main(void) { uint32_t gpio_inputs; MSS_GPIO_init(GPIO0_LO); MSS_GPIO_config_all(GPIO0_LO, MSS_GPIO_INOUT_MODE | MSS_GPIO_IRQ_EDGE_POSITIVE); MSS_GPIO_enable_irq(GPIO0_LO, MSS_GPIO_8); return (0u); } @endcode