Hardware
{ return 1; }
}
// Wait for transfer to end
while ((I2C->I2SR & 0x0080) == 0)
{
if (I2C->I2SR & 0x0050)
{ return 1; }
}
// Check for Ack
if (I2C->I2SR & 0x0001)
{ return 1; }
return 0;
}
/******************************************************************************
I2C_WR()
Write a byte to an I2C EEPROM Device. This performs one byte write at a
time to avoid page burst boundary requirements.
ARGS:
t_addr : LSB 3-bit address of target device from base address 0xA0.
b_addr : Byte address in device
*data : Data to write
RTNS:
0 = Success
1 = Failure
******************************************************************************/
int I2C_WR(unsigned char t_addr, unsigned short b_addr, unsigned char *data)
{
i2c_map_t* I2C = (i2c_map_t*) I2C_BASE;
// Arbitrate for Bus
while (I2C->I2SR & 0x0020);
I2C->I2CR |= 0x0020;
// Bus Busy
// Master
// Send device address
if (I2C_TX(0xA0 | ((t_addr & 7) << 1)))
{ I2C->I2CR &= ~0x0030; return 1; }
// Send byte address (MSB first)
if (I2C_TX((unsigned char) (b_addr >> 8)))
{ I2C->I2CR &= ~0x0030; return 1; }
if (I2C_TX((unsigned char) (b_addr & 0x00ff)))
{ I2C->I2CR &= ~0x0030; return 1; }
// Send byte data
if (I2C_TX(*data))
{ I2C->I2CR &= ~0x0030; return 1; }
// Release Bus
I2C->I2CR &= ~0x0030;
// Slave Rx
return 0;
}
/******************************************************************************
I2C_RD()
MSC711x Packet Telephony Farm Card (SPT711xPFCE), Rev. 1
18
Freescale Semiconductor
相关PDF资料
SPUSB1AJT SURGE SUPPRESOR USB 12OHM SC70-6
SR-5H-6.3A-BK FUSE 6.3A 250VAC RADIAL SLOW
SR1K20M155X VARISTOR 20VRMS W/RFI SUPP RAD
SRP120LF POLYSWITCH PTC RESET 1.2A STRAP
SRP120SF POLYSWITCH PTC RESET 1.2A STRAP
SRP175F POLYSWITCH STRAP 1.75A HOLD
SRP200F POLYSWITCH STRAP 2.00A HOLD
SRP350F POLYSWITCH STRAP 3.50A HOLD
相关代理商/技术参数
SPT-750 功能描述:烙铁 CONTROL BOX ASSEM SP-750T RoHS:否 制造商:Weller 产品:Soldering Stations 类型:Digital, Iron, Stand, Cleaner 瓦特:50 W 最大温度:+ 850 F 电缆类型:US Cord Included
SPT-751 功能描述:烙铁 COVER ASSEMBLY SP-750T RoHS:否 制造商:Weller 产品:Soldering Stations 类型:Digital, Iron, Stand, Cleaner 瓦特:50 W 最大温度:+ 850 F 电缆类型:US Cord Included
SPT7560 制造商:Cooper Wiring Devices 功能描述:
SPT7572 制造商:Cooper Wiring Devices 功能描述:
SPT7610 制造商:CADEKA 制造商全称:CADEKA 功能描述:6-BIT, 1 GSPS FLASH A/D CONVERTER
SPT7610SIQ 制造商:FAIRCHILD 制造商全称:Fairchild Semiconductor 功能描述:6-BIT, 1 GSPS FLASH A/D CONVERTER
SPT7710 制造商:FAIRCHILD 制造商全称:Fairchild Semiconductor 功能描述:8-BIT, 150 MSPS, FLASH A/D CONVERTER
SPT7710AIG 制造商:CADEKA 制造商全称:CADEKA 功能描述:8-BIT, 150 MSPS, FLASH A/D CONVERTER