Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
ds3231.h File Reference

Go to the source code of this file.

Functions

int mfd_ds3231_i2c_get_registers (const struct device *dev, uint8_t start_reg, uint8_t *buf, const size_t buf_size)
 Get specified number of registers from an I2C device starting at the given register address.
 
int mfd_ds3231_i2c_set_registers (const struct device *dev, uint8_t start_reg, const uint8_t *buf, const size_t buf_size)
 Set a register on an I2C device at the given register address.
 

Function Documentation

◆ mfd_ds3231_i2c_get_registers()

int mfd_ds3231_i2c_get_registers ( const struct device * dev,
uint8_t start_reg,
uint8_t * buf,
const size_t buf_size )

Get specified number of registers from an I2C device starting at the given register address.

Parameters
devds3231 mfd device
start_regThe register address to start at.
bufThe buffer array pointer to store results in.
buf_sizeThe amount of register values to return.
Return values
0on success
-errnoin case of any bus error

◆ mfd_ds3231_i2c_set_registers()

int mfd_ds3231_i2c_set_registers ( const struct device * dev,
uint8_t start_reg,
const uint8_t * buf,
const size_t buf_size )

Set a register on an I2C device at the given register address.

Parameters
devds3231 mfd device
start_regThe register address to set.
bufThe value to write to the given address.
buf_sizeThe size of the buffer to be written to the given address.
Return values
0on success
-errnoin case of any bus error