peary/hardware/components/TMP101.hpp

TMP101 Component Class. More…

Namespaces

Name
peary
peary::component

Classes

Name
class peary::component::TMP101 TMP101 Temperature Sensor Component.

Detailed Description

TMP101 Component Class.

Copyright: Copyright (c) 2016-2025 CERN and the Peary Caribou authors. This software is distributed under the terms of the LGPL-3.0-only License, copied verbatim in the file “LICENSE.md”. SPDX-License-Identifier: LGPL-3.0-only

Source code

  
#pragma once

#include <cstdint>
#include <string>

#include "peary/hal/Components.hpp"
#include "peary/interfaces/I2C/i2c.hpp"

namespace peary::component {

    class TMP101 : public hal::Component {
    public:
        // Register addresses
        enum class Register { //
            TEMPERATURE = 0x00,
            CONFIGURATION = 0x01,
            TLOW = 0x02,
            THIGH = 0x03
        };

        TMP101(const std::string& i2c_bus, uint8_t device_address);

        double readTemperature();

    private:
        std::string _bus;
        uint8_t _address;
    };
} // namespace peary::component
  

Updated on 2025-11-14 at 11:31:23 +0100