I2C driver header.
More...
#include <stdio.h>
#include "bcm2835.h"
Go to the source code of this file.
I2C driver header.
- Author
- D.Qendri
- Date
- 30 May 2015
Definition in file i2c.h.
Definition at line 35 of file i2c.h.
Closes the I2C peripheral.
- Returns
- none
Definition at line 174 of file i2c.c.
void I2C_Initialize |
( |
unsigned char |
address | ) |
|
Initializes the I2C peripheral.
- Parameters
-
address | Address the I2C peripheral is communicating with. |
- Returns
- none
Definition at line 36 of file i2c.c.
void I2C_ReadByteArray |
( |
char |
reg, |
|
|
char * |
buffer, |
|
|
unsigned int |
length |
|
) |
| |
Initializes the I2C peripheral.
- Parameters
-
reg | Address of sensor register, address autoincrements |
*buffer | Pointer to byte data buffer array |
length | length of buffer array |
- Returns
- none
Definition at line 138 of file i2c.c.
unsigned char I2C_ReadByteRegister |
( |
char |
reg | ) |
|
Reads a byte from a register.
- Parameters
-
reg | Address of sensor register. |
- Returns
- val Byte value of register.
Definition at line 122 of file i2c.c.
unsigned int I2C_ReadWordPresetPointer |
( |
void |
| ) |
|
Read the value of a register that has already been select via the address pointer.
- Returns
- Data Value of preset register
Definition at line 161 of file i2c.c.
unsigned int I2C_ReadWordRegister |
( |
char |
reg | ) |
|
unsigned int I2C_ReadWordRegisterRS |
( |
char |
reg | ) |
|
Readm result from a word length register.
- Parameters
-
- Returns
- val Word value of register
Definition at line 148 of file i2c.c.
void I2C_WriteByte |
( |
char |
bdata | ) |
|
Writes a byte value to the I2C bus. This assumes the register pointer is preset.
- Parameters
-
bdata | Send single byte to I2C bus |
- Returns
- none
Definition at line 55 of file i2c.c.
void I2C_WriteByteArray |
( |
char |
reg, |
|
|
char * |
data, |
|
|
unsigned int |
length |
|
) |
| |
Writes a buffer array to the registers.
- Parameters
-
reg | Address of sensor register, address autoincrements |
data | Pointer to byte data buffer array |
length | length of buffer array |
- Returns
- none
Definition at line 100 of file i2c.c.
void I2C_WriteByteRegister |
( |
unsigned char |
reg, |
|
|
unsigned char |
data |
|
) |
| |
Writes a byte value to a register address.
- Parameters
-
reg | Address of sensor register. |
data | Data byte to be written on register. |
- Returns
- none
Definition at line 66 of file i2c.c.
void I2C_WriteWordRegister |
( |
unsigned char |
reg, |
|
|
unsigned char * |
data |
|
) |
| |
Writes a word value (16 bit) to a register address.
- Parameters
-
reg | Address of sensor register. |
data | Data word to be written on word size register. |
- Returns
- none
Definition at line 82 of file i2c.c.