ISSDK  1.7
IoT Sensing Software Development Kit
Functions | Variables
mma9553_drv.c File Reference

The mma9553_drv.c file implements the MMA9553L sensor driver interface. More...

#include "gpio_driver.h"
#include "mma9553_drv.h"
#include "systick_utils.h"
Include dependency graph for mma9553_drv.c:

Go to the source code of this file.

Functions

void MMA9553_SPI_ReadPreprocess (void *pCmdOut, uint32_t offset, uint32_t size)
 The SPI Read Pre-Process function to generate Sensor specific SPI Message Header. More...
 
void MMA9553_SPI_WritePreprocess (void *pCmdOut, uint32_t offset, uint32_t size, void *pWritebuffer)
 The SPI Write Pre-Process function to generate Sensor specific SPI Message Header. More...
 
int32_t MMA9553_SPI_Initialize (mma9553_spi_sensorhandle_t *pSensorHandle, ARM_DRIVER_SPI *pBus, uint8_t index, void *pSlaveSelect, void *pReset)
 The interface function to initialize the sensor. More...
 
void MMA9553_SPI_SetIdleTask (mma9553_spi_sensorhandle_t *pSensorHandle, registeridlefunction_t idleTask, void *userParam)
 : The interface function to set the SPI Idle Task. More...
 
int32_t MMA9553_SPI_Configure (mma9553_spi_sensorhandle_t *pSensorHandle, const registercommandlist_t *pCommandList)
 The interface function to configure he sensor. More...
 
int32_t MMA9553_SPI_CommandResponse (mma9553_spi_sensorhandle_t *pSensorHandle, const registercommandlist_t *pCommandList, const registerreadlist_t *pResponseList, uint8_t *pBuffer)
 The interface function to read the sensor data. More...
 
int32_t MMA9553_SPI_DeInit (mma9553_spi_sensorhandle_t *pSensorHandle)
 The interface function to De Initialize sensor.. More...
 
int32_t MMA9553_I2C_Initialize (mma9553_i2c_sensorhandle_t *pSensorHandle, ARM_DRIVER_I2C *pBus, uint8_t index, uint16_t sAddress)
 The interface function to initialize the sensor. More...
 
void MMA9553_I2C_SetIdleTask (mma9553_i2c_sensorhandle_t *pSensorHandle, registeridlefunction_t idleTask, void *userParam)
 : The interface function to set the I2C Idle Task. More...
 
int32_t MMA9553_I2C_Configure (mma9553_i2c_sensorhandle_t *pSensorHandle, const registercommandlist_t *pCommandList)
 The interface function to configure he sensor. More...
 
int32_t MMA9553_I2C_CommandResponse (mma9553_i2c_sensorhandle_t *pSensorHandle, const registercommandlist_t *pCommandList, const registerreadlist_t *pResponseList, uint8_t *pBuffer)
 The interface function to read the sensor data. More...
 
int32_t MMA9553_I2C_DeInit (mma9553_i2c_sensorhandle_t *pSensorHandle)
 The interface function to De Initialize sensor.. More...
 

Variables

uint8_t mma9553_spiRead_CmdBuffer [MMA9553_SPI_MAX_MSG_SIZE] = {0}
 
uint8_t mma9553_spiRead_DataBuffer [MMA9553_SPI_MAX_MSG_SIZE] = {0}
 
uint8_t mma9553_spiWrite_CmdDataBuffer [MMA9553_SPI_MAX_MSG_SIZE] = {0}
 
const uint8_t ReadVersionInfo [4] = {0x00, 0x00, 0x00, 0x0C}
 The Read Version Info Command. More...
 
const uint8_t MBoxQRDataXYZ [16]
 Configure MBOX for QR Data and XYZ Axes Command. More...
 
const uint8_t SetLegacyMode [5] = {0x18, 0x20, 0x00, 0x01, 0x10}
 Set Sensor to Legacy (free running) Mode Command. More...
 
const uint8_t SetLegacyIntMode [5] = {0x18, 0x20, 0x00, 0x01, 0xB0}
 Set Sensor to Legacy Mode with INT_O interrupt on completion of the AFE sampling. More...
 
const uint8_t WakeApplication [5] = {0x12, 0x20, 0x06, 0x01, 0x00}
 Set sensor to Wake Mode Command. More...
 
const uint8_t ResetApplication [5] = {0x17, 0x20, 0x03, 0x01, 0x01}
 Command to reset all applications of the sensor. More...
 
const uint8_t SetFSRange_2g [5] = {0x06, 0x20, 0x00, 0x01, 0x40}
 Full-Scale Range Selections. More...
 
