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.
Dependents: EVAL-CN0535-FMCZ EVAL-CN0535-FMCZ EVAL-AD568x-AD569x EVAL-AD7606 ... more
i2c.cpp File Reference
Implementation of I2C Mbed platform driver interfaces. More...
Go to the source code of this file.
Functions | |
int32_t | i2c_init_noos (struct i2c_desc **desc, const struct i2c_init_param *param) |
Initialize the I2C communication peripheral. | |
int32_t | i2c_remove (struct i2c_desc *desc) |
Free the resources allocated by i2c_init_noos(). | |
int32_t | i2c_write_noos (struct i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit) |
Write data to a slave device. | |
int32_t | i2c_read_noos (struct i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit) |
Read data from a slave device. |
Detailed Description
Implementation of I2C Mbed platform driver interfaces.
Copyright (c) 2019 - 2021 Analog Devices, Inc. All rights reserved.
This software is proprietary to Analog Devices, Inc. and its licensors. By using this software you agree to the terms of the associated Analog Devices Software License Agreement.
Definition in file i2c.cpp.
Function Documentation
int32_t i2c_init_noos | ( | struct i2c_desc ** | desc, |
const struct i2c_init_param * | param | ||
) |
int32_t i2c_read_noos | ( | struct i2c_desc * | desc, |
uint8_t * | data, | ||
uint8_t | bytes_number, | ||
uint8_t | stop_bit | ||
) |
Read data from a slave device.
- Parameters:
-
desc - The I2C descriptor. data - Buffer that will store the received data. bytes_number - Number of bytes to read. stop_bit - Stop condition control. Example: 0 - A stop condition will not be generated; 1 - A stop condition will be generated.
- Returns:
- SUCCESS in case of success, FAILURE otherwise.
The MBED I2C API is reversed for parameter 4 Instead of stop_bit - it has
- Parameters:
-
repeated - Repeated start, true - don't send stop at end default value is false. Inverting here to keep the no-OS/platform_drivers API
int32_t i2c_remove | ( | struct i2c_desc * | desc ) |
Free the resources allocated by i2c_init_noos().
- Parameters:
-
desc - The I2C descriptor.
- Returns:
- SUCCESS in case of success, FAILURE otherwise.
int32_t i2c_write_noos | ( | struct i2c_desc * | desc, |
uint8_t * | data, | ||
uint8_t | bytes_number, | ||
uint8_t | stop_bit | ||
) |
Write data to a slave device.
- Parameters:
-
desc - The I2C descriptor. data - Buffer that stores the transmission data. bytes_number - Number of bytes to write. stop_bit - Stop condition control. Example: 0 - A stop condition will not be generated; 1 - A stop condition will be generated.
- Returns:
- SUCCESS in case of success, FAILURE otherwise.
The MBED I2C API is reversed for parameter 4 Instead of stop_bit - it has
- Parameters:
-
repeated - Repeated start, true - don't send stop at end default value is false. Inverting here to keep the no-OS/platform_drivers API
Generated on Wed Jul 13 2022 14:37:51 by
