User manual

...the world's most energy friendly microcontrollers
2012-04-24 - Giant Gecko Family - d0053_Rev0.96 436
www.energymicro.com
Bit Name Reset Access Description
Value Description
0 Software must give one ACK command for each ACK transmitted on the I
2
C bus.
1 Addresses that are not automatically NACK'ed, and all data is automatically acknowledged.
1 SLAVE 0 RW Addressable as Slave
Set this bit to allow the device to be selected as an I
2
C slave.
Value Description
0 All addresses will be responded to with a NACK
1 Addresses matching the programmed slave address or the general call address (if enabled) require a response from
software. Other addresses are automatically responded to with a NACK.
0 EN 0 RW I
2
C Enable
Use this bit to enable or disable the I
2
C module.
Value Description
0 The I
2
C module is disabled. And its internal state is cleared
1 The I
2
C module is enabled.
16.5.2 I2Cn_CMD - Command Register
Offset Bit Position
0x004
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Reset
0
0
0
0
0
0
0
0
Access
W1
W1
W1
W1
W1
W1
W1
W1
Name
CLEARPC
CLEARTX
ABORT
CONT
NACK
ACK
STOP
START
Bit Name Reset Access Description
31:8 Reserved
To ensure compatibility with future devices, always write bits to 0. More information in Section 2.1 (p. 3)
7 CLEARPC 0 W1 Clear Pending Commands
Set to clear pending commands.
6 CLEARTX 0 W1 Clear TX
Set to clear transmit buffer and shift register. Will not abort ongoing transfer.
5 ABORT 0 W1 Abort transmission
Abort the current transmission making the bus go idle. When used in combination with STOP, a STOP condition is sent as soon as
possible before aborting the transmission. The stop condition is subject to clock synchronization.
4 CONT 0 W1 Continue transmission
Set to continue transmission after a NACK has been received.
3 NACK 0 W1 Send NACK
Set to transmit a NACK the next time an acknowledge is required.
2 ACK 0 W1 Send ACK
Set to transmit an ACK the next time an acknowledge is required.
1 STOP 0 W1 Send stop condition
Set to send stop condition as soon as possible.
0 START 0 W1 Send start condition
Set to send start condition as soon as possible. If a transmission is ongoing and not owned, the start condition will be sent as soon
as the bus is idle. If the current transmission is owned by this module, a repeated start condition will be sent. Use in combination with
a STOP command to automatically send a STOP, then a START when the bus becomes idle.