const uint8_t SetFSRange_4g [5] = {0x06, 0x20, 0x00, 0x01, 0x80}
 
const uint8_t SetFSRange_8g [5] = {0x06, 0x20, 0x00, 0x01, 0x00}
 
const uint8_t SetSampleRate_488Hz [5] = {0x06, 0x20, 0x0C, 0x01, 0x07}
 Sample Rate Commands. More...
 
const uint8_t SetSampleRate_244Hz [5] = {0x06, 0x20, 0x0C, 0x01, 0x08}
 
const uint8_t SetSampleRate_122Hz [5] = {0x06, 0x20, 0x0C, 0x01, 0x09}
 
const uint8_t SetSampleRate_61Hz [5] = {0x06, 0x20, 0x0C, 0x01, 0x0A}
 
const uint8_t SetSampleRate_30Hz [5] = {0x06, 0x20, 0x0C, 0x01, 0x0B}
 
const uint8_t SetSampleRate_15Hz [5] = {0x06, 0x20, 0x0C, 0x01, 0x0C}
 
const uint8_t SetSampleRate_7Hz [5] = {0x06, 0x20, 0x0C, 0x01, 0x0D}
 
const uint8_t SetSampleRate_3Hz [5] = {0x06, 0x20, 0x0C, 0x01, 0x0E}
 
const uint8_t SetAFEPriority_for488Hz [5] = {0x01, 0x20, 0x32, 0x01, 0xD7}
 AFE Priority Commands. More...
 
const uint8_t SetAFEPriority_for224Hz [5] = {0x01, 0x20, 0x32, 0x01, 0xD6}
 
const uint8_t SetAFEPriority_for122Hz [5] = {0x01, 0x20, 0x32, 0x01, 0xD5}
 
const uint8_t SetAFEPriority_for61Hz [5] = {0x01, 0x20, 0x32, 0x01, 0xD4}
 
const uint8_t SetAFEPriority_for30Hz [5] = {0x01, 0x20, 0x32, 0x01, 0xD3}
 
const uint8_t SetAFEPriority_for15Hz [5] = {0x01, 0x20, 0x32, 0x01, 0xD2}
 
const uint8_t SetAFEPriority_for7Hz [5] = {0x01, 0x20, 0x32, 0x01, 0xD1}
 
const uint8_t SetAFEPriority_for3Hz [5] = {0x01, 0x20, 0x32, 0x01, 0xD0}
 
const uint8_t SetMBoxPriority_for488Hz [5] = {0x01, 0x20, 0x30, 0x01, 0xD7}
 MBox Priority Commands. More...
 
const uint8_t SetMBoxPriority_for244Hz [5] = {0x01, 0x20, 0x30, 0x01, 0xD6}
 
const uint8_t SetMBoxPriority_for122Hz [5] = {0x01, 0x20, 0x30, 0x01, 0xD5}
 
const uint8_t SetMBoxPriority_for61Hz [5] = {0x01, 0x20, 0x30, 0x01, 0xD4}
 
const uint8_t SetMBoxPriority_for30Hz [5] = {0x01, 0x20, 0x30, 0x01, 0xD3}
 
const uint8_t SetMBoxPriority_for15Hz [5] = {0x01, 0x20, 0x30, 0x01, 0xD2}
 
const uint8_t SetMBoxPriority_for7Hz [5] = {0x01, 0x20, 0x30, 0x01, 0xD1}
 
const uint8_t SetMBoxPriority_for3Hz [5] = {0x01, 0x20, 0x30, 0x01, 0xD0}
 
const uint8_t ReadPedometerData [4] = {0x15, 0x30, 0x00, 0x0C}
 Command to Read Pedometer Data. More...
 
const registercommandlist_t MMA9553_InitializeCommand []
 
const registercommandlist_t MMA9553_ReadSuspendRegistersCommand []
 
const registercommandlist_t MMA9553_ActivateCommands []
 
const registercommandlist_t MMA9553_StandbyCommands []
 
const registercommandlist_t MMA9553_ResetCommand []
 

Detailed Description

The mma9553_drv.c file implements the MMA9553L sensor driver interface.

Definition in file mma9553_drv.c.

Function Documentation

◆ MMA9553_I2C_CommandResponse()

int32_t MMA9553_I2C_CommandResponse ( mma9553_i2c_sensorhandle_t pSensorHandle,
const registercommandlist_t pCommandList,
const registerreadlist_t pReadList,
uint8_t *  pBuffer 
)

The interface function to read the sensor data.

This function read the sensor data out from the device and returns raw data in a byte stream.

