Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BLE_API_Tiny_BLE MPU6050-DMP-Seeed-Tiny-BLE mbed
MBED System Layer APIs. More...
Files | |
| file | mbed_i2c.h |
Serial communication functions needed by eMPL to communicate to the MPU devices. | |
Functions | |
| int | mbed_i2c_enable (void) |
| Set up the I2C port and configure the MBED as the master. | |
| int | mbed_i2c_disable (void) |
| Disable I2C communication. | |
| int | mbed_i2c_write (unsigned char slave_addr, unsigned char reg_addr, unsigned char length, unsigned char const *data) |
| Write to a device register. | |
| int | mbed_i2c_read (unsigned char slave_addr, unsigned char reg_addr, unsigned char length, unsigned char *data) |
| Read from a device. | |
Detailed Description
MBED System Layer APIs.
To interface with any platform, eMPL needs access to various system layer functions.
Function Documentation
| int mbed_i2c_disable | ( | void | ) |
Disable I2C communication.
This function will disable the I2C hardware and should be called prior to entering low-power mode.
- Returns:
- 0 if successful.
| int mbed_i2c_enable | ( | void | ) |
Set up the I2C port and configure the MBED as the master.
- Returns:
- 0 if successful.
| int mbed_i2c_read | ( | unsigned char | slave_addr, |
| unsigned char | reg_addr, | ||
| unsigned char | length, | ||
| unsigned char * | data | ||
| ) |
Read from a device.
- Parameters:
-
[in] slave_addr Slave address of device. [in] reg_addr Slave register to be read from. [in] length Number of bytes to read. [out] data Data from register.
- Returns:
- 0 if successful.
Definition at line 29 of file mbed_i2c.c.
| int mbed_i2c_write | ( | unsigned char | slave_addr, |
| unsigned char | reg_addr, | ||
| unsigned char | length, | ||
| unsigned char const * | data | ||
| ) |
Write to a device register.
- Parameters:
-
[in] slave_addr Slave address of device. [in] reg_addr Slave register to be written to. [in] length Number of bytes to write. [out] data Data to be written to register.
- Returns:
- 0 if successful.
Definition at line 12 of file mbed_i2c.c.
Generated on Tue Jul 12 2022 18:38:31 by
1.7.2