-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathi2c_a7.h
59 lines (51 loc) · 2.09 KB
/
i2c_a7.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**
* @file i2c_a7.h
* @author NXP Semiconductors
* @version 1.0
* @par License
* Copyright 2017 NXP
*
* This software is owned or controlled by NXP and may only be used
* strictly in accordance with the applicable license terms. By expressly
* accepting such terms or by downloading, installing, activating and/or
* otherwise using the software, you are agreeing that you have read, and
* that you agree to comply with and are bound by, such license terms. If
* you do not agree to be bound by the applicable license terms, then you
* may not retain, install, activate or otherwise use the software.
*
* @par Description
* I2C API used by SCI2C library.
* To be implemented when porting library to a new host platform.
* @par History
*
**/
#ifndef _I2C_A7_H
#define _I2C_A7_H
#include "sm_types.h"
#define SCI2C_T_CMDG 180 //!< Minimum delay between stop of Wakeup command and start of subsequent command (Value in micro seconds)
#define I2C_IDLE 0
#define I2C_STARTED 1
#define I2C_RESTARTED 2
#define I2C_REPEATED_START 3
#define DATA_ACK 4
#define DATA_NACK 5
#define I2C_BUSY 6
#define I2C_NO_DATA 7
#define I2C_NACK_ON_ADDRESS 8
#define I2C_NACK_ON_DATA 9
#define I2C_ARBITRATION_LOST 10
#define I2C_TIME_OUT 11
#define I2C_OK 12
#define I2C_FAILED 13
typedef unsigned int i2c_error_t;
#define I2C_BUS_0 (0)
i2c_error_t axI2CInit( void );
void axI2CTerm(int mode);
#if AX_EMBEDDED
void axI2CResetBackoffDelay( void );
#endif /* FREEDOM */
i2c_error_t axI2CWriteByte(unsigned char bus, unsigned char addr, unsigned char * pTx);
i2c_error_t axI2CWrite(unsigned char bus, unsigned char addr, unsigned char * pTx, unsigned short txLen);
i2c_error_t axI2CRead(unsigned char bus, unsigned char addr, unsigned char * pRx, unsigned short rxLen);
i2c_error_t axI2CWriteRead(unsigned char bus, unsigned char addr, unsigned char * pTx, unsigned short txLen, unsigned char * pRx, unsigned short * pRxLen);
#endif // _I2C_A7_H