mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/driver-ms56xx.git
synced 2025-06-10 01:55:59 +00:00
updated for datenlogger needs
This commit is contained in:
parent
15d53829d7
commit
210f527973
@ -1,9 +1,9 @@
|
|||||||
#ifndef STA_SENSORS_MS5607_HPP
|
#ifndef STA_SENSORS_MS5607_HPP
|
||||||
#define STA_SENSORS_MS5607_HPP
|
#define STA_SENSORS_MS5607_HPP
|
||||||
|
|
||||||
#include<sta/spi/device.hpp>
|
#include<sta/devices/stm32/bus/spi.hpp>
|
||||||
#include<sta/endian.hpp>
|
#include<sta/endian.hpp>
|
||||||
#include<sta/stm32/delay.hpp>
|
#include<sta/devices/stm32/delay.hpp>
|
||||||
|
|
||||||
namespace sta {
|
namespace sta {
|
||||||
// Class to represent a MS5607 pressure sensor which is used with SPI
|
// Class to represent a MS5607 pressure sensor which is used with SPI
|
||||||
@ -18,7 +18,7 @@ namespace sta {
|
|||||||
_4096 = 4
|
_4096 = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
MS5607(SpiDevice* device, OsrLevel osr=OsrLevel::_1024);
|
MS5607(STM32SPIDevice* device, OsrLevel osr=OsrLevel::_1024);
|
||||||
|
|
||||||
// Request Calculation of uncompensated pressure
|
// Request Calculation of uncompensated pressure
|
||||||
// Takes a few ms -> Call, then do sth. else, then get Pressure with function
|
// Takes a few ms -> Call, then do sth. else, then get Pressure with function
|
||||||
@ -65,7 +65,7 @@ namespace sta {
|
|||||||
bool presRead;
|
bool presRead;
|
||||||
|
|
||||||
// STA internal object for SPi abstraction
|
// STA internal object for SPi abstraction
|
||||||
SpiDevice* device_;
|
STM32SPIDevice* device_;
|
||||||
OsrLevel osr_;
|
OsrLevel osr_;
|
||||||
|
|
||||||
// 6 Different constants; Includes Offsets, references etc.
|
// 6 Different constants; Includes Offsets, references etc.
|
||||||
@ -120,4 +120,4 @@ namespace sta {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // ifndef STA_SENSORS_MS5607_HPP
|
#endif // ifndef STA_SENSORS_MS5607_HPP
|
||||||
|
@ -4,7 +4,7 @@ namespace sta {
|
|||||||
// Forward declaration
|
// Forward declaration
|
||||||
uint16_t uint_8BufferTouint16_t(uint8_t* buffer);
|
uint16_t uint_8BufferTouint16_t(uint8_t* buffer);
|
||||||
|
|
||||||
MS5607::MS5607(SpiDevice* device, OsrLevel level) {
|
MS5607::MS5607(STM32SPIDevice* device, OsrLevel level) {
|
||||||
this->device_ = device;
|
this->device_ = device;
|
||||||
this->osr_ = level;
|
this->osr_ = level;
|
||||||
this->lastPresVal = -1;
|
this->lastPresVal = -1;
|
||||||
@ -161,7 +161,7 @@ namespace sta {
|
|||||||
this->device_->beginTransmission();
|
this->device_->beginTransmission();
|
||||||
this->device_->transfer(MS5607::Operations::RESET);
|
this->device_->transfer(MS5607::Operations::RESET);
|
||||||
this->device_->endTransmission();
|
this->device_->endTransmission();
|
||||||
delayUs(MS5607::RESET_DELAY);
|
delayMs(MS5607::RESET_DELAY*0.001);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read all constants from the PROM
|
// Read all constants from the PROM
|
||||||
@ -220,4 +220,4 @@ namespace sta {
|
|||||||
uint16_t uint_8BufferTouint16_t(uint8_t* buffer) {
|
uint16_t uint_8BufferTouint16_t(uint8_t* buffer) {
|
||||||
return (buffer[0] << 8) | buffer[1];
|
return (buffer[0] << 8) | buffer[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user