Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel
bgColor#ffffff
titleQ

How does Do you have an example for the NVIC work?

Panel
bgColor#ffffff
titleA

Here is an example code using the wrapper functions in our driver on top of the original CMSIS NVIC functions.

Code Block
languagecpp
themeEclipse
firstline1
titleNVICExample.c
linenumberstrue
#include "Examples.h"
#include "netx_drv.h"

void callbackGPIO0(void*pvContext,void*pvCustom){
  DRV_NVIC_SetPendingIRQ(gpio_app1_IRQn);
  __BKPT();
}
void callbackGPIO1(void*pvContext,void*pvCustom){
  __BKPT();
}

int nvicexample(int argc, const char* argv[]) {
  (void) DRV_DIO_ChannelIRQAttach(DRV_DIO_ID_GPIO_0,callbackGPIO0,0);
  (void) DRV_DIO_ChannelIRQAttach(DRV_DIO_ID_GPIO_1,callbackGPIO1,0);
  // Callback callbackGPIO1 is called after callbackGPIO0
  DRV_NVIC_SetPendingIRQ(gpio_app0_IRQn);
  DRV_NVIC_SetPriority(gpio_app1_IRQn,1,0);
  DRV_NVIC_SetPriority(gpio_app0_IRQn,2,0);
  // Callback callbackGPIO1 is called inside callbackGPIO0
  DRV_NVIC_SetPendingIRQ(gpio_app0_IRQn);
  return 0;
}
Panel
bgColor#ffffff
titleSee also...

Filter by label (Content by label)
showLabelsfalse
spaces@self
showSpacefalse
cqllabel = "faq" and space = currentSpace()
labelsfaq