lm3s9b92中,examples里为何没有IIC!!

2019-03-24 16:10发布

    在TI官网下载的不管是ccs还是G++还是keil,通过安装StellarisWare Package,安装目录C:StellarisWareoardsek-lm3s9b92为何就没有iic例程呢!!!里面提供了好多模块的例程,唯独没有iic的!    哪位高人可以指条明路,下一步在下是该自己编iic程序还是放弃这块板子!!万分感谢~~       此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
19条回答
Main函数
2019-03-25 01:22
事实上,在C:StellarisWare_LatestdocsSW-DRL-UG-xxxx.pdf中每个模块后面,都有一段简单的代码示例可以参考。如I2C的部分,如下:

The following example shows how to use the I2C API to send data as a master.
//
// Initialize Master and Slave
//
I2CMasterInitExpClk(I2C_MASTER_BASE, SysCtlClockGet(), true);
//
// Specify slave address
//
I2CMasterSlaveAddrSet(I2C_MASTER_BASE, 0x3B, false);
//
// Place the character to be sent in the data register
//
I2CMasterDataPut(I2C_MASTER_BASE, ’Q’);
//
// Initiate send of character from Master to Slave
//
I2CMasterControl(I2C_MASTER_BASE, I2C_MASTER_CMD_SINGLE_SEND);
//
// Delay until transmission completes
//
while(I2CMasterBusBusy(I2C_MASTER_BASE))
{
}

一周热门 更多>

相关问题

    相关文章