Parameters
[in]pSensorHandlehandle to the sensor.
[in]pCommandListpointer to the command read list.
[in]pReadListpointer to the list of device registers and values to read.
[out]pBufferbuffer which holds raw sensor data.This buffer may be back to back databuffer based command read in the list.
Constraints:
This can be called any number of times only after MMA9553_I2C_Initialize(). Application has to ensure that previous instances of these APIs have exited before invocation. No
Returns
MMA9553_I2C_CommandResponse() returns the status .

Validate for the correct handle and register read list.

Check whether sensor handle is initialized before reading sensor data.

Definition at line 513 of file mma9553_drv.c.

References mma9553_i2c_sensorhandle_t::deviceInfo, int32_t(), mma9553_i2c_sensorhandle_t::isInitialized, MMA9553_COCO_ERROR_MASK, mma9553_i2c_sensorhandle_t::pCommDrv, SENSOR_ERROR_INIT, SENSOR_ERROR_INVALID_PARAM, SENSOR_ERROR_NONE, SENSOR_ERROR_READ, SENSOR_ERROR_WRITE, Sensor_I2C_BlockWrite(), Sensor_I2C_Read(), mma9553_i2c_sensorhandle_t::slaveAddress, and status.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMA9553_I2C_Configure()

int32_t MMA9553_I2C_Configure ( mma9553_i2c_sensorhandle_t pSensorHandle,
const registercommandlist_t pCommandList 
)

The interface function to configure he sensor.

This function configure the sensor with requested ODR, Range and registers in the regsiter pair array.

Parameters
[in]pSensorHandlehandle to the sensor.
[in]pCommandListpointer to the command write list.
Constraints:
This can be called any number of times only after MMA9553_I2C_Initialize(). Application has to ensure that previous instances of these APIs have exited before invocation. No
Returns
MMA9553_I2C_Configure() returns the status.

Check whether sensor handle is initialized before applying configuration.

Definition at line 448 of file mma9553_drv.c.

References mma9553_i2c_sensorhandle_t::deviceInfo, int32_t(), mma9553_i2c_sensorhandle_t::isInitialized, MMA9553_COCO_ERROR_MASK, MMA9553_HDR_SIZE, mma9553_i2c_sensorhandle_t::pCommDrv, Register_I2C_Read(), SENSOR_ERROR_INIT, SENSOR_ERROR_INVALID_PARAM, SENSOR_ERROR_READ, SENSOR_ERROR_WRITE, Sensor_I2C_BlockWrite(), mma9553_i2c_sensorhandle_t::slaveAddress, STANDBY_REG_SIZE, and status.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMA9553_I2C_DeInit()

int32_t MMA9553_I2C_DeInit ( mma9553_i2c_sensorhandle_t pSensorHandle)

The interface function to De Initialize sensor..

This function made sensor in a power safe state and de initialize its handle.

Parameters
[in]pSensorHandlehandle to the sensor.
Constraints:
This can be called only after MMA9553_I2C_Initialize(). Application has to ensure that previous instances of these APIs have exited before invocation. No
Returns
MMA9553_I2C_DeInit() returns the status .

Check whether sensor handle is initialized before triggering sensor reset.

De-initialize sensor handle.

Definition at line 555 of file mma9553_drv.c.

References mma9553_i2c_sensorhandle_t::deviceInfo, int32_t(), mma9553_i2c_sensorhandle_t::isInitialized, MMA9553_COCO_ERROR_MASK, mma9553_i2c_sensorhandle_t::pCommDrv, SENSOR_ERROR_INIT, SENSOR_ERROR_INVALID_PARAM, SENSOR_ERROR_NONE, SENSOR_ERROR_WRITE, Sensor_I2C_BlockWrite(), mma9553_i2c_sensorhandle_t::slaveAddress, and status.

Here is the call graph for this function:

◆ MMA9553_I2C_Initialize()

int32_t MMA9553_I2C_Initialize ( mma9553_i2c_sensorhandle_t pSensorHandle,
ARM_DRIVER_I2C *  pBus,
uint8_t  index,
uint16_t  sAddress 
)

The interface function to initialize the sensor.

This function initialize the sensor and sensor handle.

Parameters
[in]pSensorHandlehandle to the sensor.
[in]pBuspointer to the CMSIS API compatible I2C bus object.
[in]indexthe I2C device number.
[in]sAddressslave address of the device on the bus.
Constraints:
This should be the first API to be called. Application has to ensure that previous instances of these APIs have exited before invocation. No
Returns
MMA9553_I2C_Initialize() returns the status .

Check the input parameters.

Definition at line 395 of file mma9553_drv.c.

