36#ifndef LIBCHIP_I2C_RTC_H
37#define LIBCHIP_I2C_RTC_H
87#include <libchip/rtc.h>
94extern const rtc_fns i2c_rtc_fns;
95bool i2c_rtc_probe(
int minor);
149#define I2C_RTC_ORDER_sec_min_hour_wkday_day_month_year \
150 { .sec = 0, .min = 1, .hour = 2, .day = 4, .wkday = 3, .month = 5, .year = 6 }
152#define I2C_RTC_ORDER_sec_min_hour_day_wkday_month_year \
153 { .sec = 0, .min = 1, .hour = 2, .day = 3, .wkday = 4, .month = 5, .year = 6 }
155#define I2C_RTC_INITIALIZER(i2c_path, i2c_address, offset, reg_order, \
156 driver_name, hwinit)\
158 .mutex = RTEMS_MUTEX_INITIALIZER(driver_name), \
159 .i2c_bus_path = i2c_path, \
160 .i2c_addr = i2c_address, \
161 .initialized = false, \
163 .clock_offset = offset, \
164 .order = reg_order, \
167#define I2C_RTC_TBL_ENTRY(dev_name, i2c_rtc_ctx) \
169 .sDeviceName = dev_name, \
170 .deviceType = RTC_CUSTOM, \
171 .pDeviceFns = &i2c_rtc_fns, \
172 .deviceProbe = i2c_rtc_probe, \
173 .pDeviceParams = (void *)i2c_rtc_ctx, \
176 .getRegister = NULL, \
177 .setRegister = NULL, \
int i2c_rtc_read(struct i2c_rtc_base *ctx, uint8_t addr, uint8_t *buf, size_t len)
Definition: i2c-rtc.c:112
int i2c_rtc_write(struct i2c_rtc_base *ctx, uint8_t addr, const uint8_t *buf, size_t len)
Definition: i2c-rtc.c:149
This header file defines the RTEMS Classic API.
size_t clock_offset
Definition: i2c-rtc.h:119
int(* hw_init)(struct i2c_rtc_base *ctx)
Definition: i2c-rtc.h:116
struct i2c_rtc_base::@573 order
bool initialized
Definition: i2c-rtc.h:109
uint8_t i2c_addr
Definition: i2c-rtc.h:106
rtems_mutex mutex
Definition: i2c-rtc.h:100
const char * i2c_bus_path
Definition: i2c-rtc.h:103
This header file provides the API of Self-Contained Objects.