Project

General

Profile

Revision 259

deleting rtc_macros.h

View differences:

rtc.c
6 6
#include "utils.h"
7 7
#include "errors.h"
8 8

  
9
// RTC IRQ Line
10

  
11
#define KBC_IRQ   8  /* @brief KBC IRQ Line */
12

  
13
// RTC Ports
14

  
15
#define RTC_ADDR_REG        0x70
16
#define RTC_DATA_REG        0x71
17

  
18
// RTC Registers (Byte)
19

  
20
#define RTC_SEC             0
21
#define RTC_SEC_ALARM       1
22
#define RTC_MIN             2
23
#define RTC_MIN_ALARM       3
24
#define RTC_HOUR            4
25
#define RTC_HOUR_ALARM      5
26
#define RTC_WEEK_DAY        6
27
#define RTC_MONTH_DAY       7
28
#define RTC_MONTH           8
29
#define RTC_YEAR            9
30
#define RTC_REG_A           10
31
#define RTC_REG_B           11
32
#define RTC_REG_C           12
33
#define RTC_REG_D           13
34

  
35
// Register A
36

  
37
#define RS0     BIT(0)  /** @brief Rate selector */
38
#define RS1     BIT(1)  /** @brief Rate selector */
39
#define RS2     BIT(2)  /** @brief Rate selector */
40
#define RS3     BIT(3)  /** @brief Rate selector */
41
#define UIP     BIT(7)  /** @brief Update in progress */
42

  
43
// Register B
44

  
45
#define DSE             BIT(0)  /** @brief Enable Daylight Saving Time */
46
#define HOUR_FORM       BIT(1)  /** @brief Set to 1 for 24h format (0-23), 0 to 12h format (1-12) */
47
#define DM              BIT(2)  /** @brief Set to 1 if registers are in binary, 0 if in BCD */
48
#define SQWE            BIT(3)  /** @brief Enable square wave generation */
49
#define UIE             BIT(4)  /** @brief Enable Update interrupts */
50
#define AIE             BIT(5)  /** @brief Enable alarm interrupts */
51
#define PIE             BIT(6)  /** @brief Enable periodic interrupts */
52
#define SET             BIT(7)  /** @brief Set to 1 to inhibit updates of time/date registers */
53

  
54
// Register C
55

  
56
#define UF      BIT(4)  /** @brief Update Interrupt Pending */
57
#define AF      BIT(5)  /** @brief Alarm Interrupt Pending */
58
#define PF      BIT(6)  /** @brief Periodic Interrupt Pending */
59
#define IRQF    BIT(7)  /** @brief IRQ Line Active */
60

  
61
// Register D
62

  
63
#define VRT     BIT(7)  /** @brief Valid RAM/time - If set to 0 RTC reading aren't valid */
64

  
9 65
int (subscribe_rtc_interrupt)(uint8_t interrupt_bit, int *interrupt_id) {
10 66
    if (interrupt_id == NULL) return NULL_PTR;
11 67
    *interrupt_id = interrupt_bit;

Also available in: Unified diff