References BOARD_DELAY_ms(), mma9553_i2c_sensorhandle_t::deviceInfo, registerDeviceInfo_t::deviceInstance, registerDeviceInfo_t::functionParam, registerDeviceInfo_t::idleFunction, int32_t(), mma9553_i2c_sensorhandle_t::isInitialized, MMA9553_COCO_ERROR_MASK, MMA9553_HDR_SIZE, mma9553_i2c_sensorhandle_t::pCommDrv, ReadVersionInfo, Register_I2C_BlockWrite(), Register_I2C_Read(), SENSOR_ERROR_INIT, SENSOR_ERROR_INVALID_PARAM, SENSOR_ERROR_NONE, SENSOR_ERROR_WRITE, Sensor_I2C_BlockWrite(), mma9553_i2c_sensorhandle_t::slaveAddress, and status.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMA9553_I2C_SetIdleTask()

void MMA9553_I2C_SetIdleTask ( mma9553_i2c_sensorhandle_t pSensorHandle,
registeridlefunction_t  idleTask,
void *  userParam 
)

: The interface function to set the I2C Idle Task.

Parameters
[in]mma9553_i2c_sensorhandle_t *pSensorHandle, handle to the sensor handle.
[in]registeridlefunction_t idleTask, function pointer to the function to execute on I2C Idle Time.
[in]void *userParam, the pointer to the user idle ftask parameters.
Returns
void.
Constraints:
This can be called any number of times only after MMA9553_I2C_Initialize(). Application has to ensure that previous instances of these APIs have exited before invocation. No

Definition at line 440 of file mma9553_drv.c.

References mma9553_i2c_sensorhandle_t::deviceInfo, registerDeviceInfo_t::functionParam, and registerDeviceInfo_t::idleFunction.

Referenced by main().

Here is the caller graph for this function:

◆ MMA9553_SPI_CommandResponse()

int32_t MMA9553_SPI_CommandResponse ( mma9553_spi_sensorhandle_t pSensorHandle,
const registercommandlist_t pCommandList,
const registerreadlist_t pReadList,
uint8_t *  pBuffer 
)

The interface function to read the sensor data.

This function read the sensor data out from the device and returns raw data in a byte stream.

Parameters
[in]pSensorHandlehandle to the sensor.
[in]pCommandListpointer to the command read list.
[in]pReadListpointer to the list of device registers and values to read.
[out]pBufferbuffer which holds raw sensor data.This buffer may be back to back databuffer based command read in the list.
Constraints:
This can be called any number of times only after MMA9553_SPI_Initialize(). Application has to ensure that previous instances of these APIs have exited before invocation. No
Returns
MMA9553_SPI_CommandResponse() returns the status .

Validate for the correct handle and command list.

Check whether sensor handle is initialized before reading sensor data.

Parse through the read list and read the data one by one.

Definition at line 321 of file mma9553_drv.c.

References mma9553_spi_sensorhandle_t::deviceInfo, int32_t(), mma9553_spi_sensorhandle_t::isInitialized, MMA9553_COCO_ERROR_MASK, mma9553_spi_sensorhandle_t::pCommDrv, SENSOR_ERROR_INIT, SENSOR_ERROR_INVALID_PARAM, SENSOR_ERROR_NONE, SENSOR_ERROR_READ, SENSOR_ERROR_WRITE, Sensor_SPI_BlockWrite(), Sensor_SPI_Read(), mma9553_spi_sensorhandle_t::slaveParams, and status.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMA9553_SPI_Configure()

int32_t MMA9553_SPI_Configure ( mma9553_spi_sensorhandle_t pSensorHandle,
const registercommandlist_t pCommandList 
)

The interface function to configure he sensor.

This function configure the sensor with requested ODR, Range and registers in the regsiter pair array.

Parameters
[in]pSensorHandlehandle to the sensor.
[in]pCommandListpointer to the command list.
Constraints:
This can be called any number of times only after FXAS21002_SPI_Initialize(). Application has to ensure that previous instances of these APIs have exited before invocation. No
Returns
MMA9553_SPI_Configure() returns the status .

Validate for the correct handle and register write list.

Check whether sensor handle is initialized before applying configuration.

Definition at line 256 of file mma9553_drv.c.

References mma9553_spi_sensorhandle_t::deviceInfo, int32_t(), mma9553_spi_sensorhandle_t::isInitialized, MMA9553_COCO_ERROR_MASK, MMA9553_HDR_SIZE, mma9553_spi_sensorhandle_t::pCommDrv, Register_SPI_Read(), SENSOR_ERROR_INIT, SENSOR_ERROR_INVALID_PARAM, SENSOR_ERROR_READ, SENSOR_ERROR_WRITE, Sensor_SPI_BlockWrite(), mma9553_spi_sensorhandle_t::slaveParams, STANDBY_REG_SIZE, and status.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMA9553_SPI_DeInit()

