upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
Description for the RSC TruStability line. More...
The RSC Series is a piezoresistive silicon pressure sensor offering a digital output for reading pressure over the specified full scale pressure span and temperature range. It is calibrated and temperature compensated for sensor offset, sensitivity, temperature effects, and non-linearity using a 24-bit analog-todigital converter with integrated EEPROM. Pressure data may be acquired at rates between 20 and 2000 samples per second over an SPI interface. It is intended for use with non-corrosive, non-ionic gases, such as air and other dry gases, designed and manufactured according to ISO 9001 standards, and is REACH and RoHS compliant.
Most of the functionality available on this chip has been implemented. The driver calculates the compensated pressure and temperature values based on the information provided in the datasheet. The user must not mess around with the coefficient and adc init value readings from the EEPROM as these are used to calculate the compensated pressure and temperature values.
In order to get the sensor to work properly on an Edison, you would need to turn off the Edison SPI power management, this can be done with the command: echo on > /sys/devices/pci0000\:00/0000\:00\:07.1/power/control
You might have to use external pull up resistors on all the lines. More info about this has been provided in the datasheet with a table and a diagram.
Public Member Functions | |
RSC (uint8_t bus, uint8_t cs_ee_pin, uint8_t cs_adc_pin) | |
Default constructor for rsc. More... | |
~RSC () | |
std::string | getSensorName () |
std::string | getSensorSerialNumber () |
float | getPressureRange () |
float | getMinimumPressure () |
std::string | getPressureUnit () |
std::string | getPressureType () |
uint8_t * | getInitialADCState () |
void | updateCoefficients () |
void | setupADC (uint8_t *adc_init_values) |
float | getTemperature () |
float | getPressure () |
void | setMode (RSC_MODE mode) |
void | setDataRate (RSC_DATA_RATE dr) |
RSC | ( | uint8_t | bus, |
uint8_t | cs_ee_pin, | ||
uint8_t | cs_adc_pin | ||
) |
This device supports SPI. The sensor has two chip select pins since there are two ways to access content on the sensor - EEPROM/ADC. We will not be using the SPI CS here because that would work for all SPI operations. Hence, you are expected to initialize any 2 gpio pins for CS by providing the pin numbers.
bus | SPI bus to use. |
cs_ee_pin | The CS pin for accessing the EEPROM |
cs_adc_pin | The CS pin for accessing the ADC |
~RSC | ( | ) |
rsc destructor
string getSensorName | ( | ) |
This function provides the sensor name as a string to the user.
string getSensorSerialNumber | ( | ) |
This function provides the sensor serial number as a string to the user.
float getPressureRange | ( | ) |
This function provides the pressure range which the sensor can read out. This will vary for the different kinds of RSC sensors. This value is read from the EEPROM
float getMinimumPressure | ( | ) |
This function provides the minimum pressure which the sensor can read out. This will vary for the different kinds of RSC sensors. This value is read from the EEPROM
string getPressureUnit | ( | ) |
This function gets the units that the particular RSC sensor being used reads out the pressure data in. Following are the possible units data can be read out in:
This info can be retrieved from the EEPROM
string getPressureType | ( | ) |
Function returns the type of RSC pressure sensor being used. This info is available in the EEPROM. Types:
uint8_t * getInitialADCState | ( | ) |
Function returns the initial state that the ADC registers need to be set to. This info is retrieved from the EEPROM.
void updateCoefficients | ( | ) |
Function used to update the coefficients. This function doesn't return the coefficent values. Intstead, it updates the 2-D array with the coefficient values read from the EEPROM. This function is mostly for internal use only.
void setupADC | ( | uint8_t * | adc_init_values | ) |
Function used to set up the ADC with the initial values of the ADC registers read from the EEPROM.
adc_init_values | pointer to uint8_t array containing the initial ADC values |
float getTemperature | ( | void | ) |
Function to get the compensated temperature value.
float getPressure | ( | ) |
Function to get the compensated pressure value
void setMode | ( | RSC_MODE | mode | ) |
Function to set the mode for the RSC sensor: There are 2 types of modes available:
void setDataRate | ( | RSC_DATA_RATE | dr | ) |
Function to set the data rate for the RSC sensor: Following are the different data rates available:
In Normal Mode
In Fast Mode
SPS - Samples per Second