• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  * $Id: AKFS_Compass.h 580 2012-03-29 09:56:21Z yamada.rj $
3  ******************************************************************************
4  *
5  * Copyright (C) 2012 Asahi Kasei Microdevices Corporation, Japan
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 #ifndef AKFS_INC_COMPASS_H
20 #define AKFS_INC_COMPASS_H
21 
22 #include "AKFS_Common.h"
23 #include "AKFS_CSpec.h"
24 
25 #ifdef WIN32
26 #include "AK8975_LinuxDriver.h"
27 #else
28 #include "AK8975Driver.h"
29 #endif
30 
31 /****************************************/
32 /* Include files for AK8975 library.    */
33 /****************************************/
34 #include "AKFS_AK8975.h"
35 #include "AKFS_Configure.h"
36 #include "AKFS_AOC.h"
37 #include "AKFS_Device.h"
38 #include "AKFS_Direction.h"
39 #include "AKFS_Math.h"
40 #include "AKFS_VNorm.h"
41 
42 /*** Constant definition ******************************************************/
43 
44 /*** Type declaration *********************************************************/
45 typedef struct _AKSENSOR_DATA{
46 	AKFLOAT	x;
47 	AKFLOAT	y;
48 	AKFLOAT	z;
49     int8	status;
50 } AKSENSOR_DATA;
51 
52 /*! A parameter structure. */
53 typedef struct _AK8975PRMS{
54 	/* Variables for Decomp8975. */
55 	AKFVEC			mfv_hdata[AKFS_HDATA_SIZE];
56 	uint8vec		mi_asa;
57 	uint8			mi_st;
58 
59 	/* Variables forAOC. */
60 	AKFS_AOC_VAR	m_aocv;
61 
62 	/* Variables for Magnetometer buffer. */
63 	AKFVEC			mfv_hvbuf[AKFS_HDATA_SIZE];
64 	AKFVEC			mfv_ho;
65 	AKFVEC			mfv_hs;
66 	AKFS_PATNO		m_hpat;
67 
68 	/* Variables for Accelerometer buffer. */
69 	AKFVEC			mfv_adata[AKFS_ADATA_SIZE];
70 	AKFVEC			mfv_avbuf[AKFS_ADATA_SIZE];
71 	AKFVEC			mfv_ao;
72 	AKFVEC			mfv_as;
73 
74 	/* Variables for Direction. */
75 	int16			mi_hnaveD;
76 	int16			mi_anaveD;
77 	AKFLOAT			mf_azimuth;
78 	AKFLOAT			mf_pitch;
79 	AKFLOAT			mf_roll;
80 
81 	/* Variables for vector output */
82 	int16			mi_hnaveV;
83 	int16			mi_anaveV;
84 	AKFVEC			mfv_hvec;
85 	AKFVEC			mfv_avec;
86 	int16			mi_hstatus;
87 
88 } AK8975PRMS;
89 
90 #endif
91 
92