int32_t MMA9553_SPI_DeInit ( mma9553_spi_sensorhandle_t pSensorHandle)

The interface function to De Initialize sensor..

This function made sensor in a power safe state and de initialize its handle.

Parameters
[in]pSensorHandlehandle to the sensor.
Constraints:
This can be called only after after MMA9553_SPI_Initialize(). Application has to ensure that previous instances of these APIs have exited before invocation. No
Returns
MMA9553_SPI_DeInit() returns the status .

Check whether sensor handle is initialized before triggering sensor reset.

Trigger sensor device reset.

De-initialize sensor handle.

Definition at line 364 of file mma9553_drv.c.

References mma9553_spi_sensorhandle_t::deviceInfo, int32_t(), mma9553_spi_sensorhandle_t::isInitialized, MMA9553_COCO_ERROR_MASK, mma9553_spi_sensorhandle_t::pCommDrv, SENSOR_ERROR_INIT, SENSOR_ERROR_INVALID_PARAM, SENSOR_ERROR_NONE, SENSOR_ERROR_WRITE, Sensor_SPI_BlockWrite(), mma9553_spi_sensorhandle_t::slaveParams, and status.

Here is the call graph for this function:

◆ MMA9553_SPI_Initialize()

int32_t MMA9553_SPI_Initialize ( mma9553_spi_sensorhandle_t pSensorHandle,
ARM_DRIVER_SPI *  pBus,
uint8_t  index,
void *  pSlaveSelect,
void *  pReset 
)

The interface function to initialize the sensor.

This function initializes the sensor and sensor handle.

Parameters
[in]pSensorHandlehandle to the sensor.
[in]pBuspointer to the CMSIS API compatible SPI bus object.
[in]indexthe I2C device number.
[in]pSlaveSelectslave select hndle of the device on the bus.
[in]pResetreset handle of the device on the bus.
Constraints:
This should be the first API to be called. Application has to ensure that previous instances of these APIs have exited before invocation. No
Returns
MMA9553_SPI_Initialize() returns the status .

Check the input parameters.

Initialize the sensor handle.

Definition at line 183 of file mma9553_drv.c.

References BOARD_DELAY_ms(), GENERIC_DRIVER_GPIO::clr_pin, mma9553_spi_sensorhandle_t::deviceInfo, registerDeviceInfo_t::deviceInstance, Driver_GPIO_KSDK, registerDeviceInfo_t::functionParam, GPIO_DIRECTION_OUT, registerDeviceInfo_t::idleFunction, int32_t(), mma9553_spi_sensorhandle_t::isInitialized, MMA9553_COCO_ERROR_MASK, MMA9553_HDR_SIZE, MMA9553_SPI_CMD_LEN, MMA9553_SPI_ReadPreprocess(), MMA9553_SPI_WritePreprocess(), MMA9553_SS_ACTIVE_VALUE, mma9553_spi_sensorhandle_t::pCommDrv, pGPIODriver, GENERIC_DRIVER_GPIO::pin_init, spiSlaveSpecificParams_t::pReadPreprocessFN, spiSlaveSpecificParams_t::pTargetSlavePinID, spiSlaveSpecificParams_t::pWritePreprocessFN, ReadVersionInfo, Register_SPI_BlockWrite(), Register_SPI_Read(), SENSOR_ERROR_INIT, SENSOR_ERROR_INVALID_PARAM, SENSOR_ERROR_NONE, SENSOR_ERROR_WRITE, Sensor_SPI_BlockWrite(), GENERIC_DRIVER_GPIO::set_pin, mma9553_spi_sensorhandle_t::slaveParams, spiSlaveSpecificParams_t::spiCmdLen, spiSlaveSpecificParams_t::ssActiveValue, and status.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMA9553_SPI_ReadPreprocess()

void MMA9553_SPI_ReadPreprocess ( void *  pCmdOut,
uint32_t  offset,
uint32_t  size 
)

The SPI Read Pre-Process function to generate Sensor specific SPI Message Header.

This function prepares the SPI Read Command Header with register address and R/W bit encoded as the Sensor.

Parameters
[out]pCmdOuthandle to the output buffer.
[in]offsetthe address of the register to start reading from.
[in]sizenumber of bytes to read.
Constraints:
None Application has to ensure that previous instances of these APIs have exited before invocation. No
Returns
:: None.

