Altera SoCAL  16.0
The Altera SoC Abstraction Layer (SoCAL) API Reference Manual
 All Data Structures Variables Typedefs Groups
Register : Slave Address Register - ic_sar

Description

Holds Address of Slave

Register Layout

Bits Access Reset Description
[9:0] RW 0x55 Slave Address
[31:10] ??? 0x0 UNDEFINED

Field : Slave Address - ic_sar

The Slave Address register holds the slave address when the I2C is operating as a slave. For 7-bit addressing, only Field Bits [6:0] of the Slave Address Register are used. This register can be written only when the I2C interface is disabled, which corresponds to field bit 0 of the Enable Register being set to 0. Writes at other times have no effect.

Note, the default values cannot be any of the reserved address locations: that is,

0x00 to 0x07, or 0x78 to 0x7f. The correct operation of the device is not guaranteed if you program the Slave Address Register or Target Address Register to a reserved value.

Field Access Macros:

#define ALT_I2C_SAR_IC_SAR_LSB   0
 
#define ALT_I2C_SAR_IC_SAR_MSB   9
 
#define ALT_I2C_SAR_IC_SAR_WIDTH   10
 
#define ALT_I2C_SAR_IC_SAR_SET_MSK   0x000003ff
 
#define ALT_I2C_SAR_IC_SAR_CLR_MSK   0xfffffc00
 
#define ALT_I2C_SAR_IC_SAR_RESET   0x55
 
#define ALT_I2C_SAR_IC_SAR_GET(value)   (((value) & 0x000003ff) >> 0)
 
#define ALT_I2C_SAR_IC_SAR_SET(value)   (((value) << 0) & 0x000003ff)
 

Data Structures

struct  ALT_I2C_SAR_s
 

Macros

#define ALT_I2C_SAR_OFST   0x8
 
#define ALT_I2C_SAR_ADDR(base)   ALT_CAST(void *, (ALT_CAST(char *, (base)) + ALT_I2C_SAR_OFST))
 

Typedefs

typedef struct ALT_I2C_SAR_s ALT_I2C_SAR_t
 

Data Structure Documentation

struct ALT_I2C_SAR_s

WARNING: The C register and register group struct declarations are provided for convenience and illustrative purposes. They should, however, be used with caution as the C language standard provides no guarantees about the alignment or atomicity of device memory accesses. The recommended practice for writing hardware drivers is to use the SoCAL access macros and alt_read_word() and alt_write_word() functions.

The struct declaration for register ALT_I2C_SAR.

Data Fields
uint32_t ic_sar: 10 Slave Address
uint32_t __pad0__: 22 UNDEFINED

Macro Definitions

#define ALT_I2C_SAR_IC_SAR_LSB   0

The Least Significant Bit (LSB) position of the ALT_I2C_SAR_IC_SAR register field.

#define ALT_I2C_SAR_IC_SAR_MSB   9

The Most Significant Bit (MSB) position of the ALT_I2C_SAR_IC_SAR register field.

#define ALT_I2C_SAR_IC_SAR_WIDTH   10

The width in bits of the ALT_I2C_SAR_IC_SAR register field.

#define ALT_I2C_SAR_IC_SAR_SET_MSK   0x000003ff

The mask used to set the ALT_I2C_SAR_IC_SAR register field value.

#define ALT_I2C_SAR_IC_SAR_CLR_MSK   0xfffffc00

The mask used to clear the ALT_I2C_SAR_IC_SAR register field value.

#define ALT_I2C_SAR_IC_SAR_RESET   0x55

The reset value of the ALT_I2C_SAR_IC_SAR register field.

#define ALT_I2C_SAR_IC_SAR_GET (   value)    (((value) & 0x000003ff) >> 0)

Extracts the ALT_I2C_SAR_IC_SAR field value from a register.

#define ALT_I2C_SAR_IC_SAR_SET (   value)    (((value) << 0) & 0x000003ff)

Produces a ALT_I2C_SAR_IC_SAR register field value suitable for setting the register.

#define ALT_I2C_SAR_OFST   0x8

The byte offset of the ALT_I2C_SAR register from the beginning of the component.

#define ALT_I2C_SAR_ADDR (   base)    ALT_CAST(void *, (ALT_CAST(char *, (base)) + ALT_I2C_SAR_OFST))

The address of the ALT_I2C_SAR register.

Typedef Documentation

typedef struct ALT_I2C_SAR_s ALT_I2C_SAR_t

The typedef declaration for register ALT_I2C_SAR.