Figure 6.13-14 Master Receiver Mode Control Flow - Nuvoton ISD94124BYI Technical Reference Manual

Isd arm cortex-m4f soc
Table of Contents

Advertisement

MR
STATUS=0x08
S
(STA,STO,SI,AA)=(1,0,1,x)
Master to Slave
Slave to Master
Arbitration Lost
Master Receiver
MR

Figure 6.13-14 Master Receiver Mode Control Flow

Sample code for Figure 6.13-14, master mode receiver:
/* ------ in main routine ------ */
...
/* I2C interface initialization */
...
s_I2C0HandlerFn = (I2C_FUNC)I2C_MasterTx;
I2C_SET_CONTROL_REG(I2C0, I2C_STA);
/* Wait I2C Tx Finish */
while (g_u8EndFlag == 0);
g_u8EndFlag = 0;
s_I2C0HandlerFn = (I2C_FUNC)I2C_MasterRx;
g_u8DataLen = 0;
Sep 9, 2019
ISD94100 Series Technical Reference Manual
STATUS=0x40
I2C_DAT
ACK
(SLA+R)
I2C_DAT=SLA+R
(STA,STO,SI,AA)=(0,0,1,x)
STATUS=0x48
NAK
(Arbitration Lost)
STATUS=0x38
I2C_DAT
ACK/
(SLA+R)
NAK
I2C_DAT=SLA+R
(STA,STO,SI,AA)=(0,0,1,X)
(Arbitration Lost) ACK
STATUS= 0x68, 0x78, 0xB0
I2C_DAT
ACK
(SLA+R)
I2C_DAT=SLA+R
(STA,STO,SI,AA)=(0,0,1,1)
To corresponding states in
slave mode
Page 629 of 928
STATUS=0x50
I2C_DAT
ACK
(Data)
(STA,STO,SI,AA)=(0,0,1,1)
(Arbitration Lost) ACK
STATUS=0x38
I2C_DAT
ACK
(Data)
(STA,STO,SI,AA)=(0,0,1,0)
STATUS=0x58
I2C_DAT
NAK
(Data)
(STA,STO,SI,AA)=(0,0,1,0)
STATUS=0x08
P
S
(STA,STO,SI,AA)=(1,1,1,x)
STATUS=0xF8
P
(STA,STO,SI,AA)=(0,1,1,x)
STATUS=0x10
Sr
(STA,STO,SI,AA)=(1,0,1,x)
2
I
C bus will be release;
Not addressed SLV mode will be enterd
Enter not addressed SLV
...
mode
(STA,STO,SI,AA)=(0,0,1,X)
A START will be transmitted
when the bus becomes free
Send a START when bus becomes
...
free
(STA,STO,SI,AA)=(1,0,1,X)
/* Setup I2C ISR callback function: master write */
/* As an I2C master, generates START condition */
/* I2C function to read data from slave: master read */
MT
MR
Rev1.09

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents