SysIo  1.9.0
Embedded Library and tools
gp2.h
1 
16 #ifndef _SYSIO_GP2_H_
17 #define _SYSIO_GP2_H_
18 
19 #include <sysio/defs.h>
20 #ifdef __cplusplus
21  extern "C" {
22 #endif
23 /* ========================================================================== */
24 
35 /* constants ================================================================ */
41 #define GP2I2C_I2CADDR 0x46
42 
43 /* structures =============================================================== */
47 struct xG2pSetting {
48  double dD1;
49  double dV1;
50  double dD2;
51  double dV2;
52 };
53 typedef struct xG2pSetting xG2pSetting;
54 
58 struct xG2pSensor;
59 typedef struct xG2pSensor xG2pSensor;
60 
61 /* internal public functions ================================================ */
69 xG2pSensor * xGp2Open (const char * sI2cBus, int iI2cAddr, const xG2pSetting * xSetting);
70 
76 int iGp2Close (xG2pSensor * xSensor);
77 
83 void vGp2SetSetting (xG2pSensor * xSensor, const xG2pSetting * xSetting);
84 
90 int iGp2ReadVoltage (xG2pSensor * xSensor);
91 
97 int iGp2Read (xG2pSensor * xSensor);
98 
104 int iGp2VoltageToDensity (int iVoltage, const xG2pSetting * xSetting);
105 
110 /* ========================================================================== */
111 #ifdef __cplusplus
112  }
113 #endif
114 #endif /* _SYSIO_GP2_H_ defined */
void vGp2SetSetting(xG2pSensor *xSensor, const xG2pSetting *xSetting)
Modification du repère d&#39;étalonnage.
xG2pSensor * xGp2Open(const char *sI2cBus, int iI2cAddr, const xG2pSetting *xSetting)
Ouverture d&#39;un capteur.
int iGp2ReadVoltage(xG2pSensor *xSensor)
Lecture de la tension moyenne en sortie du capteur.
double dD2
Definition: gp2.h:50
int iGp2VoltageToDensity(int iVoltage, const xG2pSetting *xSetting)
Convertion d&#39;une tension en densité de particules fines.
int iGp2Read(xG2pSensor *xSensor)
Lecture de la densité de particules fines.
double dD1
Definition: gp2.h:48
double dV1
Definition: gp2.h:49
int iGp2Close(xG2pSensor *xSensor)
Fermeture et destruction d&#39;un capteur.
Repère d&#39;étalonnage.
Definition: gp2.h:47
double dV2
Definition: gp2.h:51