|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
Register layout and API for the MCP7940N RTC based counter driver. More...
Go to the source code of this file.
Data Structures | |
| struct | mcp7940n_rtc_sec |
| struct | mcp7940n_rtc_min |
| struct | mcp7940n_rtc_hours |
| struct | mcp7940n_rtc_weekday |
| struct | mcp7940n_rtc_date |
| struct | mcp7940n_rtc_month |
| struct | mcp7940n_rtc_year |
| struct | mcp7940n_rtc_control |
| struct | mcp7940n_rtc_osctrim |
| struct | mcp7940n_alm_sec |
| struct | mcp7940n_alm_min |
| struct | mcp7940n_alm_hours |
| struct | mcp7940n_alm_weekday |
| struct | mcp7940n_alm_date |
| struct | mcp7940n_alm_month |
| struct | mcp7940n_time_registers |
| struct | mcp7940n_alarm_registers |
Functions | |
| int | mcp7940n_rtc_set_time (const struct device *dev, time_t unix_time) |
| Set the RTC to a given Unix time. | |
Register layout and API for the MCP7940N RTC based counter driver.
| enum mcp7940n_register |
Set the RTC to a given Unix time.
The RTC advances one tick per second with no access to sub-second precision. This function will convert the given unix_time into seconds, minutes, hours, day of the week, day of the month, month and year. A Unix time of '0' means a timestamp of 00:00:00 UTC on Thursday 1st January 1970.
| dev | the MCP7940N device pointer. |
| unix_time | Unix time to set the rtc to. |
| return | 0 on success, or a negative error code from an I2C transaction or invalid parameter. |