| BlueNRG-1 Peripherals drivers Examples

- Main Page
- Modules
- Classes
- Files

Macros | Functions
RTC TimeBase with pattern
BlueNRG1 Standard Peripheral Examples » RTC_Examples

## Macros

#define | RTC_PERIOD_1s (32767)
#define | RTC_PERIOD_100ms ((32767)/10)

## Functions

void | RTC_Configuration (void)
| RTC0 Configuration. More...
int | main (void)
| Main program code. More...

## Detailed Description

## Macro Definition Documentation

#define RTC_PERIOD_100ms ((32767)/10)

0.1s period for RTC timer

Definition at line 185 of file RTC_TimeBasePattern_main.c.

#define RTC_PERIOD_1s (32767)

1s period for RTC timer

Definition at line 184 of file RTC_TimeBasePattern_main.c.

## Function Documentation

int main | ( | void |  | ) |

Main program code.

Parameters

  None |

Return values

  None |

Definition at line 199 of file RTC_TimeBasePattern_main.c.

void RTC_Configuration | ( | void |  | ) |

RTC0 Configuration.

Parameters

  None |

Return values

  None |

RTC configuration

< Periodic RTC mode

< Pattern size set to 8

< Load register TLR1 set for 1s period

< Load register TLR2 set for 100ms period

Generated RTC pattern is set to generate following:

- 4 periods defined by TLR1 (1s)
- 4 periods defined by TLR2 (100ms)
- 2 periods defined by TLT1 (1s)
- 6 periods defined by TLR2 (100ms)

< Generated RTC pattern 0b11110010

Enable RTC Timer interrupt

Delay between two write in RTC0->TCR register has to be at least 3 x 32k cycle + 2 CPU cycle. For that reason it is neccessary to add the delay.

Definition at line 224 of file RTC_TimeBasePattern_main.c.