Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 216559

Forum Post: RE: I2C question of lm4f120 launchpad

$
0
0

  I2CMasterSlaveAddrSet(I2C0_MASTER_BASE,SlaveAddress,false);
  I2CMasterDataPut(I2C0_MASTER_BASE,0x32);
  I2CMasterControl(I2C0_MASTER_BASE,I2C_MASTER_CMD_BURST_SEND_START);
  while(I2CMasterBusy(I2C0_MASTER_BASE));
  I2CMasterSlaveAddrSet(I2C0_MASTER_BASE,SlaveAddress,true);
  I2CMasterControl(I2C0_MASTER_BASE,I2C_MASTER_CMD_BURST_RECEIVE_START);
  while(I2CMasterBusy(I2C0_MASTER_BASE));
  back1=I2CMasterDataGet(I2C0_MASTER_BASE);
  I2CMasterControl(I2C0_MASTER_BASE,I2C_MASTER_CMD_BURST_RECEIVE_FINISH);
  while(I2CMasterBusy(I2C0_MASTER_BASE));
  back2=I2CMasterDataGet(I2C0_MASTER_BASE);
  m=(back2<<8)|back1;
  return(m);

This won't work too,,this time,back2 is unavailable....


Viewing all articles
Browse latest Browse all 216559

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>