Table des matières

TNY-360 Documentation

I2C

I2C module of the TNY-360 API (code 0x0E).

This module contains actions related to the I2C communication with external devices, like pinging devices, writing registers, and reading registers to devices on the extension port.


List of actions

Here's a list of all the actions available in the i2c module:

0x0E - 0x00

i2c.pingDevice

Pings an I2C device at the specified address to check if it is present on the bus.


Arguments

  • addressuint8

    -

    I2C address of the device to ping.


Return Values

  • foundbool

    -

    Whether a device responded at the specified address.

0x0E - 0x01

i2c.writeRegisters

Writes a sequence of bytes to a register of an I2C device.


Arguments

  • addressuint8

    -

    I2C address of the device to write to.

  • reg_addressuint8

    -

    Register address to write to.

  • lengthuint8

    -

    Number of bytes to write.

  • databyte[]

    -

    Data bytes to write to the register.


No return values

0x0E - 0x02

i2c.readRegisters

Reads a sequence of bytes from a register of an I2C device.


Arguments

  • addressuint8

    -

    I2C address of the device to read from.

  • reg_addressuint8

    -

    Register address to read from.

  • lengthuint8

    -

    Number of bytes to read.


Return Values

  • databyte[]

    -

    Read data bytes (of specified length).

List of types

Here's a list of all the types used in the i2c module:

No custom types found in the actions of the "i2c" module.