| ISF 2.2 rev 5 Intelligent Sensing Framework for Kinetis with Processor Expert

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

mma8491q.h
Go to the documentation of this file.
1 /**
2 * @file mma8491q.h
3 * @brief The \b mma8491q.h contains register definitions and macros as well as the type definitions
4 * and public functions for the lowest level interface to the MMA865x family of parts.
5 *
6 * @copyright Copyright (c) 2015, Freescale Semiconductor, Inc.
7 */
8 #ifndef _MMA8491Q_H_
9 #define _MMA8491Q_H_
10
11 #include <stdint.h>
12
13 /*
14 * Sensor ID
15 */
16 #define MMA8491Q_WHOAMI_VALUE (0x55)
17
18 /*
19 * General purpose macros to set/get a specific bit field within a register.
20 * The macro assumes that the root identifier for the field is a consistent character string (e.g., "BIT_FIELD").
21 * The bit field mask is the character string followed by "_MASK" (e.g., BIT_FIELD_MASK).
22 * The bit field shift is the character string followed by "_SHIFT" (e.g., BIT_FIELD_SHIFT).
23 */
24 #define SET_FIELD(name,val) (((val)<<name##_SHIFT)&(name##_MASK))
25 #define GET_FIELD(name,val) ((val&name##_MASK)>>name##_SHIFT)
26
27 /*
28 ** STATUS Register
29 */
30 #define ZYXOW_MASK 0x80
31 #define ZYXOW_SHIFT 7
32 #define ZOW_MASK 0x40
33 #define YOW_MASK 0x20
34 #define XOW_MASK 0x10
35 #define ZYXDR_MASK 0x08
36 #define ZYXDR_SHIFT 3
37 #define ZDR_MASK 0x04
38 #define YDR_MASK 0x02
39 #define XDR_MASK 0x01
40
41 /*
42 * Public Types
43 */
44
45 /*
46 * MMA8491Q Sensor Internal Registers
47 */
48 enum
49 {
50 MMA8491Q_STATUS_00 = 0, // 0x00 - status register x,y,z,xyz
51 MMA8491Q_OUT_X_MSB, // 0x01 - data register address1
52 MMA8491Q_OUT_X_LSB, // 0x02 - data register address2
53 MMA8491Q_OUT_Y_MSB, // 0x03 - data register address3
54 MMA8491Q_OUT_Y_lSB, // 0x04 - data register address4
55 MMA8491Q_OUT_Z_MSB, // 0x05 - data register address5
56 MMA8491Q_OUT_Z_LSB, // 0x06 - data register address6
57 };
58
59 /*! @brief Define the MMA8491Q functional interface status return type. */
60 enum
61 {
62 MMA8491Q_DATA_SUCCESS,
63 MMA8491Q_DATA_FAIL
64 };
65
66 // These are the modes of the MMA8498Q device according to the Freescale Specification
67 typedef enum
68 {
69 MMA8491Q_SHUTDOWN = 0,
70 MMA8491Q_ACTIVE,
71 MMA8491Q_STANDBY
72
73 } mma8491q_mode_t;
74
75 typedef struct
76 {
77 uint32_t padding;
78 } mma8491q_Sensor_Specific_Settings_t;
79
80
81 #endif /* _MMA8491Q_H_ */
MMA8491Q_OUT_X_MSB
Definition: mma8491q.h:51
MMA8491Q_OUT_Z_LSB
Definition: mma8491q.h:56
mma8491q_mode_t
mma8491q_mode_t
Definition: mma8491q.h:67
MMA8491Q_OUT_Y_lSB
Definition: mma8491q.h:54
mma8491q_Sensor_Specific_Settings_t::padding
uint32_t padding
Definition: mma8491q.h:77
MMA8491Q_OUT_X_LSB
Definition: mma8491q.h:52
MMA8491Q_STANDBY
Definition: mma8491q.h:71
MMA8491Q_DATA_FAIL
Definition: mma8491q.h:63
MMA8491Q_STATUS_00
Definition: mma8491q.h:50
mma8491q_Sensor_Specific_Settings_t
Definition: mma8491q.h:75
MMA8491Q_SHUTDOWN
Definition: mma8491q.h:69
MMA8491Q_DATA_SUCCESS
Definition: mma8491q.h:62
MMA8491Q_OUT_Z_MSB
Definition: mma8491q.h:55
MMA8491Q_OUT_Y_MSB
Definition: mma8491q.h:53
MMA8491Q_ACTIVE
Definition: mma8491q.h:70
- © Freescale Semiconductor, Inc. 2016. All Rights Reserved.