Definition at line 146 of file mma9553_drv.c.

References MMA9553_SPI_CMD_LEN, mma9553_spiRead_CmdBuffer, mma9553_spiRead_DataBuffer, spi_mater_SlaveCmd::pReadBuffer, spi_mater_SlaveCmd::pWriteBuffer, and spi_mater_SlaveCmd::size.

Referenced by MMA9553_SPI_Initialize().

Here is the caller graph for this function:

◆ MMA9553_SPI_SetIdleTask()

void MMA9553_SPI_SetIdleTask ( mma9553_spi_sensorhandle_t pSensorHandle,
registeridlefunction_t  idleTask,
void *  userParam 
)

: The interface function to set the SPI Idle Task.

Parameters
[in]mma9553_spi_sensorhandle_t *pSensorHandle, handle to the sensor handle.
[in]registeridlefunction_t idleTask, function pointer to the function to execute on SPI Idle Time.
[in]void *userParam, the pointer to the user idle ftask parameters.
Returns
void.
Constraints:
This can be called any number of times only after MMA9553_I2C_Initialize(). Application has to ensure that previous instances of these APIs have exited before invocation. No

Definition at line 248 of file mma9553_drv.c.

References mma9553_spi_sensorhandle_t::deviceInfo, registerDeviceInfo_t::functionParam, and registerDeviceInfo_t::idleFunction.

Referenced by main().

Here is the caller graph for this function:

◆ MMA9553_SPI_WritePreprocess()

void MMA9553_SPI_WritePreprocess ( void *  pCmdOut,
uint32_t  offset,
uint32_t  size,
void *  pWritebuffer 
)

The SPI Write Pre-Process function to generate Sensor specific SPI Message Header.

This function prepares the SPI Write Command Header with register address and R/W bit encoded as the Sensor.

Parameters
[out]pCmdOuthandle to the output buffer.
[in]offsetthe address of the register to start writing from.
[in]sizenumber of bytes to write.
Constraints:
None Application has to ensure that previous instances of these APIs have exited before invocation. No
Returns
:: None.

Definition at line 163 of file mma9553_drv.c.

References MMA9553_SPI_CMD_LEN, mma9553_spiWrite_CmdDataBuffer, spi_mater_SlaveCmd::pReadBuffer, spi_mater_SlaveCmd::pWriteBuffer, and spi_mater_SlaveCmd::size.

Referenced by MMA9553_SPI_Initialize().

Here is the caller graph for this function:

Variable Documentation

◆ MBoxQRDataXYZ

const uint8_t MBoxQRDataXYZ[16]
Initial value:
= {0x04, 0x20, 0x2C, 0x0C, 0x06, 0x13, 0x06, 0x12,
0x06, 0x15, 0x06, 0x14, 0x06, 0x17, 0x06, 0x16}

Configure MBOX for QR Data and XYZ Axes Command.

Definition at line 73 of file mma9553_drv.c.

◆ MMA9553_ActivateCommands

