---
tag: m0260
title: I2C Send
brief: Send data to the I2C bus.
author: thinkyhead

requires: EXPERIMENTAL_I2CBUS
group: i2c

codes: [ M260 ]

notes: Requires `EXPERIMENTAL_I2CBUS`.

parameters:
  -
    tag: A
    optional: true
    description: The bus address to send to
    values:
      -
        tag: addr
        type: byte
  -
    tag: B
    optional: true
    description: The byte to add to the buffer
    values:
      -
        tag: byte
        type: byte
  -
    tag: R
    optional: true
    description: Reset and rewind the I2C buffer
    values:
      -
        tag: flag
        type: bool
  -
    tag: S
    optional: true
    description: Send flag. Flush the buffer to the bus.
    values:
      -
        tag: flag
        type: bool

examples:
  -
    pre: Send "Marlin" to the slave device with address 0x63 (99)
    code: |
      M260 A99  ; Target slave address
      M260 B77  ; M
      M260 B97  ; a
      M260 B114 ; r
      M260 B108 ; l
      M260 B105 ; i
      M260 B110 ; n
      M260 S1   ; Send the current buffer
  -
    pre: Request 6 bytes from slave device with address 0x63 (99)
    code: M261 A99 B5
  -
    code: 'i2c-reply: from:99 bytes:5 data:hello'

---

Utility to send data over the I2C bus.
