RTEMS 6.3
Loading...
Searching...
No Matches
Shared_tod_mcp7940m_rtc

RTC driver for the MCP7940M. More...

Files

file  bsps/include/libchip/mcp7940m-rtc.h
 This file provides the interfaces of Shared_tod_mcp7940m_rtc.
file  bsps/shared/dev/rtc/mcp7940m.c
 This file provides the interfaces of Shared_tod_mcp7940m_rtc.

Data Structures

struct  mcp7940m_rtc

Macros

#define MCP7940M_RTC_INITIALIZER(i2c_path, i2c_address, has_crystal)
#define MCP7940M_RTC_TBL_ENTRY(dev_name, mcp7940m_rtc_ctx)

Functions

int mcp7940m_hw_init (struct i2c_rtc_base *base)

Detailed Description

RTC driver for the MCP7940M.

To use this driver, use the following initialization:

Define a context for the RTC somewhere:

static struct mcp7940m_rtc rtc_ctx = MCP7940M_RTC_INITIALIZER("/dev/i2c-1", 0x6F, true);

Then you can use the following for the RTC_Table:

MCP7940M_RTC_TBL_ENTRY("/dev/rtc", &rtc_ctx)

Macro Definition Documentation

◆ MCP7940M_RTC_INITIALIZER

#define MCP7940M_RTC_INITIALIZER ( i2c_path,
i2c_address,
has_crystal )
Value:
{ \
.base = I2C_RTC_INITIALIZER( \
i2c_path, \
i2c_address, \
0, \
I2C_RTC_ORDER_sec_min_hour_wkday_day_month_year, \
"mcp7940", \
.crystal = has_crystal, \
}
int mcp7940m_hw_init(struct i2c_rtc_base *base)
Definition mcp7940m.c:68

◆ MCP7940M_RTC_TBL_ENTRY

#define MCP7940M_RTC_TBL_ENTRY ( dev_name,
mcp7940m_rtc_ctx )
Value:
I2C_RTC_TBL_ENTRY(dev_name, mcp7940m_rtc_ctx)

Function Documentation

◆ mcp7940m_hw_init()

int mcp7940m_hw_init ( struct i2c_rtc_base * base)

Hardware init. Used internally.