PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
Sensor
libmma7455
getMode.c
1
/*
2
* @file getMode.c
3
*
4
* @author Andy Lindsay
5
*
6
* @version 0.50
7
*
8
* @copyright
9
* Copyright (C) Parallax, Inc. 2014. All Rights MIT Licensed.
10
*
11
* @brief Gets mode of operation from the Parallax MMA7455 3-Axis Accelerometer Module.
12
*/
13
14
15
#include "
simpletools.h
"
16
#include "
mma7455.h
"
17
18
19
int
MMA7455_pinDat
,
MMA7455_pinClk
,
MMA7455_pinEn
;
20
21
22
unsigned
char
MMA7455_getMode
()
23
{
24
unsigned
char
mode =
MMA7455_readByte
(
MMA7455_MCTL
);
25
mode &= 0b11;
26
return
mode;
27
}
28
29
MMA7455_MCTL
#define MMA7455_MCTL
Definition:
mma7455.h:137
simpletools.h
This library provides convenient functions for a variety of microcontroller I/O, timing,...
MMA7455_readByte
unsigned char MMA7455_readByte(unsigned char address)
Read a value from an MMA7455 register.
Definition:
readByte.c:27
MMA7455_pinEn
int MMA7455_pinEn
Definition:
getMode.c:19
MMA7455_pinDat
int MMA7455_pinDat
Definition:
getMode.c:19
MMA7455_getMode
unsigned char MMA7455_getMode()
Get the mode of operation: (0) standby, (1) measurement, (2) level error detection,...
Definition:
getMode.c:22
mma7455.h
Simplifies reading Parallax MMA7455 3-Axis Accelerometer Module.
MMA7455_pinClk
int MMA7455_pinClk
Definition:
getMode.c:19
Generated on Fri May 20 2022 16:48:05 for PropWare by
1.8.17