Skip to content
Snippets Groups Projects
Commit d9ae2242 authored by Daniel Joseph Antrim's avatar Daniel Joseph Antrim
Browse files

rename enum from RegisterAddress simply to Address

parent ad87a4a3
Branches
Tags
6 merge requests!308Bring main and devel back in sync,!300playing with fixing divergence between devel and main,!287Updates for Julabo Chiller,!285Julabo Chiller Added with Fixed Pipeline Compatibility,!269Merge devel into main: largest change is code formatting checker and enforcement in CI,!225Add support for 4-channel 12-bit ADC ADS1015
Pipeline #2547483 passed
......@@ -74,12 +74,11 @@ int32_t ADS1015::readCount(uint8_t channel) {
setStartConversion(config);
// configure the ADC for single shot conversion on the specified channel
m_com->write_reg16(static_cast<uint16_t>(RegisterAddress::POINTER_CONFIG),
config);
m_com->write_reg16(static_cast<uint16_t>(Address::POINTER_CONFIG), config);
std::this_thread::sleep_for(std::chrono::microseconds(1000));
uint16_t result = m_com->read_reg16(
static_cast<uint16_t>(RegisterAddress::POINTER_CONVERT));
uint16_t result =
m_com->read_reg16(static_cast<uint16_t>(Address::POINTER_CONVERT));
result = result >> 4;
return static_cast<int32_t>(result);
......
......@@ -26,7 +26,7 @@ class ADS1015 : public ADCDevice {
private:
const std::vector<uint8_t> allowedAddresses{0x48, 0x49, 0x4A, 0x4B};
enum class RegisterAddress : uint16_t {
enum class Address : uint16_t {
POINTER_CONVERT = 0x00,
POINTER_CONFIG = 0x01,
POINTER_LOWTHRESH = 0x02,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment