linux module API docs

The pumpkin_supmcu.linux module contains an implementations of the I2CMaster for the following devices:

I2CLinuxMaster.

I2CLinuxMaster module API docs

class pumpkin_supmcu.linux.I2CLinuxMaster(port)

Class to implement I2C in Linux

property device_name: str

Gets the device’s hostname

Return type

str

property device_pullups: bool

If the I2C SDA/SCL pullups are ON or OFF.

Return type

bool

property device_speed: pumpkin_supmcu.i2c.master.I2CBusSpeed

The default I2C baudrate

Return type

I2CBusSpeed

get_bus_devices()

Gets the available I2C devices from the selected I2C bus and returns a list of device addresses

Return type

List[int]

Returns

A list of device addresses

read(addr, amount)

Reads amount bytes of data from address addr

Parameters
  • addr (int) – The I2C Address to read from.

  • amount (int) – The amount of bytes to read from the bus.

Return type

bytes

Returns

The bytes read from the bus.

write(addr, b)

Writes all of b bytes to address addr

Parameters
  • addr (int) – The I2C Address to write to.

  • b (bytes) – The bytes b to write to the I2C Bus.