Lines Matching +full:merge +full:- +full:date

10  * SPDX-License-Identifier: Apache-2.0
65 /** Use 10-bit addressing. DEPRECATED - Use I2C_MSG_ADDR_10_BITS instead. */
160 * that follows a write, or vice-versa. Some drivers will merge
165 /** Use 10-bit addressing for this message.
199 * @param result Result code of the transfer request. 0 is success, -errno for failure.
271 /** Target device responds to 10-bit addressing. */
470 return device_is_ready(spec->bus); in i2c_is_ready_dt()
482 return (msg->flags & I2C_MSG_READ) == I2C_MSG_READ; in i2c_is_read_op()
494 return (msg->flags & I2C_MSG_STOP) == I2C_MSG_STOP; in i2c_is_stop_op()
588 CONTAINER_OF(dev->state, struct i2c_device_state, devstate); in i2c_xfer_stats()
592 STATS_INC(state->stats, transfer_call_count); in i2c_xfer_stats()
593 STATS_INCN(state->stats, message_count, num_msgs); in i2c_xfer_stats()
601 STATS_INCN(state->stats, bytes_read, bytes_read); in i2c_xfer_stats()
602 STATS_INCN(state->stats, bytes_written, bytes_written); in i2c_xfer_stats()
624 CONTAINER_OF(dev->state, struct i2c_device_state, devstate); \
625 stats_init(&state->stats.s_hdr, STATS_SIZE_32, 4, \
627 stats_register(dev->name, &(state->stats.s_hdr)); \
708 * @param dev_config Bit-packed 32-bit value to the device runtime configuration
712 * @retval -EIO General input / output error, failed to configure device.
720 (const struct i2c_driver_api *)dev->api; in z_impl_i2c_configure()
722 return api->configure(dev, dev_config); in z_impl_i2c_configure()
734 * up to date with current configuration.
737 * @param dev_config Pointer to return bit-packed 32-bit value of
741 * @retval -EIO General input / output error.
742 * @retval -ERANGE Configured I2C frequency is invalid.
743 * @retval -ENOSYS If get config is not implemented
749 const struct i2c_driver_api *api = (const struct i2c_driver_api *)dev->api; in z_impl_i2c_get_config()
751 if (api->get_config == NULL) { in z_impl_i2c_get_config()
752 return -ENOSYS; in z_impl_i2c_get_config()
755 return api->get_config(dev, dev_config); in z_impl_i2c_get_config()
774 * limitations on support for multi-message bus transactions.
787 * @retval -EIO General input / output error.
798 (const struct i2c_driver_api *)dev->api; in z_impl_i2c_transfer()
805 msgs[num_msgs - 1].flags |= I2C_MSG_STOP; in z_impl_i2c_transfer()
808 int res = api->transfer(dev, msgs, num_msgs, addr); in z_impl_i2c_transfer()
839 * @retval -EIO General input / output error.
840 * @retval -ENOSYS If transfer async is not implemented
841 * @retval -EWOULDBLOCK If the device is temporarily busy doing another transfer
851 (const struct i2c_driver_api *)dev->api; in i2c_transfer_cb()
853 if (api->transfer_cb == NULL) { in i2c_transfer_cb()
854 return -ENOSYS; in i2c_transfer_cb()
863 msgs[num_msgs - 1].flags |= I2C_MSG_STOP; in i2c_transfer_cb()
866 return api->transfer_cb(dev, msgs, num_msgs, addr, cb, userdata); in i2c_transfer_cb()
874 * i2c_transfer_cb(spec->bus, msgs, num_msgs, spec->addr, cb, userdata);
890 return i2c_transfer_cb(spec->bus, msgs, num_msgs, spec->addr, cb, userdata); in i2c_transfer_cb_dt()
897 * it to me" transaction pair through a combined write-then-read bus
922 return -EINVAL; in i2c_write_read_cb()
941 * i2c_write_read_cb(spec->bus, msgs, num_msgs,
942 * spec->addr, write_buf,
962 return i2c_write_read_cb(spec->bus, msgs, num_msgs, spec->addr, write_buf, num_write, in i2c_write_read_cb_dt()
989 * @retval -EIO General input / output error.
990 * @retval -ENOSYS If transfer async is not implemented
991 * @retval -EWOULDBLOCK If the device is temporarily busy doing another transfer
999 const struct i2c_driver_api *api = (const struct i2c_driver_api *)dev->api; in i2c_transfer_signal()
1001 if (api->transfer_cb == NULL) { in i2c_transfer_signal()
1002 return -ENOSYS; in i2c_transfer_signal()
1005 return api->transfer_cb(dev, msgs, num_msgs, addr, z_i2c_transfer_signal_cb, sig); in i2c_transfer_signal()
1035 const struct i2c_dt_spec *dt_spec = (const struct i2c_dt_spec *)iodev_sqe->sqe.iodev->data; in i2c_iodev_submit()
1036 const struct device *dev = dt_spec->bus; in i2c_iodev_submit()
1037 const struct i2c_driver_api *api = (const struct i2c_driver_api *)dev->api; in i2c_iodev_submit()
1039 if (api->iodev_submit == NULL) { in i2c_iodev_submit()
1040 rtio_iodev_sqe_err(iodev_sqe, -ENOSYS); in i2c_iodev_submit()
1043 api->iodev_submit(dt_spec->bus, iodev_sqe); in i2c_iodev_submit()
1102 * i2c_transfer(spec->bus, msgs, num_msgs, spec->addr);
1113 return i2c_transfer(spec->bus, msgs, num_msgs, spec->addr); in i2c_transfer_dt()
1124 * @retval -EBUSY If bus is not clear after recovery attempt.
1125 * @retval -EIO General input / output error.
1126 * @retval -ENOSYS If bus recovery is not implemented
1133 (const struct i2c_driver_api *)dev->api; in z_impl_i2c_recover_bus()
1135 if (api->recover_bus == NULL) { in z_impl_i2c_recover_bus()
1136 return -ENOSYS; in z_impl_i2c_recover_bus()
1139 return api->recover_bus(dev); in z_impl_i2c_recover_bus()
1148 * struct member. Addressing mode - 7 or 10 bit - depends on the 'flags'
1162 * @retval -EINVAL If parameters are invalid
1163 * @retval -EIO General input / output error.
1164 * @retval -ENOSYS If target mode is not implemented
1170 (const struct i2c_driver_api *)dev->api; in i2c_target_register()
1172 if (api->target_register == NULL) { in i2c_target_register()
1173 return -ENOSYS; in i2c_target_register()
1176 return api->target_register(dev, cfg); in i2c_target_register()
1192 * @retval -EINVAL If parameters are invalid
1193 * @retval -ENOSYS If target mode is not implemented
1199 (const struct i2c_driver_api *)dev->api; in i2c_target_unregister()
1201 if (api->target_unregister == NULL) { in i2c_target_unregister()
1202 return -ENOSYS; in i2c_target_unregister()
1205 return api->target_unregister(dev, cfg); in i2c_target_unregister()
1218 * @retval -EINVAL If parameters are invalid
1219 * @retval -EIO General input / output error.
1226 (const struct i2c_target_driver_api *)dev->api; in z_impl_i2c_target_driver_register()
1228 return api->driver_register(dev); in z_impl_i2c_target_driver_register()
1242 * @retval -EINVAL If parameters are invalid
1249 (const struct i2c_target_driver_api *)dev->api; in z_impl_i2c_target_driver_unregister()
1251 return api->driver_unregister(dev); in z_impl_i2c_target_driver_unregister()
1255 * Derived i2c APIs -- all implemented in terms of i2c_transfer()
1270 * @retval -EIO General input / output error.
1289 * i2c_write(spec->bus, buf, num_bytes, spec->addr);
1300 return i2c_write(spec->bus, buf, num_bytes, spec->addr); in i2c_write_dt()
1315 * @retval -EIO General input / output error.
1334 * i2c_read(spec->bus, buf, num_bytes, spec->addr);
1345 return i2c_read(spec->bus, buf, num_bytes, spec->addr); in i2c_read_dt()
1352 * it to me" transaction pair through a combined write-then-read bus
1388 * i2c_write_read(spec->bus, spec->addr,
1404 return i2c_write_read(spec->bus, spec->addr, in i2c_write_read_dt()
1425 * @retval -EIO General input / output error.
1443 * i2c_burst_read(spec->bus, spec->addr, start_addr, buf, num_bytes);
1457 return i2c_burst_read(spec->bus, spec->addr, in i2c_burst_read_dt()
1480 * @retval -EIO General input / output error.
1506 * i2c_burst_write(spec->bus, spec->addr, start_addr, buf, num_bytes);
1520 return i2c_burst_write(spec->bus, spec->addr, in i2c_burst_write_dt()
1527 * This routine reads the value of an 8-bit internal register of an I2C
1537 * @retval -EIO General input / output error.
1553 * i2c_reg_read_byte(spec->bus, spec->addr, reg_addr, value);
1564 return i2c_reg_read_byte(spec->bus, spec->addr, reg_addr, value); in i2c_reg_read_byte_dt()
1570 * This routine writes a value to an 8-bit internal register of an I2C
1583 * @retval -EIO General input / output error.
1599 * i2c_reg_write_byte(spec->bus, spec->addr, reg_addr, value);
1610 return i2c_reg_write_byte(spec->bus, spec->addr, reg_addr, value); in i2c_reg_write_byte_dt()
1616 * This routine updates the value of a set of bits from an 8-bit internal
1630 * @retval -EIO General input / output error.
1658 * i2c_reg_update_byte(spec->bus, spec->addr, reg_addr, mask, value);
1671 return i2c_reg_update_byte(spec->bus, spec->addr, in i2c_reg_update_byte_dt()