Skip to main content
Visitor II
September 8, 2020
Solved

how do i find the exact names for typedef structures

  • September 8, 2020
  • 1 reply
  • 1106 views

Im trying to find how to write to the common ADC registers CCR on an STM32L412. What is the name of the structure I need to use? Im trying to access the common ADC register CCR

I am using the names for registers is stored under the file in CMSIS>Device>ST>STM32..>Include>STM32.. but this doesn't seem to include the *names* of the structures - they're labelled at the end of the structure, but you actually can't use the names as they are there - for example

ADC_TypeDef;

must be either ADC1 or ADC2. So how do I refer to

ADC_Common_TypeDef;

?? how am I meant to know?

    This topic has been closed for replies.
    Best answer by Nikita91

    You can use ADC12_COMMON, which is defined in stm32l412xx.h as:

    #define ADC12_COMMON    ((ADC_Common_TypeDef *) ADC12_COMMON_BASE)

    example; ADC12_COMMON->CCR = xxxx ;

    1 reply

    Nikita91Answer
    Explorer II
    September 8, 2020

    You can use ADC12_COMMON, which is defined in stm32l412xx.h as:

    #define ADC12_COMMON    ((ADC_Common_TypeDef *) ADC12_COMMON_BASE)

    example; ADC12_COMMON->CCR = xxxx ;