Lines Matching refs:spec
105 static inline int ds2482_84_write(const struct i2c_dt_spec *spec, uint8_t cmd, const uint8_t *data) in ds2482_84_write() argument
111 ret = i2c_write_dt(spec, buf, data ? 2 : 1); in ds2482_84_write()
119 static inline int ds2482_84_read(const struct i2c_dt_spec *spec, uint8_t rp, uint8_t *reg) in ds2482_84_read() argument
138 ret = ds2482_84_write(spec, CMD_SRP, &rp); in ds2482_84_read()
147 ret = i2c_read_dt(spec, reg, 1); in ds2482_84_read()
155 static inline int ds2482_84_reset_bus(const struct i2c_dt_spec *spec) in ds2482_84_reset_bus() argument
161 ret = ds2482_84_write(spec, CMD_1WRS, NULL); in ds2482_84_reset_bus()
167 ret = ds2482_84_read(spec, REG_NONE, ®); in ds2482_84_reset_bus()
176 static inline int ds2482_84_reset_device(const struct i2c_dt_spec *spec) in ds2482_84_reset_device() argument
182 ret = ds2482_84_write(spec, CMD_DRST, NULL); in ds2482_84_reset_device()
188 ret = ds2482_84_read(spec, REG_NONE, ®); in ds2482_84_reset_device()
197 static inline int ds2482_84_single_bit(const struct i2c_dt_spec *spec, uint8_t bit_msk) in ds2482_84_single_bit() argument
203 ret = ds2482_84_write(spec, CMD_1WSB, &bit_msk); in ds2482_84_single_bit()
209 ret = ds2482_84_read(spec, REG_NONE, ®); in ds2482_84_single_bit()
218 static inline int ds2482_84_read_bit(const struct i2c_dt_spec *spec) in ds2482_84_read_bit() argument
220 return ds2482_84_single_bit(spec, BIT_SET_msk); in ds2482_84_read_bit()
223 static inline int ds2482_84_write_bit(const struct i2c_dt_spec *spec, bool bit) in ds2482_84_write_bit() argument
225 return ds2482_84_single_bit(spec, bit ? BIT_SET_msk : BIT_CLR_msk); in ds2482_84_write_bit()
228 static inline int ds2482_84_read_byte(const struct i2c_dt_spec *spec) in ds2482_84_read_byte() argument
234 ret = ds2482_84_write(spec, CMD_1WRB, NULL); in ds2482_84_read_byte()
240 ret = ds2482_84_read(spec, REG_NONE, ®); in ds2482_84_read_byte()
246 ret = ds2482_84_read(spec, REG_DATA, ®); in ds2482_84_read_byte()
254 static inline int ds2482_84_write_byte(const struct i2c_dt_spec *spec, uint8_t byte) in ds2482_84_write_byte() argument
260 ret = ds2482_84_write(spec, CMD_1WWB, &byte); in ds2482_84_write_byte()
266 ret = ds2482_84_read(spec, REG_NONE, ®); in ds2482_84_write_byte()
275 static inline int ds2482_84_write_config(const struct i2c_dt_spec *spec, uint8_t cfg) in ds2482_84_write_config() argument
285 ret = ds2482_84_write(spec, CMD_WCFG, ®); in ds2482_84_write_config()
290 ret = ds2482_84_read(spec, REG_NONE, ®); in ds2482_84_write_config()