Contiki 2.6
|
00001 /******************** (C) COPYRIGHT 2009 STMicroelectronics ******************** 00002 * File Name : mems.h 00003 * Author : MCD Application Team 00004 * Version : V1.0 00005 * Date : January 2010 00006 * Description : header file for mems driver 00007 ******************************************************************************** 00008 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 00009 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 00010 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 00011 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 00012 * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 00013 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 00014 *******************************************************************************/ 00015 00016 #ifndef _MEMS_H_ 00017 #define _MEMS_H_ 00018 00019 /* Define --------------------------------------------------------------------*/ 00020 #include "mems_regs.h" 00021 00022 /* Define --------------------------------------------------------------------*/ 00023 // Sensitivity values in mg/digit 00024 #define HIGH_RANGE_SENSITIVITY 72 00025 #define LOW_RANGE_SENSITIVITY 18 00026 00027 #define MEMS_LOW_RANGE 0 00028 #define MEMS_HIGH_RANGE 1 00029 00030 /* Typedef -------------------------------------------------------------------*/ 00031 /* Mems data type: three acceleration values each related to a specific direction 00032 Watch out: only lower data values (e.g. those terminated by the _l) are 00033 currently used by the device */ 00034 00035 typedef struct { 00036 int8s outx_l; 00037 int8s outx_h; 00038 int8s outy_l; 00039 int8s outy_h; 00040 int8s outz_l; 00041 int8s outz_h; 00042 } t_mems_data; 00043 00044 /* Functions -----------------------------------------------------------------*/ 00045 00046 /* Mems Initialization function */ 00047 int8u Mems_Init(void); 00048 00049 int8u MEMS_On(void); 00050 int8u MEMS_Off(void); 00051 int8u MEMS_SetFullScale(boolean range); 00052 boolean MEMS_GetFullScale(void); 00053 00054 /* Get mems acceleration values */ 00055 int8u Mems_GetValue(t_mems_data *mems_data); 00056 00057 #endif /* _MEMS_H_ */ 00058 00059 /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/