#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "upm_utilities.h"
int main()
{
if(dev == NULL) {
printf("Unable to initialize sensor\n");
return 0;
}
while(1){
upm_delay(1);
}
return 0;
}
Go to the source code of this file.
|
#define | ABP_DEFAULT_ADDRESS 0x28 |
|
#define | OUTPUT_10_PERCENT_COUNT 1638 |
|
#define | OUTPUT_90_PERCENT_COUNT 14746 |
|
#define | ABP_PRESSURE_MAX 5 |
|
#define | ABP_PRESSURE_MIN 0 |
|
#define | ABP_PRESSURE_HIGH_BYTE_MASK 0x3f |
|
#define | ABP_TEMPERATURE_LOW_BYTE_SHIFT 5 |
|
#define | ABP_TEMPERATURE_MASK 0x7ff |
|
|
enum | ABP_STATUS { NORMAL_OPERATION = 0,
COMMAND_MODE,
STALE_DATA,
DIAGNOSTIC
} |
|
ABP Initialization function
- Parameters
-
- Returns
- device context pointer
ABP Close function
- Parameters
-
Function to get the compensated pressure. The datasheet provides a way to calculate the pressure. In order to know the units take a look at the datasheet.
- Parameters
-
- Returns
- float compensated pressure value
Function to retrieve the compensated temperature values. All ABP seem to calculate temperature in degree Celsius. (The above fact needs to be verified) NOTE: This functionality is not available in all the ABP sensors.
- Parameters
-
- Returns
- float compensated temperature value
Function to set the max pressure that the sensor can read, can be retrieved from the datasheet, if this function is not explicitly called to the set the max value, then a default max value of 5 will be set.
- Parameters
-
dev | abp_context pointer |
max | int maximum pressure value possible |
Function to set the min pressure that the sensor can read, can be retrieved from the datasheet, if this function is not explicitly called to the set the min value, then a default min value of 5 will be set.
- Parameters
-
dev | abp_context pointer |
min | int minimum pressure value possible |
This function has to be called before calling either of the get temperature or get pressure functions. This function updates the device context with the latest values. Not calling this function will lead to stale values.
- Parameters
-