This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

identifier is not defined

Hi,

I am trying to use HAL driver for STM32L053C8 discovery board.
In DMA.h I defined:

typedef struct
{
  DMA_Channel_TypeDef    *Instance;          /*!< Register base address                  */

  DMA_InitTypeDef       Init;           /*!< DMA communication parameters           */

  __IO DMA_StateTypeDef  State;        /*!< DMA transfer state                     */

  void                  *Parent;           /*!< Parent object state                    */

  //void                  (* XferCpltCallback)( struct __DMA_HandleTypeDef * hdma);     /*!< DMA transfer complete callback         */

  //void                  (* XferHalfCpltCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA Half transfer complete callback    */

  //void                  (* XferErrorCallback)( struct __DMA_HandleTypeDef * hdma);    /*!< DMA transfer error callback            */

}DMA_HandleTypeDef;

then in ADC.h I include that DMA.h file but after compilation, the compiler reports:
..\Inc\ADC.h(127): error: #20: identifier "DMA_HandleTypeDef" is undefined DMA_HandleTypeDef *DMA_Handle; /*!< Pointer DMA Handler */
..\Src\DMA.c: 0 warnings, 1 error

Actually there is no red cross on the right of DMA_HandleTypeDef in Keil uvision5 IDE in ADC.h file.

typedef struct __ADC_HandleTypeDef
{
  ADC_TypeDef                   *Instance;              /*!< Register base address */

  ADC_InitTypeDef               Init;                   /*!< ADC required parameters */

  DMA_HandleTypeDef             *DMA_Handle;            /*!< Pointer DMA Handler */

  __IO ADC_StateTypeDef                 State;                  /*!< ADC communication state */

  //__IO uint32_t                 ErrorCode;              /*!< ADC Error code */
}ADC_HandleTypeDef;


I dont know the reason why that happenes. Can anyone help me? Thank you.

0