0

I am working on STM32F103 and the aim is to implement some libraries.

When I declare NVIC_InitStructure it's underlined in red which means that Eclipse do not recognize it. I did declare before use it : NVIC_InitTypeDef NVIC_InitStructure; but it's red undelined.

Maybe there a library to include before use that?

NVIC_InitTypeDef NVIC_InitStructure;

NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;           

NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;              
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;                 

NVIC_InitStructure.NVIC_IRQChannel = CAN1_RX0_INTERRUPTS;                                                                             
NVIC_Init(&NVIC_InitStructure);                                 
NVIC_InitStructure.NVIC_IRQChannel = CAN1_TX_INTERRUPTS;
NVIC_Init(&NVIC_InitStructure);
Gerhard
  • 6,850
  • 8
  • 51
  • 81
LENTMAISUR
  • 13
  • 4

1 Answers1

1

The NVIC_InitTypeDef struct is defined in a header file called misc.h in the STM32 standard peripheral library. So just include that in your source file.

#include "misc.h"

To quote:

This file contains all the functions prototypes for the miscellaneous firmware library functions (add-on to CMSIS functions).

David Collins
  • 2,852
  • 9
  • 13