#include <i2c.h>
Go to the source code of this file.
Functions | |
| int | HAL_OpenI2cPacket (const HAL_i2cMode_t *i2cMode) |
| Opens resource. field of i2cMode structure i2cClockRate_t clockrate (set by user). Must be chosen from: I2C_CLOCK_RATE_250 - 250 Kb/s clock rate I2C_CLOCK_RATE_125 - 125 Kb/s clock rate I2C_CLOCK_RATE_62 - 62.5 Kb/s clock rate . | |
| int | HAL_CloseI2cPacket () |
| Closes resource. | |
| int | HAL_WriteI2cPacket (uint8_t id, uint8_t length, const uint8_t *data, void(*f)(bool result)) |
| Writes a series of bytes out to the TWI bus. | |
| int | HAL_ReadI2cPacket (uint8_t id, uint8_t length, uint8_t *data, void(*f)(bool result)) |
| Reads the series of bytes from the TWI bus. | |
Definition in file i2cPacket.h.
| int HAL_CloseI2cPacket | ( | ) |
Closes resource.
| int HAL_OpenI2cPacket | ( | const HAL_i2cMode_t * | i2cMode | ) |
Opens resource.
field of i2cMode structure
i2cClockRate_t clockrate (set by user). Must be chosen from:
I2C_CLOCK_RATE_250 - 250 Kb/s clock rate
I2C_CLOCK_RATE_125 - 125 Kb/s clock rate
I2C_CLOCK_RATE_62 - 62.5 Kb/s clock rate
.
| [in] | i2cMode | - pointer to the mode structure. |
| int HAL_ReadI2cPacket | ( | uint8_t | id, | |
| uint8_t | length, | |||
| uint8_t * | data, | |||
| void(*)(bool result) | f | |||
| ) |
Reads the series of bytes from the TWI bus.
| [in] | id | - address of the i2c device on the bus |
| [in] | length | - number of bytes to be read from the bus. |
| [in] | data | - pointer to the data buffer |
| [in] | f | - pointer to the callback function |
| int HAL_WriteI2cPacket | ( | uint8_t | id, | |
| uint8_t | length, | |||
| const uint8_t * | data, | |||
| void(*)(bool result) | f | |||
| ) |
Writes a series of bytes out to the TWI bus.
| [in] | id | - address of the i2c device on the bus |
| [in] | length | - number of bytes to be written to the bus |
| [in] | data | - pointer to the data |
| [in] | f | - pointer to the callback function |
1.5.1-p1