mpxx6115a.h
Go to the documentation of this file.00001 00039 #ifndef DRV_MPXX6115A_H 00040 #define DRV_MPXX6115A_H 00041 00042 #define MPXX6115A_DIV_CONST 0.009f 00043 #define MPXX6115A_ADD_CONST 0.095f 00044 00045 00061 INLINE int16_t mpxx6115a_press(adcread_t vout, adcread_t vref) 00062 { 00063 float tmp; 00064 00065 tmp = (float)vout/(float)vref + MPXX6115A_ADD_CONST; 00066 00067 // To return hpascal we should multiply by 10 because the ratio is in kpascal 00068 return (int16_t)(tmp / MPXX6115A_DIV_CONST * 10); 00069 } 00070 00071 #endif /* DRV_MPXX6115A_H */
