Code Example; Figure 5 Code Example For Usage Of Meas_Acceleration() - Infineon SP37 Function Manual

High integrated single-chip tpms sensor with a low power embedded microcontroller and wireless fsk/ask uhf transmitter
Table of Contents

Advertisement

2.4.8

Code Example

// Library function prototypes
#include "SP37_ROMLibrary.h"
void main()
{
// Return value of acceleration measurement is stored in StatusByte
unsigned char StatusByte;
// Input parameters for acceleration measurement
unsigned int SensorConfig = 0x0001;
unsigned char SampRate = 0x00;
// struct for acceleration measurement results
struct{
signed int Acceleration;
signed int Raw_acceleration;
signed int Raw_temperature;
} idata Accel_Result;
// Acceleration measurement function call
StatusByte = Meas_Acceleration(SensorConfig, SampRate, &Accel_Result.Acceleration);
if(!StatusByte){
// Acceleration measurement was successful
}
else{
// Acceleration measurement was not successful, underflow or
// overflow of ADC result, Sensor Fault Wire Bond Check,
// Sensor Fault Diagnosis Resistor, or VMIN warning occurred
}
}
Figure 5
Code example for usage of Meas_Acceleration()
ROM Library Function Guide
Tire Pressure Monitoring Sensor
50
SP37
ROM Library Functions
Revision 1.0, 2011-12-15

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents