![]() |
Ultibo API
C/C++ API for Ultibo Core
|
Go to the source code of this file.
Data Structures | |
| struct | _I2C_PROPERTIES |
| struct | _I2C_DEVICE |
Macros | |
| #define | I2C_NAME_PREFIX "I2C" |
| Name prefix for I2C Devices. | |
| #define | I2CSLAVE_NAME_PREFIX "I2CSlave" |
| Name prefix for I2C Slave Devices. | |
| #define | I2C_TYPE_NONE 0 |
| #define | I2C_TYPE_MASTER 1 |
| #define | I2C_TYPE_SLAVE 2 |
| #define | I2C_TYPE_MAX 2 |
| #define | I2C_STATE_DISABLED 0 |
| #define | I2C_STATE_ENABLED 1 |
| #define | I2C_STATE_MAX 1 |
| #define | I2C_FLAG_NONE 0x00000000 |
| #define | I2C_FLAG_SLAVE 0x00000001 |
| Device is a slave not a master. | |
| #define | I2C_FLAG_10BIT 0x00000002 |
| Device supports 10bit addressing. | |
| #define | I2C_FLAG_16BIT 0x00000004 |
| Device supports 16bit addressing. | |
| #define | I2C_FLAG_DMA 0x00000008 |
| Device supports DMA transfers. | |
| #define | I2C_TRANSFER_NONE 0x00000000 |
| #define | I2C_TRANSFER_DMA 0x00000001 |
| Use DMA for transfer (Write/Read) (If supported) (Note: Buffers must be DMA compatible). | |
| #define | I2C_TRANSFER_IGNORE_NAK 0x00000002 |
| Ignore NAK responses and continue (For compatibility with unusual devices). | |
Typedefs | |
| typedef struct _I2C_PROPERTIES | I2C_PROPERTIES |
| typedef struct _I2C_DEVICE | I2C_DEVICE |
| typedef uint32_t STDCALL(* | i2c_enumerate_cb) (I2C_DEVICE *i2c, void *data) |
| typedef uint32_t STDCALL(* | i2c_notification_cb) (DEVICE *device, void *data, uint32_t notification) |
| typedef uint32_t STDCALL(* | i2c_device_start_proc) (I2C_DEVICE *i2c, uint32_t rate) |
| typedef uint32_t STDCALL(* | i2c_device_stop_proc) (I2C_DEVICE *i2c) |
| typedef uint32_t STDCALL(* | i2c_device_read_proc) (I2C_DEVICE *i2c, uint16_t address, void *buffer, uint32_t size, uint32_t flags, uint32_t *count) |
| typedef uint32_t STDCALL(* | i2c_device_write_proc) (I2C_DEVICE *i2c, uint16_t address, void *buffer, uint32_t size, uint32_t flags, uint32_t *count) |
| typedef uint32_t STDCALL(* | i2c_device_write_read_proc) (I2C_DEVICE *i2c, uint16_t address, void *initial, uint32_t len, void *data, uint32_t size, uint32_t flags, uint32_t *count) |
| typedef uint32_t STDCALL(* | i2c_device_write_write_proc) (I2C_DEVICE *i2c, uint16_t address, void *initial, uint32_t len, void *data, uint32_t size, uint32_t flags, uint32_t *count) |
| typedef uint32_t STDCALL(* | i2c_device_get_rate_proc) (I2C_DEVICE *i2c) |
| typedef uint32_t STDCALL(* | i2c_device_set_rate_proc) (I2C_DEVICE *i2c, uint32_t rate) |
| typedef uint16_t STDCALL(* | i2c_device_get_address_proc) (I2C_DEVICE *i2c) |
| typedef uint32_t STDCALL(* | i2c_device_set_address_proc) (I2C_DEVICE *i2c, uint16_t address) |
| typedef uint32_t STDCALL(* | i2c_device_get_properties_proc) (I2C_DEVICE *i2c, I2C_PROPERTIES *properties) |
Functions | |
| uint32_t STDCALL | i2c_device_start (I2C_DEVICE *i2c, uint32_t rate) |
| Start the specified I2C device ready for reading and writing. | |
| uint32_t STDCALL | i2c_device_stop (I2C_DEVICE *i2c) |
| Stop the specified I2C device and terminate reading and writing. | |
| uint32_t STDCALL | i2c_device_read (I2C_DEVICE *i2c, uint16_t address, void *buffer, uint32_t size, uint32_t *count) |
| Read data from the specified I2C device. | |
| uint32_t STDCALL | i2c_device_read_ex (I2C_DEVICE *i2c, uint16_t address, void *buffer, uint32_t size, uint32_t flags, uint32_t *count) |
| Read data from the specified I2C device. | |
| uint32_t STDCALL | i2c_device_write (I2C_DEVICE *i2c, uint16_t address, void *buffer, uint32_t size, uint32_t *count) |
| Write data to the specified I2C device. | |
| uint32_t STDCALL | i2c_device_write_ex (I2C_DEVICE *i2c, uint16_t address, void *buffer, uint32_t size, uint32_t flags, uint32_t *count) |
| Write data to the specified I2C device. | |
| uint32_t STDCALL | i2c_device_write_read (I2C_DEVICE *i2c, uint16_t address, void *initial, uint32_t len, void *data, uint32_t size, uint32_t *count) |
| Write data to and Read data from the specified I2C device in one operation Useful for devices that require a register address specified before a read (eg EEPROM devices). | |
| uint32_t STDCALL | i2c_device_write_read_ex (I2C_DEVICE *i2c, uint16_t address, void *initial, uint32_t len, void *data, uint32_t size, uint32_t flags, uint32_t *count) |
| Write data to and Read data from the specified I2C device in one operation Useful for devices that require a register address specified before a read (eg EEPROM devices). | |
| uint32_t STDCALL | i2c_device_write_write (I2C_DEVICE *i2c, uint16_t address, void *initial, uint32_t len, void *data, uint32_t size, uint32_t *count) |
| Write 2 data blocks to the specified I2C device in one operation Useful for devices that require a register address specified before a write (eg EEPROM devices). | |
| uint32_t STDCALL | i2c_device_write_write_ex (I2C_DEVICE *i2c, uint16_t address, void *initial, uint32_t len, void *data, uint32_t size, uint32_t flags, uint32_t *count) |
| Write 2 data blocks to the specified I2C device in one operation Useful for devices that require a register address specified before a write (eg EEPROM devices). | |
| uint32_t STDCALL | i2c_device_get_rate (I2C_DEVICE *i2c) |
| Get the clock rate of the specified I2C device. | |
| uint32_t STDCALL | i2c_device_set_rate (I2C_DEVICE *i2c, uint32_t rate) |
| Set the clock rate for the specified I2C device. | |
| uint16_t STDCALL | i2c_device_get_address (I2C_DEVICE *i2c) |
| Get the slave address for the specified I2C device. | |
| uint32_t STDCALL | i2c_device_set_address (I2C_DEVICE *i2c, uint16_t address) |
| Set the slave address for the specified I2C device. | |
| uint32_t STDCALL | i2c_device_properties (I2C_DEVICE *i2c, I2C_PROPERTIES *properties) |
| Get the properties for the specified I2C device. | |
| uint32_t STDCALL | i2c_device_get_properties (I2C_DEVICE *i2c, I2C_PROPERTIES *properties) |
| Get the properties for the specified I2C device. | |
| I2C_DEVICE *STDCALL | i2c_device_create (void) |
| Create a new I2C entry. | |
| I2C_DEVICE *STDCALL | i2c_device_create_ex (uint32_t size) |
| Create a new I2C entry. | |
| uint32_t STDCALL | i2c_device_destroy (I2C_DEVICE *i2c) |
| Destroy an existing I2C entry. | |
| uint32_t STDCALL | i2c_device_register (I2C_DEVICE *i2c) |
| Register a new I2C in the I2C table. | |
| uint32_t STDCALL | i2c_device_deregister (I2C_DEVICE *i2c) |
| Deregister an I2C from the I2C table. | |
| I2C_DEVICE *STDCALL | i2c_device_find (uint32_t i2cid) |
| Find an I2C device by ID in the I2C table. | |
| I2C_DEVICE *STDCALL | i2c_device_find_by_name (const char *name) |
| Find an I2C device by name in the device table. | |
| I2C_DEVICE *STDCALL | i2c_device_find_by_description (const char *description) |
| Find an I2C device by description in the device table. | |
| uint32_t STDCALL | i2c_device_enumerate (i2c_enumerate_cb callback, void *data) |
| Enumerate all I2C devices in the I2C table. | |
| uint32_t STDCALL | i2c_device_notification (I2C_DEVICE *i2c, i2c_notification_cb callback, void *data, uint32_t notification, uint32_t flags) |
| Register a notification for I2C device changes. | |
| uint32_t STDCALL | i2c_slave_start (I2C_DEVICE *i2c) |
| Start the specified I2C slave ready for reading and writing. | |
| uint32_t STDCALL | i2c_slave_stop (I2C_DEVICE *i2c) |
| Stop the specified I2C slave and terminate reading and writing. | |
| uint32_t STDCALL | i2c_slave_read (I2C_DEVICE *i2c, void *buffer, uint32_t size, uint32_t *count) |
| Read data from the specified I2C slave. | |
| uint32_t STDCALL | i2c_slave_write (I2C_DEVICE *i2c, void *buffer, uint32_t size, uint32_t *count) |
| Write data to the specified I2C slave. | |
| uint16_t STDCALL | i2c_slave_get_address (I2C_DEVICE *i2c) |
| Get the address for the specified I2C slave. | |
| uint32_t STDCALL | i2c_slave_set_address (I2C_DEVICE *i2c, uint16_t address) |
| Set the address for the specified I2C slave. | |
| uint32_t STDCALL | i2c_slave_get_properties (I2C_DEVICE *i2c, I2C_PROPERTIES *properties) |
| Get the properties for the specified I2C slave. | |
| I2C_DEVICE *STDCALL | i2c_slave_create (void) |
| Create a new I2C slave entry. | |
| I2C_DEVICE *STDCALL | i2c_slave_create_ex (uint32_t size) |
| Create a new I2C slave entry. | |
| uint32_t STDCALL | i2c_slave_destroy (I2C_DEVICE *i2c) |
| Destroy an existing I2C slave entry. | |
| uint32_t STDCALL | i2c_slave_register (I2C_DEVICE *i2c) |
| Register a new I2C slave in the I2C table. | |
| uint32_t STDCALL | i2c_slave_deregister (I2C_DEVICE *i2c) |
| Deregister an I2C slave from the I2C table. | |
| I2C_DEVICE *STDCALL | i2c_slave_find (uint32_t i2cid) |
| Find an I2C slave by ID in the I2C table. | |
| I2C_DEVICE *STDCALL | i2c_slave_find_by_name (const char *name) |
| Find an I2C slave by name in the device table. | |
| I2C_DEVICE *STDCALL | i2c_slave_find_by_description (const char *description) |
| Find an I2C slave by description in the device table. | |
| uint32_t STDCALL | i2c_get_count (void) |
| Get the current I2C count. | |
| I2C_DEVICE *STDCALL | i2c_device_get_default (void) |
| Get the current default I2C device. | |
| uint32_t STDCALL | i2c_device_set_default (I2C_DEVICE *i2c) |
| Set the current default I2C device. | |
| I2C_DEVICE *STDCALL | i2c_device_check (I2C_DEVICE *i2c) |
| Check if the supplied I2C is in the I2C table. | |
| BOOL STDCALL | i2c_device_is_slave (I2C_DEVICE *i2c) |
| Check if the supplied I2C is a slave device. | |
| uint32_t STDCALL | i2c_type_to_string (uint32_t i2ctype, char *string, uint32_t len) |
| Convert an I2C type value to a string. | |
| uint32_t STDCALL | i2c_state_to_string (uint32_t i2cstate, char *string, uint32_t len) |
| Convert an I2C state value to a string. | |
| BOOL STDCALL | i2c_is7bit_address (uint16_t address) |
| Determine if the supplied address is a 7bit address. | |
| BOOL STDCALL | i2c_is10bit_address (uint16_t address) |
| Determine if the supplied address is a 10bit address. | |
| #define I2C_NAME_PREFIX "I2C" |
Name prefix for I2C Devices.
I2C specific constants
| #define I2CSLAVE_NAME_PREFIX "I2CSlave" |
Name prefix for I2C Slave Devices.
| #define I2C_TYPE_NONE 0 |
I2C Device Types
| #define I2C_TYPE_MASTER 1 |
| #define I2C_TYPE_SLAVE 2 |
| #define I2C_TYPE_MAX 2 |
| #define I2C_STATE_DISABLED 0 |
I2C Device States
| #define I2C_STATE_ENABLED 1 |
| #define I2C_STATE_MAX 1 |
| #define I2C_FLAG_NONE 0x00000000 |
I2C Device Flags
| #define I2C_FLAG_SLAVE 0x00000001 |
Device is a slave not a master.
| #define I2C_FLAG_10BIT 0x00000002 |
Device supports 10bit addressing.
| #define I2C_FLAG_16BIT 0x00000004 |
Device supports 16bit addressing.
| #define I2C_FLAG_DMA 0x00000008 |
Device supports DMA transfers.
| #define I2C_TRANSFER_NONE 0x00000000 |
I2C Transfer Flags
| #define I2C_TRANSFER_DMA 0x00000001 |
Use DMA for transfer (Write/Read) (If supported) (Note: Buffers must be DMA compatible).
| #define I2C_TRANSFER_IGNORE_NAK 0x00000002 |
Ignore NAK responses and continue (For compatibility with unusual devices).
| typedef struct _I2C_PROPERTIES I2C_PROPERTIES |
I2C specific types I2C Properties
| typedef struct _I2C_DEVICE I2C_DEVICE |
I2C Device
| typedef uint32_t STDCALL(* i2c_enumerate_cb) (I2C_DEVICE *i2c, void *data) |
I2C Enumeration Callback
I2C Notification Callback
| typedef uint32_t STDCALL(* i2c_device_start_proc) (I2C_DEVICE *i2c, uint32_t rate) |
I2C Device Methods
| typedef uint32_t STDCALL(* i2c_device_stop_proc) (I2C_DEVICE *i2c) |
| typedef uint32_t STDCALL(* i2c_device_read_proc) (I2C_DEVICE *i2c, uint16_t address, void *buffer, uint32_t size, uint32_t flags, uint32_t *count) |
| typedef uint32_t STDCALL(* i2c_device_write_proc) (I2C_DEVICE *i2c, uint16_t address, void *buffer, uint32_t size, uint32_t flags, uint32_t *count) |
| typedef uint32_t STDCALL(* i2c_device_write_read_proc) (I2C_DEVICE *i2c, uint16_t address, void *initial, uint32_t len, void *data, uint32_t size, uint32_t flags, uint32_t *count) |
| typedef uint32_t STDCALL(* i2c_device_write_write_proc) (I2C_DEVICE *i2c, uint16_t address, void *initial, uint32_t len, void *data, uint32_t size, uint32_t flags, uint32_t *count) |
| typedef uint32_t STDCALL(* i2c_device_get_rate_proc) (I2C_DEVICE *i2c) |
| typedef uint32_t STDCALL(* i2c_device_set_rate_proc) (I2C_DEVICE *i2c, uint32_t rate) |
| typedef uint16_t STDCALL(* i2c_device_get_address_proc) (I2C_DEVICE *i2c) |
| typedef uint32_t STDCALL(* i2c_device_set_address_proc) (I2C_DEVICE *i2c, uint16_t address) |
| typedef uint32_t STDCALL(* i2c_device_get_properties_proc) (I2C_DEVICE *i2c, I2C_PROPERTIES *properties) |
| uint32_t STDCALL i2c_device_start | ( | I2C_DEVICE * | i2c, |
| uint32_t | rate ) |
Start the specified I2C device ready for reading and writing.
I2C Functions
| I2C | The I2C device to start |
| Rate | The clock rate to set for the device (0 to use the default rate) |
| uint32_t STDCALL i2c_device_stop | ( | I2C_DEVICE * | i2c | ) |
Stop the specified I2C device and terminate reading and writing.
| I2C | The I2C device to stop |
| uint32_t STDCALL i2c_device_read | ( | I2C_DEVICE * | i2c, |
| uint16_t | address, | ||
| void * | buffer, | ||
| uint32_t | size, | ||
| uint32_t * | count ) |
Read data from the specified I2C device.
| I2C | The I2C device to read from |
| Address | The slave address to read from (I2C_ADDRESS_INVALID to use the current address) |
| Buffer | Pointer to a buffer to receive the data |
| Size | The size of the buffer |
| Count | The number of bytes read on return |
| uint32_t STDCALL i2c_device_read_ex | ( | I2C_DEVICE * | i2c, |
| uint16_t | address, | ||
| void * | buffer, | ||
| uint32_t | size, | ||
| uint32_t | flags, | ||
| uint32_t * | count ) |
Read data from the specified I2C device.
| I2C | The I2C device to read from |
| Address | The slave address to read from (I2C_ADDRESS_INVALID to use the current address) |
| Buffer | Pointer to a buffer to receive the data |
| Size | The size of the buffer |
| Flags | The flags for this transfer (eg I2C_TRANSFER_DMA) |
| Count | The number of bytes read on return |
| uint32_t STDCALL i2c_device_write | ( | I2C_DEVICE * | i2c, |
| uint16_t | address, | ||
| void * | buffer, | ||
| uint32_t | size, | ||
| uint32_t * | count ) |
Write data to the specified I2C device.
| I2C | The I2C device to write to |
| Address | The slave address to write to (I2C_ADDRESS_INVALID to use the current address) |
| Buffer | Pointer to a buffer of data to transmit |
| Size | The size of the buffer |
| Count | The number of bytes written on return |
| uint32_t STDCALL i2c_device_write_ex | ( | I2C_DEVICE * | i2c, |
| uint16_t | address, | ||
| void * | buffer, | ||
| uint32_t | size, | ||
| uint32_t | flags, | ||
| uint32_t * | count ) |
Write data to the specified I2C device.
| I2C | The I2C device to write to |
| Address | The slave address to write to (I2C_ADDRESS_INVALID to use the current address) |
| Buffer | Pointer to a buffer of data to transmit |
| Size | The size of the buffer |
| Flags | The flags for this transfer (eg I2C_TRANSFER_DMA) |
| Count | The number of bytes written on return |
| uint32_t STDCALL i2c_device_write_read | ( | I2C_DEVICE * | i2c, |
| uint16_t | address, | ||
| void * | initial, | ||
| uint32_t | len, | ||
| void * | data, | ||
| uint32_t | size, | ||
| uint32_t * | count ) |
Write data to and Read data from the specified I2C device in one operation Useful for devices that require a register address specified before a read (eg EEPROM devices).
| I2C | The I2C device to write to and read from |
| Address | The slave address to write to (I2C_ADDRESS_INVALID to use the current address) |
| Initial | Pointer to the initial buffer to transmit |
| Len | The size of the initial buffer |
| Data | Pointer to a buffer to receive the data |
| Size | The size of the data buffer |
| Count | The number of bytes read on return |
| uint32_t STDCALL i2c_device_write_read_ex | ( | I2C_DEVICE * | i2c, |
| uint16_t | address, | ||
| void * | initial, | ||
| uint32_t | len, | ||
| void * | data, | ||
| uint32_t | size, | ||
| uint32_t | flags, | ||
| uint32_t * | count ) |
Write data to and Read data from the specified I2C device in one operation Useful for devices that require a register address specified before a read (eg EEPROM devices).
| I2C | The I2C device to write to and read from |
| Address | The slave address to write to (I2C_ADDRESS_INVALID to use the current address) |
| Initial | Pointer to the initial buffer to transmit |
| Len | The size of the initial buffer |
| Data | Pointer to a buffer to receive the data |
| Size | The size of the data buffer |
| Flags | The flags for this transfer (eg I2C_TRANSFER_DMA) |
| Count | The number of bytes read on return |
| uint32_t STDCALL i2c_device_write_write | ( | I2C_DEVICE * | i2c, |
| uint16_t | address, | ||
| void * | initial, | ||
| uint32_t | len, | ||
| void * | data, | ||
| uint32_t | size, | ||
| uint32_t * | count ) |
Write 2 data blocks to the specified I2C device in one operation Useful for devices that require a register address specified before a write (eg EEPROM devices).
| I2C | The I2C device to write to |
| Address | The slave address to write to (I2C_ADDRESS_INVALID to use the current address) |
| Initial | Pointer to the initial buffer to transmit |
| Len | The size of the initial buffer |
| Data | Pointer to a buffer of data to transmit |
| Size | The size of the data buffer |
| Count | The number of bytes of data written on return |
| uint32_t STDCALL i2c_device_write_write_ex | ( | I2C_DEVICE * | i2c, |
| uint16_t | address, | ||
| void * | initial, | ||
| uint32_t | len, | ||
| void * | data, | ||
| uint32_t | size, | ||
| uint32_t | flags, | ||
| uint32_t * | count ) |
Write 2 data blocks to the specified I2C device in one operation Useful for devices that require a register address specified before a write (eg EEPROM devices).
| I2C | The I2C device to write to |
| Address | The slave address to write to (I2C_ADDRESS_INVALID to use the current address) |
| Initial | Pointer to the initial buffer to transmit |
| Len | The size of the initial buffer |
| Data | Pointer to a buffer of data to transmit |
| Size | The size of the data buffer |
| Flags | The flags for this transfer (eg I2C_TRANSFER_DMA) |
| Count | The number of bytes of data written on return |
| uint32_t STDCALL i2c_device_get_rate | ( | I2C_DEVICE * | i2c | ) |
Get the clock rate of the specified I2C device.
| I2C | The I2C device to get the clock rate from |
| uint32_t STDCALL i2c_device_set_rate | ( | I2C_DEVICE * | i2c, |
| uint32_t | rate ) |
Set the clock rate for the specified I2C device.
| I2C | The I2C device to set the clock rate for |
| Rate | The clock rate to set in Hz |
| uint16_t STDCALL i2c_device_get_address | ( | I2C_DEVICE * | i2c | ) |
Get the slave address for the specified I2C device.
| I2C | The I2C device to get the slave address from |
| uint32_t STDCALL i2c_device_set_address | ( | I2C_DEVICE * | i2c, |
| uint16_t | address ) |
Set the slave address for the specified I2C device.
| I2C | The I2C device to set the slave address for |
| Address | The slave address to set |
| uint32_t STDCALL i2c_device_properties | ( | I2C_DEVICE * | i2c, |
| I2C_PROPERTIES * | properties ) |
Get the properties for the specified I2C device.
| I2C | The I2C device to get properties from |
| Properties | Pointer to a TI2CProperties structure to fill in |
| uint32_t STDCALL i2c_device_get_properties | ( | I2C_DEVICE * | i2c, |
| I2C_PROPERTIES * | properties ) |
Get the properties for the specified I2C device.
| I2C | The I2C device to get properties from |
| Properties | Pointer to a TI2CProperties structure to fill in |
| I2C_DEVICE *STDCALL i2c_device_create | ( | void | ) |
Create a new I2C entry.
| I2C_DEVICE *STDCALL i2c_device_create_ex | ( | uint32_t | size | ) |
Create a new I2C entry.
| Size | Size in bytes to allocate for new I2C (Including the I2C entry) |
| uint32_t STDCALL i2c_device_destroy | ( | I2C_DEVICE * | i2c | ) |
Destroy an existing I2C entry.
| I2C | The I2C device to destroy |
| uint32_t STDCALL i2c_device_register | ( | I2C_DEVICE * | i2c | ) |
Register a new I2C in the I2C table.
| I2C | The I2C device to register |
| uint32_t STDCALL i2c_device_deregister | ( | I2C_DEVICE * | i2c | ) |
Deregister an I2C from the I2C table.
| I2C | The I2C device to deregister |
| I2C_DEVICE *STDCALL i2c_device_find | ( | uint32_t | i2cid | ) |
Find an I2C device by ID in the I2C table.
| I2CId | The ID number of the I2C device to find |
| I2C_DEVICE *STDCALL i2c_device_find_by_name | ( | const char * | name | ) |
Find an I2C device by name in the device table.
| Name | The name of the I2C device to find (eg I2C0) |
| I2C_DEVICE *STDCALL i2c_device_find_by_description | ( | const char * | description | ) |
Find an I2C device by description in the device table.
| Description | The description of the I2C to find (eg BCM2837 BSC1 Master I2C) |
| uint32_t STDCALL i2c_device_enumerate | ( | i2c_enumerate_cb | callback, |
| void * | data ) |
Enumerate all I2C devices in the I2C table.
| Callback | The callback function to call for each I2C device in the table |
| Data | A private data pointer to pass to callback for each I2C device in the table |
| uint32_t STDCALL i2c_device_notification | ( | I2C_DEVICE * | i2c, |
| i2c_notification_cb | callback, | ||
| void * | data, | ||
| uint32_t | notification, | ||
| uint32_t | flags ) |
Register a notification for I2C device changes.
| Device | The I2C device to notify changes for (Optional, pass nil for all I2C devices) |
| Callback | The function to call when a notification event occurs |
| Data | A private data pointer to pass to callback when a notification event occurs |
| Notification | The events to register for notification of (eg DEVICE_NOTIFICATION_REGISTER) |
| Flags | The flags to control the notification (eg NOTIFIER_FLAG_WORKER) |
| uint32_t STDCALL i2c_slave_start | ( | I2C_DEVICE * | i2c | ) |
Start the specified I2C slave ready for reading and writing.
I2C Slave Functions
| I2C | The I2C slave to start |
| uint32_t STDCALL i2c_slave_stop | ( | I2C_DEVICE * | i2c | ) |
Stop the specified I2C slave and terminate reading and writing.
| I2C | The I2C slave to stop |
| uint32_t STDCALL i2c_slave_read | ( | I2C_DEVICE * | i2c, |
| void * | buffer, | ||
| uint32_t | size, | ||
| uint32_t * | count ) |
Read data from the specified I2C slave.
| I2C | The I2C slave to read from |
| Buffer | Pointer to a buffer to receive the data |
| Size | The size of the buffer |
| Count | The number of bytes read on return |
| uint32_t STDCALL i2c_slave_write | ( | I2C_DEVICE * | i2c, |
| void * | buffer, | ||
| uint32_t | size, | ||
| uint32_t * | count ) |
Write data to the specified I2C slave.
| I2C | The I2C slave to write to |
| Buffer | Pointer to a buffer of data to transmit |
| Size | The size of the buffer |
| Count | The number of bytes written on return |
| uint16_t STDCALL i2c_slave_get_address | ( | I2C_DEVICE * | i2c | ) |
Get the address for the specified I2C slave.
| I2C | The I2C slave to get the address from |
| uint32_t STDCALL i2c_slave_set_address | ( | I2C_DEVICE * | i2c, |
| uint16_t | address ) |
Set the address for the specified I2C slave.
| I2C | The I2C slave to set the address for |
| Address | The address to set |
| uint32_t STDCALL i2c_slave_get_properties | ( | I2C_DEVICE * | i2c, |
| I2C_PROPERTIES * | properties ) |
Get the properties for the specified I2C slave.
| I2C | The I2C slave to get properties from |
| Properties | Pointer to a TI2CProperties structure to fill in |
| I2C_DEVICE *STDCALL i2c_slave_create | ( | void | ) |
Create a new I2C slave entry.
| I2C_DEVICE *STDCALL i2c_slave_create_ex | ( | uint32_t | size | ) |
Create a new I2C slave entry.
| Size | Size in bytes to allocate for new I2C (Including the I2C slave entry) |
| uint32_t STDCALL i2c_slave_destroy | ( | I2C_DEVICE * | i2c | ) |
Destroy an existing I2C slave entry.
| I2C | The I2C slave to destroy |
| uint32_t STDCALL i2c_slave_register | ( | I2C_DEVICE * | i2c | ) |
Register a new I2C slave in the I2C table.
| I2C | The I2C slave to register |
| uint32_t STDCALL i2c_slave_deregister | ( | I2C_DEVICE * | i2c | ) |
Deregister an I2C slave from the I2C table.
| I2C | The I2C slave to deregister |
| I2C_DEVICE *STDCALL i2c_slave_find | ( | uint32_t | i2cid | ) |
Find an I2C slave by ID in the I2C table.
| I2CId | The ID number of the I2C slave to find |
| I2C_DEVICE *STDCALL i2c_slave_find_by_name | ( | const char * | name | ) |
Find an I2C slave by name in the device table.
| Name | The name of the I2C slave to find (eg I2CSlave0) |
| I2C_DEVICE *STDCALL i2c_slave_find_by_description | ( | const char * | description | ) |
Find an I2C slave by description in the device table.
| Description | The description of the I2C slave to find (eg BCM2837 I2C Slave) |
| uint32_t STDCALL i2c_get_count | ( | void | ) |
Get the current I2C count.
I2C Helper Functions
| I2C_DEVICE *STDCALL i2c_device_get_default | ( | void | ) |
Get the current default I2C device.
| uint32_t STDCALL i2c_device_set_default | ( | I2C_DEVICE * | i2c | ) |
Set the current default I2C device.
| I2C_DEVICE *STDCALL i2c_device_check | ( | I2C_DEVICE * | i2c | ) |
Check if the supplied I2C is in the I2C table.
| BOOL STDCALL i2c_device_is_slave | ( | I2C_DEVICE * | i2c | ) |
Check if the supplied I2C is a slave device.
| uint32_t STDCALL i2c_type_to_string | ( | uint32_t | i2ctype, |
| char * | string, | ||
| uint32_t | len ) |
Convert an I2C type value to a string.
| uint32_t STDCALL i2c_state_to_string | ( | uint32_t | i2cstate, |
| char * | string, | ||
| uint32_t | len ) |
Convert an I2C state value to a string.
Determine if the supplied address is a 7bit address.