This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F280037: I2C轮询读写

Part Number: TMS320F280037
Other Parts Discussed in Thread: C2000WARE

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//#############################################################################
//
// FILE: i2c_ex1_loopback.c
//
// TITLE: I2C Digital Loopback with FIFO Interrupts
//
//! \addtogroup driver_example_list
//! <h1>I2C Digital Loopback with FIFO Interrupts</h1>
//!
//! This program uses the internal loopback test mode of the I2C module. Both
//! the TX and RX I2C FIFOs and their interrupts are used. The pinmux and I2C
//! initialization is done through the sysconfig file.
//!
//! A stream of data is sent and then compared to the received stream.
//! The sent data looks like this: \n
//! 0000 0001 \n
//! 0001 0002 \n
//! 0002 0003 \n
//! .... \n
//! 00FE 00FF \n
//! 00FF 0000 \n
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

在I2C_ex2_eeprom.c历程的基础上更改上述程序,写时会卡在

while(I2C_isBusBusy(I2CA_BASE)); 一直在busy,写时那里程序写的不对?还有读取一直没读取成功。

实际应用的程序由于逻辑关系不能用例如历程中的中断,只想轮询写。