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)
static int32_t GetFrequency(int32_t bus);
Current bus speed in Hz.
Returns int
Initialize(int bus, int frequency)
static void Initialize(int32_t bus, int32_t 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.
| Parameter | Type | Description |
|---|---|---|
bus | int | A bus constant (for example EPN256.I2c.I2c5). |
frequency | int | Bus speed in Hz (default 400 kHz). |
UnInitialize(int bus)
static void UnInitialize(int32_t bus);
Releases the bus's pins back to free GPIO.