MiraOS I2C driver.
More...
#include <stdint.h>
Go to the source code of this file.
MiraOS I2C driver.
- Author
- LumenRadio AB
- Date
- 17 Jan 2016 The MiraOS library provides functions for controlling the Mira radio module, sending/receiving messages, controlling peripherals, etc.
- See also
- http://docs.lumenrad.io/mira
Error codes for I2C master. Note that combination of errors can exist, in that case error codes are OR'd in the result code.
Enumerator |
---|
MIRA_I2C_MASTER_ERR_NONE |
Success
|
MIRA_I2C_MASTER_ERR_ADDR_ACK |
No ack on address
|
MIRA_I2C_MASTER_ERR_DATA_ACK |
No ack on data
|
MIRA_I2C_MASTER_ERR_ARB_LOST |
Arbitration lost
|
Supported pull-up options for the I2C bus.
Enumerator |
---|
MIRA_I2C_NO_PULLUPS |
Do not enable internal pull-ups (external pull-up must be present)
|
MIRA_I2C_USE_PULLUPS |
Enable internal pull-ups
|
Supported I2C bus speeds.
Enumerator |
---|
MIRA_I2C_NORMAL_BUS_SPEED |
100KHz I2C
|
MIRA_I2C_FAST_BUS_SPEED |
400KHz I2C
|
Receive multiple bytes.
- Parameters
-
address | 7 bit I2C chip address (without R/W bit) |
data_pointer | pointer to where to write received byte |
length | number of bytes |
- Returns
- MiraI2CErrorCodeFlags
Send multiple bytes.
- Parameters
-
address | 7 bit I2C chip address (without R/W bit) |
data_pointer | pointer to data to send |
length | number of bytes |
- Returns
- MiraI2CErrorCodeFlags
Initialize the I2C driver.
- Parameters
-
speed | Bus speed |
pullups | Use internal pull-ups |
- Returns
- void
Receive a single byte.
- Parameters
-
address | 7 bit I2C chip address (without R/W bit) |
data_pointer | pointer to where to write received byte |
- Returns
- MiraI2CErrorCodeFlags
Send a single byte.
- Parameters
-
address | 7 bit I2C chip address (without R/W bit) |
data | data byte to send |
- Returns
- void