Calling RTC_Init
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-06-27 3:13 AM
Posted on June 27, 2011 at 12:13
Good morning everybody!
I'm evaluating ST standard device Library with STM32L discovery board. I want to test RTC and so in my main I want to call RTC_Init and so on. So I prepare a RTC_InitType structure, I create a RTC_InitType pointer, than I do: pointer = &structure Now I call RTC_Init and I pass to it my pointer, but there is a compiler error to this instruction: pointer = &structure Why doesn't it work? How can I call routines in stm32l1xx_rtc.h? Thank you very much
This discussion is locked. Please start a new topic to ask your question.
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-06-27 11:23 PM
Posted on June 28, 2011 at 08:23
RTC_InitTypeDef RTC_InitStructure;
/* Calender Configuartion */ RTC_InitStructure.RTC_AsynchPrediv = 0x7F; RTC_InitStructure.RTC_SynchPrediv = 0xFF; RTC_InitStructure.RTC_HourFormat = RTC_HourFormat_24; RTC_Init(&RTC_InitStructure); RTC_InitTypeDef *ptr; ptr = &RTC_InitStructure; ptr->RTC_AsynchPrediv = 0x7F;
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-06-28 11:47 PM
Posted on June 29, 2011 at 08:47
Thank you for reply.
I adopted your solutions, but my compilers return errors (IAR and Atollic). For example see Cattura.jpg If I use the second option: RTC_InitTypeDef *ptr; ptr = &RTC_InitStructure; ptr->RTC_AsynchPrediv = 0x7F; I obtain the following errors: 1. data definition has no type or storage class 2. initialization from incompatible pointer type 3. type defaulrs to 'int' in declaration of 'ptr 'Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-06-29 8:17 PM
Posted on June 30, 2011 at 05:17
Absent a more complete view of what's going on, I'm going to assume you have some problems with #include's, #define's or some other definition for RTC_Init.
Right click of RTC_Init, and see if the IDE provides some details about the use and definitions thereof.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
