1 /**************************************************************************//**
2 *
3 * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved.
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 *
7 * Change Logs:
8 * Date            Author       Notes
9 * 2020-11-11      Wayne        First version
10 *
11 ******************************************************************************/
12 
13 #ifndef __DRV_I2C_H__
14 #define __DRV_I2C_H__
15 
16 #define NU_I2C_MASTER_STATUS_START                   0x08UL
17 #define NU_I2C_MASTER_STATUS_REPEAT_START            0x10UL
18 #define NU_I2C_MASTER_STATUS_TRANSMIT_ADDRESS_ACK    0x18UL
19 #define NU_I2C_MASTER_STATUS_TRANSMIT_ADDRESS_NACK   0x20UL
20 #define NU_I2C_MASTER_STATUS_TRANSMIT_DATA_ACK       0x28UL
21 #define NU_I2C_MASTER_STATUS_TRANSMIT_DATA_NACK      0x30UL
22 #define NU_I2C_MASTER_STATUS_ARBITRATION_LOST        0x38UL
23 #define NU_I2C_MASTER_STATUS_RECEIVE_ADDRESS_ACK     0x40UL
24 #define NU_I2C_MASTER_STATUS_RECEIVE_ADDRESS_NACK    0x48UL
25 #define NU_I2C_MASTER_STATUS_RECEIVE_DATA_ACK        0x50UL
26 #define NU_I2C_MASTER_STATUS_RECEIVE_DATA_NACK       0x58UL
27 #define NU_I2C_MASTER_STATUS_BUS_ERROR               0x00UL
28 #define NU_I2C_MASTER_STATUS_BUS_RELEASED            0xF8UL
29 
30 #define NU_I2C_SLAVE_STATUS_TRANSMIT_REPEAT_START_OR_STOP 0xA0UL
31 #define NU_I2C_SLAVE_STATUS_TRANSMIT_ADDRESS_ACK          0xA8UL
32 #define NU_I2C_SLAVE_STATUS_TRANSMIT_DATA_NACK            0xC0UL
33 #define NU_I2C_SLAVE_STATUS_RECEIVE_ADDRESS_ACK           0x60UL
34 #define NU_I2C_SLAVE_STATUS_RECEIVE_DATA_ACK              0x80UL
35 
36 #endif /* __DRV_I2C_H__ */
37