RTEMS 6.1-rc4
Loading...
Searching...
No Matches
Files | Data Structures | Macros | Functions
Shared_tod_mcp7940m_rtc

RTC driver for the MCP7940M. More...

Files

file  mcp7940m-rtc.h
 This file provides the interfaces of Shared_tod_mcp7940m_rtc.
 
file  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)    I2C_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

Function Documentation

◆ mcp7940m_hw_init()

int mcp7940m_hw_init ( struct i2c_rtc_base base)

Hardware init. Used internally.