PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
Sensor
liblis3dh
getSPImode.c
1
/*
2
* @file getSPImode.c
3
*
4
* @author Michael Mulholland
5
*
6
* @version 1.0.0
7
*
8
* @copyright
9
* Copyright (C) Parallax, Inc. 2020. All Rights MIT Licensed.
10
*
11
* @brief Gets SPI mode for the Parallax LIS3DH 3-Axis Accelerometer Module with ADC.
12
*
13
*/
14
15
16
#include "
simpletools.h
"
17
#include "
lis3dh.h
"
18
19
20
21
int
lis3dh_getSPImode
(
lis3dh_t
*device)
22
{
23
return
((
lis3dh_readByte
(device, LIS3DH_CTRL_REG4) & LIS3DH_MASK_SPIMODE)==LIS3DH_SPIMODE_3) ? 3 : 4;
24
}
25
26
27
28
simpletools.h
This library provides convenient functions for a variety of microcontroller I/O, timing,...
lis3dh.h
Simplifies reading Parallax LIS3DH 3-Axis Accelerometer Module with ADC.
lis3dh_st
Definition:
lis3dh.h:122
lis3dh_getSPImode
int lis3dh_getSPImode(lis3dh_t *device)
Read the SPI mode currently configured in the LIS3DH module; either 3-wire or 4-wire.
Definition:
getSPImode.c:21
lis3dh_readByte
unsigned char lis3dh_readByte(lis3dh_t *device, unsigned char address)
Read a value from an LIS3DH register.
Definition:
readByte.c:21
Generated on Fri May 20 2022 16:48:05 for PropWare by
1.8.17