5.1.
Configure the address match configuration by writing the Address Mode value in the
CTRLB register (CTRLB.AMODE).
5.2.
Set the Address and Address Mask value in the Address register (ADDR.ADDR and
ADDR.ADDRMASK) according to the address configuration.
34.6.2.2. Enabling, Disabling, and Resetting
This peripheral is enabled by writing '1' to the Enable bit in the Control A register (CTRLA.ENABLE), and
disabled by writing '0' to it.
for details.
34.6.2.3. I
2
C Bus State Logic
The bus state logic includes several logic blocks that continuously monitor the activity on the I
2
C bus lines
in all sleep modes. The start and stop detectors and the bit counter are all essential in the process of
determining the current bus state. The bus state is determined according to
. Software
can get the current bus state by reading the Master Bus State bits in the Status register
(STATUS.BUSSTATE). The value of STATUS.BUSSTATE in the figure is shown in binary.
Figure 34-3. Bus State Diagram
RESET
Write ADDR to g
enerate
Start Condition
IDLE
(0b01)
Start Condition
BUSY
(0b11)
Timeout or Stop Condition
UNKNOWN
(0b00)
OWNER
(0b10)
Lost A
rbitration
Repeated
Start Condition
Write ADDR to g
enerate
Repeated Start Condition
Stop Condition
Timeout or Stop Condition
The bus state machine is active when the I
2
C master is enabled.
After the I
2
C master has been enabled, the bus state is UNKNOWN (0b00). From the UNKNOWN state,
the bus will transition to IDLE (0b01) by either:
•
Forcing by by writing 0b01 to STATUS.BUSSTATE
•
A stop condition is detected on the bus
•
If the inactive bus time-out is configured for SMBus compatibility (CTRLA.INACTOUT) and a time-
out occurs.
Note:
Once a known bus state is established, the bus state logic will not re-enter the UNKNOWN state.
When the bus is IDLE it is ready for a new transaction. If a start condition is issued on the bus by another
I
2
C master in a multi-master setup, the bus becomes BUSY (0b11). The bus will re-enter IDLE either
Atmel SAM L22G / L22J / L22N [DATASHEET]
Atmel-42402E-SAM L22G / L22J / L22N_Datasheet_Complete-07/2016
683