File indexing completed on 2025-05-11 08:23:42
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 #ifndef LIBBSP_ARM_XILINX_ZYNQ_CADENCE_I2C_REGS_H
0029 #define LIBBSP_ARM_XILINX_ZYNQ_CADENCE_I2C_REGS_H
0030
0031 #include <bsp/utility.h>
0032
0033 typedef struct {
0034 uint32_t control;
0035 #define CADENCE_I2C_CONTROL_DIV_A(val) BSP_FLD32(val, 14, 15)
0036 #define CADENCE_I2C_CONTROL_DIV_A_GET(reg) BSP_FLD32GET(reg, 14, 15)
0037 #define CADENCE_I2C_CONTROL_DIV_A_SET(reg, val) BSP_FLD32SET(reg, val, 14, 15)
0038 #define CADENCE_I2C_CONTROL_DIV_B(val) BSP_FLD32(val, 8, 13)
0039 #define CADENCE_I2C_CONTROL_DIV_B_GET(reg) BSP_FLD32GET(reg, 8, 13)
0040 #define CADENCE_I2C_CONTROL_DIV_B_SET(reg, val) BSP_FLD32SET(reg, val, 8, 13)
0041 #define CADENCE_I2C_CONTROL_CLR_FIFO BSP_BIT32(6)
0042 #define CADENCE_I2C_CONTROL_SLVMON BSP_BIT32(5)
0043 #define CADENCE_I2C_CONTROL_HOLD BSP_BIT32(4)
0044 #define CADENCE_I2C_CONTROL_ACKEN BSP_BIT32(3)
0045 #define CADENCE_I2C_CONTROL_NEA BSP_BIT32(2)
0046 #define CADENCE_I2C_CONTROL_MS BSP_BIT32(1)
0047 #define CADENCE_I2C_CONTROL_RW BSP_BIT32(0)
0048 uint32_t status;
0049 #define CADENCE_I2C_STATUS_BA BSP_BIT32(8)
0050 #define CADENCE_I2C_STATUS_RXOVF BSP_BIT32(7)
0051 #define CADENCE_I2C_STATUS_TXDV BSP_BIT32(6)
0052 #define CADENCE_I2C_STATUS_RXDV BSP_BIT32(5)
0053 #define CADENCE_I2C_STATUS_RXRW BSP_BIT32(3)
0054 uint32_t address;
0055 #define CADENCE_I2C_ADDRESS(val) BSP_FLD32(val, 0, 9)
0056 #define CADENCE_I2C_ADDRESS_GET(reg) BSP_FLD32GET(reg, 0, 9)
0057 #define CADENCE_I2C_ADDRESS_SET(reg, val) BSP_FLD32SET(reg, val, 0, 9)
0058 uint32_t data;
0059 uint32_t irqstatus;
0060 #define CADENCE_I2C_IXR_ARB_LOST BSP_BIT32(9)
0061 #define CADENCE_I2C_IXR_RX_UNF BSP_BIT32(7)
0062 #define CADENCE_I2C_IXR_TX_OVR BSP_BIT32(6)
0063 #define CADENCE_I2C_IXR_RX_OVR BSP_BIT32(5)
0064 #define CADENCE_I2C_IXR_SLV_RDY BSP_BIT32(4)
0065 #define CADENCE_I2C_IXR_TO BSP_BIT32(3)
0066 #define CADENCE_I2C_IXR_NACK BSP_BIT32(2)
0067 #define CADENCE_I2C_IXR_DATA BSP_BIT32(1)
0068 #define CADENCE_I2C_IXR_COMP BSP_BIT32(0)
0069 uint32_t transfer_size;
0070 #define CADENCE_I2C_TRANSFER_SIZE(val) BSP_FLD32(val, 0, 7)
0071 #define CADENCE_I2C_TRANSFER_SIZE_GET(reg) BSP_FLD32GET(reg, 0, 7)
0072 #define CADENCE_I2C_TRANSFER_SIZE_SET(reg, val) BSP_FLD32SET(reg, val, 0, 7)
0073 uint32_t slave_mon_pause;
0074 #define CADENCE_I2C_SLAVE_MON_PAUSE(val) BSP_FLD32(val, 0, 3)
0075 #define CADENCE_I2C_SLAVE_MON_PAUSE_GET(reg) BSP_FLD32GET(reg, 0, 3)
0076 #define CADENCE_I2C_SLAVE_MON_PAUSE_SET(reg, val) BSP_FLD32SET(reg, val, 0, 3)
0077 uint32_t timeout;
0078 #define CADENCE_I2C_TIMEOUT(val) BSP_FLD32(val, 0, 7)
0079 #define CADENCE_I2C_TIMEOUT_GET(reg) BSP_FLD32GET(reg, 0, 7)
0080 #define CADENCE_I2C_TIMEOUT_SET(reg, val) BSP_FLD32SET(reg, val, 0, 7)
0081 uint32_t irqmask;
0082 uint32_t irqenable;
0083 uint32_t irqdisable;
0084 } cadence_i2c;
0085
0086 #endif