CuVoodoo STM32F1 firmware template
Macros
timer peripheral used to count timer based on RTC IC square wave output

Macros

#define RTC_DS1307_SQUARE_WAVE_TICKS   (RTC_DS1307_SQUARE_WAVE_FREQUENCY/256)
 number of square wave tics before setting rtc_ds1307_tic_flag
 
#define RTC_DS1307_SQUARE_WAVE_FREQUENCY   4096
 square wave output frequency from the RTC IC
 
#define RTC_DS1307_SQUARE_WAVE_TIMER   TIM2
 timer peripheral
 
#define RTC_DS1307_SQUARE_WAVE_TIMER_RCC   RCC_TIM2
 timer peripheral clock
 
#define RTC_DS1307_SQUARE_WAVE_TIMER_IC   TIM_IC1
 input capture channel (for TIM2_CH1)
 
#define RTC_DS1307_SQUARE_WAVE_TIMER_IN   TIM_IC_IN_TI1
 input capture input source (TIM2_CH1 becomes TI1, then TI1F, then TI1FP1)
 
#define RTC_DS1307_SQUARE_WAVE_TIMER_TS   TIM_SMCR_TS_IT1FP1
 input capture trigger (actually TI1FP1)
 
#define RTC_DS1307_SQUARE_WAVE_TIMER_IRQ   NVIC_TIM2_IRQ
 timer interrupt
 
#define RTC_DS1307_SQUARE_WAVE_TIMER_ISR   tim2_isr
 timer interrupt service routine
 
#define RTC_DS1307_SQUARE_WAVE_GPIO_RCC   RCC_GPIOA
 timer port peripheral clock (TIM2_CH1 on PA0)
 
#define RTC_DS1307_SQUARE_WAVE_GPIO_PORT   GPIOA
 timer port (TIM2_CH1 on PA0)
 
#define RTC_DS1307_SQUARE_WAVE_GPIO_PIN   GPIO_TIM2_CH1_ETR
 timer pin input, connect to RTC IC square wave output (TIM2_CH1 on PA0)
 

Detailed Description

Note
comment out SQUARE_WAVE_TICS to not disable feature