Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
mcp7940n.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Laird Connectivity
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_DRIVERS_RTC_MCP7940N_H_
8#define ZEPHYR_INCLUDE_DRIVERS_RTC_MCP7940N_H_
9
10#include <zephyr/sys/timeutil.h>
11#include <time.h>
12
18
23} __packed;
24
31
39
45
52
56} __packed;
57
67
71} __packed;
72
77} __packed;
78
83} __packed;
84
91
98
104
110
122
131
142 /* 0x9 not implemented */
149 /* 0x10 not implemented */
156 /* 0x17 not implemented */
165 SRAM_MIN = 0x20,
166 SRAM_MAX = 0x5F,
167 REG_INVAL = 0x60,
168};
169
170/* Mutually exclusive alarm trigger settings */
180
195int mcp7940n_rtc_set_time(const struct device *dev, time_t unix_time);
196
197#endif /* ZEPHYR_INCLUDE_DRIVERS_RTC_MCP7940N_H_ */
_TIME_T_ time_t
Definition _timespec.h:14
int mcp7940n_rtc_set_time(const struct device *dev, time_t unix_time)
Set the RTC to a given Unix time.
mcp7940n_register
Definition mcp7940n.h:132
@ REG_PWR_UP_MONTH
Definition mcp7940n.h:164
@ REG_ALM1_MONTH
Definition mcp7940n.h:155
@ REG_PWR_DWN_DATE
Definition mcp7940n.h:159
@ REG_PWR_DWN_HOUR
Definition mcp7940n.h:158
@ REG_RTC_MONTH
Definition mcp7940n.h:138
@ SRAM_MAX
Definition mcp7940n.h:166
@ REG_RTC_DATE
Definition mcp7940n.h:137
@ REG_ALM1_SEC
Definition mcp7940n.h:150
@ REG_ALM0_WDAY
Definition mcp7940n.h:146
@ REG_PWR_DWN_MONTH
Definition mcp7940n.h:160
@ REG_RTC_YEAR
Definition mcp7940n.h:139
@ REG_RTC_OSCTRIM
Definition mcp7940n.h:141
@ REG_RTC_MIN
Definition mcp7940n.h:134
@ REG_PWR_DWN_MIN
Definition mcp7940n.h:157
@ REG_ALM1_HOUR
Definition mcp7940n.h:152
@ SRAM_MIN
Definition mcp7940n.h:165
@ REG_PWR_UP_HOUR
Definition mcp7940n.h:162
@ REG_ALM0_MIN
Definition mcp7940n.h:144
@ REG_RTC_SEC
Definition mcp7940n.h:133
@ REG_RTC_HOUR
Definition mcp7940n.h:135
@ REG_RTC_CONTROL
Definition mcp7940n.h:140
@ REG_ALM0_SEC
Definition mcp7940n.h:143
@ REG_ALM0_MONTH
Definition mcp7940n.h:148
@ REG_ALM1_WDAY
Definition mcp7940n.h:153
@ REG_ALM1_MIN
Definition mcp7940n.h:151
@ REG_RTC_WDAY
Definition mcp7940n.h:136
@ REG_PWR_UP_MIN
Definition mcp7940n.h:161
@ REG_ALM0_HOUR
Definition mcp7940n.h:145
@ REG_PWR_UP_DATE
Definition mcp7940n.h:163
@ REG_ALM1_DATE
Definition mcp7940n.h:154
@ REG_ALM0_DATE
Definition mcp7940n.h:147
@ REG_INVAL
Definition mcp7940n.h:167
mcp7940n_alarm_trigger
Definition mcp7940n.h:171
@ MCP7940N_ALARM_TRIGGER_MINUTES
Definition mcp7940n.h:173
@ MCP7940N_ALARM_TRIGGER_DATE
Definition mcp7940n.h:176
@ MCP7940N_ALARM_TRIGGER_HOURS
Definition mcp7940n.h:174
@ MCP7940N_ALARM_TRIGGER_SECONDS
Definition mcp7940n.h:172
@ MCP7940N_ALARM_TRIGGER_WDAY
Definition mcp7940n.h:175
@ MCP7940N_ALARM_TRIGGER_ALL
Definition mcp7940n.h:178
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition device.h:403
Definition mcp7940n.h:123
struct mcp7940n_alm_month alm_month
Definition mcp7940n.h:129
struct mcp7940n_alm_hours alm_hours
Definition mcp7940n.h:126
struct mcp7940n_alm_sec alm_sec
Definition mcp7940n.h:124
struct mcp7940n_alm_weekday alm_weekday
Definition mcp7940n.h:127
struct mcp7940n_alm_min alm_min
Definition mcp7940n.h:125
struct mcp7940n_alm_date alm_date
Definition mcp7940n.h:128
Definition mcp7940n.h:99
uint8_t date_ten
Definition mcp7940n.h:101
uint8_t date_one
Definition mcp7940n.h:100
uint8_t nimp
Definition mcp7940n.h:102
Definition mcp7940n.h:85
uint8_t nimp
Definition mcp7940n.h:89
uint8_t hr_one
Definition mcp7940n.h:86
uint8_t hr_ten
Definition mcp7940n.h:87
uint8_t twelve_hr
Definition mcp7940n.h:88
Definition mcp7940n.h:79
uint8_t nimp
Definition mcp7940n.h:82
uint8_t min_one
Definition mcp7940n.h:80
uint8_t min_ten
Definition mcp7940n.h:81
Definition mcp7940n.h:105
uint8_t month_one
Definition mcp7940n.h:106
uint8_t nimp
Definition mcp7940n.h:108
uint8_t month_ten
Definition mcp7940n.h:107
Definition mcp7940n.h:73
uint8_t sec_ten
Definition mcp7940n.h:75
uint8_t sec_one
Definition mcp7940n.h:74
uint8_t nimp
Definition mcp7940n.h:76
Definition mcp7940n.h:92
uint8_t alm_pol
Definition mcp7940n.h:96
uint8_t alm_msk
Definition mcp7940n.h:95
uint8_t weekday
Definition mcp7940n.h:93
uint8_t alm_if
Definition mcp7940n.h:94
Definition mcp7940n.h:58
uint8_t ext_osc
Definition mcp7940n.h:61
uint8_t sqwfs
Definition mcp7940n.h:59
uint8_t alm0_en
Definition mcp7940n.h:62
uint8_t out
Definition mcp7940n.h:65
uint8_t crs_trim
Definition mcp7940n.h:60
uint8_t alm1_en
Definition mcp7940n.h:63
uint8_t sqw_en
Definition mcp7940n.h:64
Definition mcp7940n.h:40
uint8_t nimp
Definition mcp7940n.h:43
uint8_t date_one
Definition mcp7940n.h:41
uint8_t date_ten
Definition mcp7940n.h:42
Definition mcp7940n.h:25
uint8_t twelve_hr
Definition mcp7940n.h:28
uint8_t nimp
Definition mcp7940n.h:29
uint8_t hr_one
Definition mcp7940n.h:26
uint8_t hr_ten
Definition mcp7940n.h:27
Definition mcp7940n.h:19
uint8_t min_ten
Definition mcp7940n.h:21
uint8_t min_one
Definition mcp7940n.h:20
uint8_t nimp
Definition mcp7940n.h:22
Definition mcp7940n.h:46
uint8_t lpyr
Definition mcp7940n.h:49
uint8_t nimp
Definition mcp7940n.h:50
uint8_t month_one
Definition mcp7940n.h:47
uint8_t month_ten
Definition mcp7940n.h:48
Definition mcp7940n.h:68
uint8_t trim_val
Definition mcp7940n.h:69
uint8_t sign
Definition mcp7940n.h:70
Definition mcp7940n.h:13
uint8_t sec_ten
Definition mcp7940n.h:15
uint8_t sec_one
Definition mcp7940n.h:14
uint8_t start_osc
Definition mcp7940n.h:16
Definition mcp7940n.h:32
uint8_t nimp
Definition mcp7940n.h:37
uint8_t pwrfail
Definition mcp7940n.h:35
uint8_t oscrun
Definition mcp7940n.h:36
uint8_t weekday
Definition mcp7940n.h:33
uint8_t vbaten
Definition mcp7940n.h:34
Definition mcp7940n.h:53
uint8_t year_ten
Definition mcp7940n.h:55
uint8_t year_one
Definition mcp7940n.h:54
Definition mcp7940n.h:111
struct mcp7940n_rtc_month rtc_month
Definition mcp7940n.h:117
struct mcp7940n_rtc_osctrim rtc_osctrim
Definition mcp7940n.h:120
struct mcp7940n_rtc_year rtc_year
Definition mcp7940n.h:118
struct mcp7940n_rtc_weekday rtc_weekday
Definition mcp7940n.h:115
struct mcp7940n_rtc_date rtc_date
Definition mcp7940n.h:116
struct mcp7940n_rtc_hours rtc_hours
Definition mcp7940n.h:114
struct mcp7940n_rtc_min rtc_min
Definition mcp7940n.h:113
struct mcp7940n_rtc_control rtc_control
Definition mcp7940n.h:119
struct mcp7940n_rtc_sec rtc_sec
Definition mcp7940n.h:112
Utilities supporting operation on time data structures.