const registercommandlist_t MMA9553_ActivateCommands[]
Initial value:
= {{WriteSuspendRegisters, 0, sizeof(WriteSuspendRegisters)},
const uint8_t WakeApplication[5]
Set sensor to Wake Mode Command.
Definition: mma9553_drv.c:83
const uint8_t SetLegacyMode[5]
Set Sensor to Legacy (free running) Mode Command.
Definition: mma9553_drv.c:77
#define __END_WRITE_CMD__
Definition: sensor_drv.h:83

Definition at line 132 of file mma9553_drv.c.

◆ MMA9553_InitializeCommand

const registercommandlist_t MMA9553_InitializeCommand[]
Initial value:
= {{MBoxQRDataXYZ, 0, sizeof(MBoxQRDataXYZ)},
const uint8_t MBoxQRDataXYZ[16]
Configure MBOX for QR Data and XYZ Axes Command.
Definition: mma9553_drv.c:73
#define __END_WRITE_CMD__
Definition: sensor_drv.h:83

Definition at line 126 of file mma9553_drv.c.

◆ MMA9553_ReadSuspendRegistersCommand

const registercommandlist_t MMA9553_ReadSuspendRegistersCommand[]
Initial value:
= {
{ReadSuspendRegisters, 0, sizeof(ReadSuspendRegisters)}, __END_WRITE_CMD__}
#define __END_WRITE_CMD__
Definition: sensor_drv.h:83

Definition at line 129 of file mma9553_drv.c.

◆ MMA9553_ResetCommand

const registercommandlist_t MMA9553_ResetCommand[]
Initial value:
const uint8_t ResetApplication[5]
Command to reset all applications of the sensor.
Definition: mma9553_drv.c:86
#define __END_WRITE_CMD__
Definition: sensor_drv.h:83

Definition at line 140 of file mma9553_drv.c.

◆ mma9553_spiRead_CmdBuffer

uint8_t mma9553_spiRead_CmdBuffer[MMA9553_SPI_MAX_MSG_SIZE] = {0}

Definition at line 50 of file mma9553_drv.c.

Referenced by MMA9553_SPI_ReadPreprocess().

◆ mma9553_spiRead_DataBuffer

uint8_t mma9553_spiRead_DataBuffer[MMA9553_SPI_MAX_MSG_SIZE] = {0}

Definition at line 51 of file mma9553_drv.c.

Referenced by MMA9553_SPI_ReadPreprocess().

◆ mma9553_spiWrite_CmdDataBuffer

uint8_t mma9553_spiWrite_CmdDataBuffer[MMA9553_SPI_MAX_MSG_SIZE] = {0}

Definition at line 52 of file mma9553_drv.c.

Referenced by MMA9553_SPI_WritePreprocess().

◆ MMA9553_StandbyCommands

const registercommandlist_t MMA9553_StandbyCommands[]
Initial value:
= {
{SuspendAFE, 0, sizeof(SuspendAFE)}, {SuspendPedometer, 0, sizeof(SuspendPedometer)}, __END_WRITE_CMD__}
#define __END_WRITE_CMD__
Definition: sensor_drv.h:83

Definition at line 137 of file mma9553_drv.c.

◆ ReadPedometerData

const uint8_t ReadPedometerData[4] = {0x15, 0x30, 0x00, 0x0C}

Command to Read Pedometer Data.

Definition at line 124 of file mma9553_drv.c.

◆ ReadVersionInfo

const uint8_t ReadVersionInfo[4] = {0x00, 0x00, 0x00, 0x0C}

The Read Version Info Command.

Definition at line 70 of file mma9553_drv.c.

Referenced by MMA9553_I2C_Initialize(), and MMA9553_SPI_Initialize().

◆ ResetApplication

const uint8_t ResetApplication[5] = {0x17, 0x20, 0x03, 0x01, 0x01}

Command to reset all applications of the sensor.

Definition at line 86 of file mma9553_drv.c.

◆ SetAFEPriority_for122Hz

const uint8_t SetAFEPriority_for122Hz[5] = {0x01, 0x20, 0x32, 0x01, 0xD5}

Definition at line 106 of file mma9553_drv.c.

◆ SetAFEPriority_for15Hz

const uint8_t SetAFEPriority_for15Hz[5] = {0x01, 0x20, 0x32, 0x01, 0xD2}

Definition at line 109 of file mma9553_drv.c.

◆ SetAFEPriority_for224Hz

const uint8_t SetAFEPriority_for224Hz[5] = {0x01, 0x20, 0x32, 0x01, 0xD6}

Definition at line 105 of file mma9553_drv.c.

◆ SetAFEPriority_for30Hz

const uint8_t SetAFEPriority_for30Hz[5] = {0x01, 0x20, 0x32, 0x01, 0xD3}

Definition at line 108 of file mma9553_drv.c.

◆ SetAFEPriority_for3Hz

const uint8_t SetAFEPriority_for3Hz[5] = {0x01, 0x20, 0x32, 0x01, 0xD0}

Definition at line 111 of file mma9553_drv.c.

◆ SetAFEPriority_for488Hz

const uint8_t SetAFEPriority_for488Hz[5] = {0x01, 0x20, 0x32, 0x01, 0xD7}

AFE Priority Commands.

Definition at line 104 of file mma9553_drv.c.

◆ SetAFEPriority_for61Hz

const uint8_t SetAFEPriority_for61Hz[5] = {0x01, 0x20, 0x32, 0x01, 0xD4}

Definition at line 107 of file mma9553_drv.c.

◆ SetAFEPriority_for7Hz

const uint8_t SetAFEPriority_for7Hz[5] = {0x01, 0x20, 0x32, 0x01, 0xD1}

Definition at line 110 of file mma9553_drv.c.

◆ SetFSRange_2g

const uint8_t SetFSRange_2g[5] = {0x06, 0x20, 0x00, 0x01, 0x40}

Full-Scale Range Selections.

Definition at line 89 of file mma9553_drv.c.

◆ SetFSRange_4g

const uint8_t SetFSRange_4g[5] = {0x06, 0x20, 0x00, 0x01, 0x80}

Definition at line 90 of file mma9553_drv.c.

◆ SetFSRange_8g

const uint8_t SetFSRange_8g[5] = {0x06, 0x20, 0x00, 0x01, 0x00}

Definition at line 91 of file mma9553_drv.c.

◆ SetLegacyIntMode

const uint8_t SetLegacyIntMode[5] = {0x18, 0x20, 0x00, 0x01, 0xB0}

Set Sensor to Legacy Mode with INT_O interrupt on completion of the AFE sampling.

Definition at line 80 of file mma9553_drv.c.

◆ SetLegacyMode

const uint8_t SetLegacyMode[5] = {0x18, 0x20, 0x00, 0x01, 0x10}

Set Sensor to Legacy (free running) Mode Command.

Definition at line 77 of file mma9553_drv.c.

◆ SetMBoxPriority_for122Hz

const uint8_t SetMBoxPriority_for122Hz[5] = {0x01, 0x20, 0x30, 0x01, 0xD5}

Definition at line 116 of file mma9553_drv.c.

◆ SetMBoxPriority_for15Hz

const uint8_t SetMBoxPriority_for15Hz[5] = {0x01, 0x20, 0x30, 0x01, 0xD2}

Definition at line 119 of file mma9553_drv.c.

◆ SetMBoxPriority_for244Hz

const uint8_t SetMBoxPriority_for244Hz[5] = {0x01, 0x20, 0x30, 0x01, 0xD6}

Definition at line 115 of file mma9553_drv.c.

◆ SetMBoxPriority_for30Hz

const uint8_t SetMBoxPriority_for30Hz[5] = {0x01, 0x20, 0x30, 0x01, 0xD3}

Definition at line 118 of file mma9553_drv.c.

◆ SetMBoxPriority_for3Hz

const uint8_t SetMBoxPriority_for3Hz[5] = {0x01, 0x20, 0x30, 0x01, 0xD0}

Definition at line 121 of file mma9553_drv.c.

◆ SetMBoxPriority_for488Hz

const uint8_t SetMBoxPriority_for488Hz[5] = {0x01, 0x20, 0x30, 0x01, 0xD7}

MBox Priority Commands.

Definition at line 114 of file mma9553_drv.c.

◆ SetMBoxPriority_for61Hz

const uint8_t SetMBoxPriority_for61Hz[5] = {0x01, 0x20, 0x30, 0x01, 0xD4}

Definition at line 117 of file mma9553_drv.c.

◆ SetMBoxPriority_for7Hz

const uint8_t SetMBoxPriority_for7Hz[5] = {0x01, 0x20, 0x30, 0x01, 0xD1}

Definition at line 120 of file mma9553_drv.c.

◆ SetSampleRate_122Hz

const uint8_t SetSampleRate_122Hz[5] = {0x06, 0x20, 0x0C, 0x01, 0x09}

Definition at line 96 of file mma9553_drv.c.

◆ SetSampleRate_15Hz

const uint8_t SetSampleRate_15Hz[5] = {0x06, 0x20, 0x0C, 0x01, 0x0C}

Definition at line 99 of file mma9553_drv.c.

◆ SetSampleRate_244Hz

const uint8_t SetSampleRate_244Hz[5] = {0x06, 0x20, 0x0C, 0x01, 0x08}

Definition at line 95 of file mma9553_drv.c.

◆ SetSampleRate_30Hz

const uint8_t SetSampleRate_30Hz[5] = {0x06, 0x20, 0x0C, 0x01, 0x0B}

Definition at line 98 of file mma9553_drv.c.

◆ SetSampleRate_3Hz

const uint8_t SetSampleRate_3Hz[5] = {0x06, 0x20, 0x0C, 0x01, 0x0E}

Definition at line 101 of file mma9553_drv.c.

◆ SetSampleRate_488Hz

const uint8_t SetSampleRate_488Hz[5] = {0x06, 0x20, 0x0C, 0x01, 0x07}

Sample Rate Commands.

Definition at line 94 of file mma9553_drv.c.

◆ SetSampleRate_61Hz

const uint8_t SetSampleRate_61Hz[5] = {0x06, 0x20, 0x0C, 0x01, 0x0A}

Definition at line 97 of file mma9553_drv.c.

◆ SetSampleRate_7Hz

const uint8_t SetSampleRate_7Hz[5] = {0x06, 0x20, 0x0C, 0x01, 0x0D}

Definition at line 100 of file mma9553_drv.c.

◆ WakeApplication

const uint8_t WakeApplication[5] = {0x12, 0x20, 0x06, 0x01, 0x00}

Set sensor to Wake Mode Command.

Definition at line 83 of file mma9553_drv.c.