Wake-up timer library to wake from deepsleep/power-down

Dependencies:   LPC1114_WakeInterruptIn

Dependents:   LPC812_Sleep_HelloWorld KL05Z_DCF77_RTC_Clock LPC1114_data_logger mBuinoBlinky ... more

Issue: STM32F103

Hello,

I'm trying to use the library on a STM32F103C8T6, but compilation fails:

src/Device/WakeUp_STM_RTC.cpp: In static member function 'static void WakeUp::set_ms(uint32_t)':
src/Device/WakeUp_STM_RTC.cpp:39:10: error: 'struct RTC_TypeDef' has no member named 'WPR'
RTC->WPR = 0xCA;            //Disable RTC write protection
^
src/Device/WakeUp_STM_RTC.cpp:40:10: error: 'struct RTC_TypeDef' has no member named 'WPR'
RTC->WPR = 0x53;
^
src/Device/WakeUp_STM_RTC.cpp:43:10: error: 'struct RTC_TypeDef' has no member named 'CR'
RTC->CR &= ~RTC_CR_ALRAE;
^
src/Device/WakeUp_STM_RTC.cpp:43:17: error: 'RTC_CR_ALRAE' was not declared in this scope
RTC->CR &= ~RTC_CR_ALRAE;
^
src/Device/WakeUp_STM_RTC.cpp:44:18: error: 'struct RTC_TypeDef' has no member named 'ISR'
while(!(RTC->ISR & RTC_ISR_ALRAWF));
^
src/Device/WakeUp_STM_RTC.cpp:44:24: error: 'RTC_ISR_ALRAWF' was not declared in this scope
while(!(RTC->ISR & RTC_ISR_ALRAWF));
^
src/Device/WakeUp_STM_RTC.cpp:48:14: error: 'struct RTC_TypeDef' has no member named 'WPR'
RTC->WPR = 0xFF;        //Enable RTC write protection
^
src/Device/WakeUp_STM_RTC.cpp:53:32: error: 'struct RTC_TypeDef' has no member named 'PRER'
uint32_t prescaler = (RTC->PRER & 0x7FFF) + 1;
^
src/Device/WakeUp_STM_RTC.cpp:62:29: error: 'struct RTC_TypeDef' has no member named 'SSR'
uint32_t subsecs = RTC->SSR;
^
src/Device/WakeUp_STM_RTC.cpp:91:10: error: 'struct RTC_TypeDef' has no member named 'ALRMAR'
RTC->ALRMAR = alarmreg;
^
src/Device/WakeUp_STM_RTC.cpp:92:10: error: 'struct RTC_TypeDef' has no member named 'ALRMASSR'
RTC->ALRMASSR = subsecs | RTC_ALRMASSR_MASKSS;      //Mask no subseconds
^
src/Device/WakeUp_STM_RTC.cpp:92:31: error: 'RTC_ALRMASSR_MASKSS' was not declared in this scope
RTC->ALRMASSR = subsecs | RTC_ALRMASSR_MASKSS;      //Mask no subseconds
^
src/Device/WakeUp_STM_RTC.cpp:93:10: error: 'struct RTC_TypeDef' has no member named 'CR'
RTC->CR |= RTC_CR_ALRAE | RTC_CR_ALRAIE;            //Enable Alarm
^
src/Device/WakeUp_STM_RTC.cpp:93:31: error: 'RTC_CR_ALRAIE' was not declared in this scope
RTC->CR |= RTC_CR_ALRAE | RTC_CR_ALRAIE;            //Enable Alarm
^
src/Device/WakeUp_STM_RTC.cpp:95:10: error: 'struct RTC_TypeDef' has no member named 'WPR'
RTC->WPR = 0xFF;        //Enable RTC write protection
^
src/Device/WakeUp_STM_RTC.cpp: In static member function 'static void WakeUp::irq_handler()':
src/Device/WakeUp_STM_RTC.cpp:110:10: error: 'struct RTC_TypeDef' has no member named 'ISR'
RTC->ISR &= ~RTC_ISR_ALRAF;
^
src/Device/WakeUp_STM_RTC.cpp:110:18: error: 'RTC_ISR_ALRAF' was not declared in this scope
RTC->ISR &= ~RTC_ISR_ALRAF;
^
src/Device/WakeUp_STM_RTC.cpp:111:10: error: 'struct RTC_TypeDef' has no member named 'WPR'
RTC->WPR = 0xCA;            //Disable RTC write protection
^
src/Device/WakeUp_STM_RTC.cpp:112:10: error: 'struct RTC_TypeDef' has no member named 'WPR'
RTC->WPR = 0x53;
^
src/Device/WakeUp_STM_RTC.cpp:113:10: error: 'struct RTC_TypeDef' has no member named 'CR'
RTC->CR &= ~RTC_CR_ALRAE;
^
src/Device/WakeUp_STM_RTC.cpp:113:17: error: 'RTC_CR_ALRAE' was not declared in this scope
RTC->CR &= ~RTC_CR_ALRAE;
^
src/Device/WakeUp_STM_RTC.cpp:114:10: error: 'struct RTC_TypeDef' has no member named 'WPR'
RTC->WPR = 0xFF;        //Enable RTC write protection

Seems the registers are totaly different on STM32F1s:

typedef struct
{
  __IO uint32_t CRH;
  __IO uint32_t CRL;
  __IO uint32_t PRLH;
  __IO uint32_t PRLL;
  __IO uint32_t DIVH;
  __IO uint32_t DIVL;
  __IO uint32_t CNTH;
  __IO uint32_t CNTL;
  __IO uint32_t ALRH;
  __IO uint32_t ALRL;
} RTC_TypeDef;