| 数据搜索系统,热门电子元器件搜索 |
|
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 *** |
|
链接网址 |
| 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 |