Skip to main content

I2cController Class

Package: GHIElectronics.Endpoint.Core
Namespace: GHIElectronics.Endpoint.Core

Chip-neutral entry point for I²C setup. Call once before using I2c.I2cDevice: it brings up the bus and muxes its pins. Dispatches to the right chip helper based on the board detected at startup.

class I2cController: ...

Methods​

GetFrequency(int bus)​

@staticmethod
def GetFrequency(bus: int) -> int:

Current bus speed in Hz.

Returns int

Initialize(int bus, int frequency)​

@staticmethod
def Initialize(bus: int, frequency: int) -> None:

Connects the bus's pins and sets its speed. Only the two pins of this bus are claimed; every other bus's pins stay free.

ParameterTypeDescription
busintA bus constant (for example EPN256.I2c.I2c5).
frequencyintBus speed in Hz (default 400 kHz).

UnInitialize(int bus)​

@staticmethod
def UnInitialize(bus: int) -> None:

Releases the bus's pins back to free GPIO.