| поискавой системы для электроныых деталей |
|
MPL3115A2 датащи(PDF) 10 Page - Freescale Semiconductor, Inc |
|
|
|||||||||||||||||||||||||||||
MPL3115A2 датащи(HTML) 10 Page - Freescale Semiconductor, Inc |
|
10 / 44 page ![]() MPL3115A2 Sensors 10 Freescale Semiconductor, Inc. 4 Quick Start Quick Setup Guide The quick setup guide shows how to put the part in Altimeter mode with an OSR of 128. You may then select your data retrieval method between polling, interrupt or FIFO. The following routines are used: /*********************************************************\ * IIC Write Register \*********************************************************/ void IIC_RegWrite(byte address, byte reg,byte val) { IICC_TX = 1; // Transmit Mode IIC_Start(); // Send Start IIC_CycleWrite(address); // Send IIC "Write" Address IIC_CycleWrite(reg); // Send Register IIC_CycleWrite(val); // Send Value IIC_Stop(); // Send Stop } /*********************************************************\ * IIC Read Register \*********************************************************/ byte IIC_RegRead(byte address, byte reg) { byte b; IICC_TX = 1; // Transmit Mode IIC_Start(); // Send Start IIC_CycleWrite(address); // Send IIC "Write" Address IIC_CycleWrite(reg); // Send Register IIC_RepeatStart(); // Send Repeat Start IIC_CycleWrite(address+1); // Send IIC "Read" Address b = IIC_CycleRead(1); // *** Dummy read: reads // "IIC_ReadAddress" value *** b = IIC_StopRead(); // Send Stop Read Command IICD return b; } /*********************************************************\ * IIC Read Multiple Registers \*********************************************************/ void IIC_RegReadN(byte address, byte reg1,byte N,byte *array) { byte b; IICC_TX = 1; // Transmit Mode IIC_Start(); // Send Start IIC_CycleWrite(address); // Send IIC "Write" Address IIC_CycleWrite(reg1); // Send Register IIC_RepeatStart(); // Send Repeat Start IIC_CycleWrite(address+1); // Send IIC "Read" Address b = IIC_CycleRead(N); // *** Dummy read: reads // "IIC_ReadAddress" value *** |
|
ссылки 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 |