Expand description
The C ABI for on-board bus addressing and pin logic.
These functions wrap [pamoja_gpio] for callers that reach the SDK through
the flat C boundary: I2C addressing per NXP UM10204, the four SPI clock modes,
and the pin model that maps a logical “asserted” onto a physical level.
Nothing here allocates or holds state, so nothing here is a handle. An I2C
address is two scalars and crosses by value as PamojaI2cAddress; the rest
are enumerations and small pure functions over them.
Structs§
- Pamoja
I2cAddress - A validated I2C device address.
Enums§
- Pamoja
I2cDirection - Which direction an I2C transfer runs, as the read/write bit encodes it.
- Pamoja
PinEdge - The signal transition that triggers a pin interrupt.
- Pamoja
PinLevel - The physical voltage level on a pin.
- Pamoja
PinPolarity - Whether a signal is asserted by a high or a low physical level.
Constants§
- PAMOJA_
I2C_ FRAME_ MAX - The largest I2C address frame, in bytes: the two a 10-bit address needs.
- PAMOJA_
I2C_ RESERVED_ BELOW - The first 7-bit address above the reserved block at the bottom of the range.
- PAMOJA_
I2C_ RESERVED_ FROM - The lowest 7-bit address the I2C specification keeps for itself.
Functions§
- pamoja_
i2c_ ⚠address_ frame - Writes the address bytes a controller puts on the bus for a transfer.
- pamoja_
i2c_ address_ frame_ len - Returns how many bytes an address frame occupies.
- pamoja_
i2c_ address_ is_ general_ call - Reports whether an address is the general call address
0x00. - pamoja_
i2c_ address_ is_ reserved - Reports whether a 7-bit address falls in a range the I2C specification reserves.
- pamoja_
i2c_ ⚠address_ seven_ bit - Validates a 7-bit I2C address.
- pamoja_
i2c_ ⚠address_ ten_ bit - Validates a 10-bit I2C address.
- pamoja_
pin_ edge_ triggered_ by - Reports whether a change from one level to another fires an interrupt trigger.
- pamoja_
pin_ level_ from_ bool - Returns the level a boolean names.
- pamoja_
pin_ level_ inverted - Returns the opposite level.
- pamoja_
pin_ polarity_ is_ asserted - Reports whether a physical level means the signal is asserted.
- pamoja_
pin_ polarity_ level - Returns the physical level that represents a logical state under a polarity.
- pamoja_
spi_ ⚠mode_ cpol_ cpha - Returns the
(CPOL, CPHA)pair an SPI mode number names. - pamoja_
spi_ mode_ from_ cpol_ cpha - Returns the SPI mode number a
(CPOL, CPHA)pair names.