| 전자부품 데이터시트 검색엔진 |
|
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 |
| ALLDATASHEET 가 귀하에 도움이 되셨나요? [ DONATE ] |
Alldatasheet는? | 광고문의 | 운영자에게 연락하기 | 개인정보취급방침 | 링크 투 데이터시트 | 링크교환 | 제조사별 검색 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 |