| поискавой системы для электроныых деталей |
|
AN2399 датащи(PDF) 20 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2399 датащи(HTML) 20 Page - STMicroelectronics |
|
20 / 22 page ![]() RFID library AN2399 20/22 Here are the functions used for I/O Frame register access: int Write_CRX14_IOFR(UCHAR *DATA) int Read_CRX14_IOFR(UCHAR *DATA) 8.4 I2C commands layer The I2C layer provides all the functionalities to access and manage the I2C peripheral on STR710. It is a part of the STR710 library. Some functionality was added in order to receive a status when data is sent or received on the I2C bus; two programmable timeouts (I2C_TIMEOUT_SEND and I2C_TIMEOUT_RECEIVE) inform the application layer about any send/receive failure on I2C bus. Below the code added for I2C_ByteSend and I2C_ByteReceive functions. 8.4.1 I2C_ByteSend_with_status function /*************************************************************** * Function Name : I2C_ByteSend * Description : Send a single byte of data. * Input : I2Cx ( I2C0 or I2C1 ) * Data : the byte to be sent to the slave * Return : status: 0-byte sent, 1-transmission error. ***************************************************************/ u8 I2C_ByteSend_with_status (I2C_TypeDef *I2Cx, u8 Data) { u8 status=0; u32 timeout=I2C_TIMEOUT_SEND; //Wait until the I2C_BTF bit is set while (((I2Cx->SR1 & 0x08)==0)&&timeout--); if(!timeout) status=1; //Write in the DR register the byte to be sent I2Cx->DR = Data; return status; } 8.4.2 I2C_ByteReceive_with_status function /********************************************************************** * Function Name : I2C_ByteReceive * Description : Returns the received byte. * Input : I2Cx ( I2C0 or I2C1 ) * Output : Data ( variable where store read data ) * Return : status: 0-byte sent, 1-transmission error. ***********************************************************************/ u8 I2C_ByteReceive_with_status (I2C_TypeDef *I2Cx, u8 *Data) { u8 status=0; u32 timeout=I2C_TIMEOUT_RECEIVE; //Wait till I2C_BTF bit is set while (((I2Cx->SR1 & 0x08)==0)&&timeout--); if(!timeout) status=1; (*Data)=I2Cx->DR; return status; } |
|
|
ссылки 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 |