Raspberry Pi GPIO Library
0.3
Library allowing for control of the Raspberry Pi's GPIO pins.
src
inc
i2c.h
Go to the documentation of this file.
1
28
#ifndef _I2C_H_
29
#define _I2C_H_
30
31
#include "
rpiGpio.h
"
32
#include <stdarg.h>
33
#include <stdlib.h>
34
#include <string.h>
35
#include <fcntl.h>
36
#include <sys/mman.h>
37
#include <unistd.h>
38
#include <errno.h>
39
#include <stdio.h>
40
#include <time.h>
41
43
#define I2C_MAP_SIZE BSC_DEL_OFFSET
44
46
#define I2C_DEFAULT_FREQ_HZ 100000
47
49
#define NSEC_IN_SEC 1000000000
50
52
#define CLOCKS_PER_BYTE 9
53
55
#define I2C_C *(gI2cMap + BSC_C_OFFSET / sizeof(uint32_t))
56
57
#define I2C_DIV *(gI2cMap + BSC_DIV_OFFSET / sizeof(uint32_t))
58
59
#define I2C_A *(gI2cMap + BSC_A_OFFSET / sizeof(uint32_t))
60
61
#define I2C_DLEN *(gI2cMap + BSC_DLEN_OFFSET / sizeof(uint32_t))
62
63
#define I2C_S *(gI2cMap + BSC_S_OFFSET / sizeof(uint32_t))
64
65
#define I2C_FIFO *(gI2cMap + BSC_FIFO_OFFSET / sizeof(uint32_t))
66
67
68
#endif
/*_I2C_H_*/
69
rpiGpio.h
The main header file of the GPIO library.
Generated on Tue May 8 2018 22:22:28 for Raspberry Pi GPIO Library by
1.8.13