| поискавой системы для электроныых деталей |
|
AN1045 датащи(PDF) 14 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN1045 датащи(HTML) 14 Page - STMicroelectronics |
|
14 / 16 page ![]() 14/16 ST7 S/W IMPLEMENTATION OF I2C BUS MASTER SetBit(PADDR,SDA); delay(10); ClrBit(PADDR,SCL); /* Waits the master takes the control of SDA */ delay(10); SetBit(PADDR,SCL); delay(5); ClrBit(PADDR,SDA); /* The master releases the SDA line */ SetBit(I2C_SR1,ACK); /* ACK=1: Acknowledge sent by the master */ } /*-------------------------------------------------------------------------- ROUTINE NAME : I2Cm_Tx INPUT/OUTPUT : send_tab and n, the number of data to transmit (with 2 addresses) / None. DESCRIPTION : Transmit data buffer. COMMENTS : Most significant bytes first. --------------------------------------------------------------------------*/ void I2Cm_Tx (char * buffout,char nb) { SetBit(PADDR,SDA); /* Configure SDA as an output to send data */ for (j=nb;j!=0xFF;j--) { /* 2 addresses and 3 data to send: from X=n downto X=0 */ flag=0; if ((j==(nb-2))&&(ValBit(I2C_SR1,RCPT))) { I2Cm_Start(); /* Start condition */ j=nb; /* EEPROM @ with the LSB at 1 to send */ flag=1; } count=1; I2C_DR=buffout[j]; if (flag==1) I2C_DR=I2C_DR|1; /* If master receiver, the address to send is A1 */ do { I2Cm_TxData(); /* Sending of data bit per bit, MSB first */ count*=2; }while(count!=0); wait_Ack(); /* Wait ACK from the slave */ if(!ValBit(I2C_SR1,ACK)) SetBit(I2C_SR2,AF); |
|
|
ссылки URL |
| Вашему бизинису помогли Аллдатащит? [ DONATE ] |
Что такое Аллдатащит | реклама | контакт | Конфиденциальность | Ссылка на техническое описание | обмен ссыками | поиск по производителю All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |