RT-USB-THP  0
USB出力温湿気圧センサモジュールのサンプルプログラムに関する説明
i2c.h
[詳解]
1 /*****************************************************************************
2  * i2c.h: Header file for NXP LPC13xx Family Microprocessors
3  *
4  * Copyright(C) 2006, NXP Semiconductor
5  * All rights reserved.
6  *
7  * History
8  * 2006.07.19 ver 1.00 Preliminary version, first Release
9  *
10 ******************************************************************************/
11 #ifndef __I2C_H
12 #define __I2C_H
13 
14 #include "type.h"
15 
16 #define FAST_MODE_PLUS 0
17 
18 #define BUFSIZE 0x80
19 #define MAX_TIMEOUT 0x00FFFFFF
20 
21 #define I2CMASTER 0x01
22 #define I2CSLAVE 0x02
23 
24 #define MPU6050_W 0xd0
25 #define MPU6050_R 0xd1
26 #define AK8975_W 0x18
27 #define AK8975_R 0x19
28 #define PCF8594_ADDR 0xA0
29 
30 #define READ_WRITE 0x01
31 
32 #define RD_BIT 0x01
33 
34 #define I2C_IDLE 0
35 #define I2C_STARTED 1
36 #define I2C_RESTARTED 2
37 #define I2C_REPEATED_START 3
38 #define DATA_ACK 4
39 #define DATA_NACK 5
40 
41 #define I2CONSET_I2EN 0x00000040 /* I2C Control Set Register */
42 #define I2CONSET_AA 0x00000004
43 #define I2CONSET_SI 0x00000008
44 #define I2CONSET_STO 0x00000010
45 #define I2CONSET_STA 0x00000020
46 
47 #define I2CONCLR_AAC 0x00000004 /* I2C Control clear Register */
48 #define I2CONCLR_SIC 0x00000008
49 #define I2CONCLR_STAC 0x00000020
50 #define I2CONCLR_I2ENC 0x00000040
51 
52 #define I2DAT_I2C 0x00000000 /* I2C Data Reg */
53 #define I2ADR_I2C 0x00000000 /* I2C Slave Address Reg */
54 #define I2SCLH_SCLH 0x00000180 /* I2C SCL Duty Cycle High Reg */
55 #define I2SCLL_SCLL 0x00000180 /* I2C SCL Duty Cycle Low Reg */
56 #define I2SCLH_HS_SCLH 0x00000020 /* Fast Plus I2C SCL Duty Cycle High Reg */
57 #define I2SCLL_HS_SCLL 0x00000020 /* Fast Plus I2C SCL Duty Cycle Low Reg */
58 
59 
60 extern void I2C_IRQHandler( void );
61 extern uint32_t I2CInit( uint32_t I2cMode );
62 extern uint32_t I2CStart( void );
63 extern uint32_t I2CStop( void );
64 extern uint32_t I2CEngine( void );
65 
66 #endif /* end __I2C_H */
67 /****************************************************************************
68 ** End Of File
69 *****************************************************************************/
uint32_t I2CEngine(void)
Definition: i2c.c:282
void I2C_IRQHandler(void)
Definition: i2c.c:48
uint32_t I2CStart(void)
Definition: i2c.c:165
uint32_t I2CInit(uint32_t I2cMode)
Definition: i2c.c:221
uint32_t I2CStop(void)
Definition: i2c.c:201
unsigned int uint32_t
Definition: type.h:29