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.

public static class I2cController

Methods​

GetFrequency(int bus)​

public static int GetFrequency(int bus)

Current bus speed in Hz.

Returns int

Initialize(int bus, int frequency)​

public static void Initialize(int bus, int frequency)

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)​

public static void UnInitialize(int bus)

Releases the bus's pins back to free GPIO.