Page 1 of 1
Interrupt when pin high
Posted: Fri Dec 19, 2014 3:19 am
by hkerner
Does anyone know of a way to set up an interrupt to trigger when a certain pin is high? I don't see predefined functions for this in the HAL drivers. Any help is appreciated. Thank you in advance!!
Re: Interrupt when pin high
Posted: Fri Dec 19, 2014 3:58 am
by hkerner
I need an interrupt for when H10, H11, H12, and I0 go high. Would I use the EXT driver with a config structure like this?
Code: Select all
static const EXTConfig extHcfg = {
{
{EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOI, motScb},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOH, motXcb}, // 10
{EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOH, motYcb}, // 11
{EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOH, motZcb}, // 12
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL}
}
};
Re: Interrupt when pin high
Posted: Fri Dec 19, 2014 8:50 am
by Giovanni
Hi,
The configuration looks correct.
Giovanni