TI中文支持网
TI专业的中文技术问题搜集分享网站

CC1310 GPIOinterupt例程里面 回调函数如何清中断

请问回调函数的内容只是翻转了LED电平而已啊,没看到用清中断啊?

Kevin Qiu1:

An array of @ref GPIO_CallbackFxn elements that is used to store*callback function pointers for GPIO pins configured with interrupts.*The indexes for these array elements correspond to the pins defined*in the GPIO_pinConfig array. These function pointers can be defined*statically by referencing the callback function name in the array*element, or dynamically, by setting the array element to NULL and using*GPIO_setCallback() at runtime to plug the callback entry.*Pins not used for interrupts can be omitted from the callback array to*reduce memory usage (if they are placed at the end of GPIO_pinConfig*array). The callback function syntax should match the following:*@code*void (*GPIO_CallbackFxn)(uint_least8_t index);*@endcode*The index parameter is the same index that was passed to*GPIO_setCallback(). This allows the same callback function to be used*for multiple GPIO interrupts, by using the index to identify the GPIO*that caused the interrupt.*Keep in mind that the callback functions will be called in the context of*an interrupt service routine and should be designed accordingly.When an*interrupt is triggered, the interrupt status of all (interrupt enabled) pins*on a port will be read, cleared, and the respective callbacks will be*executed.Callbacks will be called in order from least significant bit to*most significant bit.*Below is an MSP432 device specific example of the GPIO_CallbackFxn array:*@code*//*// Array of callback function pointers*// NOTE: The order of the pin configurations must coincide with what was*//defined in MSP_EXP432P401R.h*// NOTE: Pins not used for interrupts can be omitted from callbacks array*//to reduce memory usage (if placed at end of gpioPinConfigs*//array).*//*GPIO_CallbackFxn gpioCallbackFunctions[] = {*// MSP_EXP432P401R_GPIO_S1*NULL,*// MSP_EXP432P401R_GPIO_S2*NULL*};*@endcode*

看下上面的说明:

* Keep in mind that the callback functions will be called in the context of * an interrupt service routine and should be designed accordingly. When an * interrupt is triggered, the interrupt status of all (interrupt enabled) pins * on a port will be read, cleared, and the respective callbacks will be * executed. Callbacks will be called in order from least significant bit to * most significant bit.

 

user6439669:

回复 Kevin Qiu1:

就是会read,clear,同时执行回调函数,就是执行回调函数的时候,中断已经自动清了,不用我们自己清

赞(0)
未经允许不得转载:TI中文支持网 » CC1310 GPIOinterupt例程里面 回调函数如何清中断
分享到: 更多 (0)