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

Description

Name: I2C Slave Address Register

Size: 10 bits

Address Offset: 0x08

Read/Write Access: Read/Write

Register Layout

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

Field : ic_sar

The IC_SAR holds the slave address when the I2C is operating as a slave. For 7-bit

addressing, only IC_SAR[6:0] is used.

This register can be written only when the I2C interface is disabled, which

corresponds to the IC_ENABLE[0] 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 IC_SAR or IC_TAR to

a reserved value.

Reset value: IC_DEFAULT_SLAVE_ADDR configuration parameter

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_RESET   0x00000055
 
#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 ALT_I2C_SAR_IC_SAR
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_RESET   0x00000055

The reset value of the ALT_I2C_SAR 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.