satnogs-rotator-firmware
Loading...
Searching...
No Matches
tc74 Class Reference

Class that functions for interacting with a TC74 Temperature sensor. More...

#include <tc74.h>

Public Member Functions

 tc74 (uint8_t id)
 
void init ()
 Initialize the I2C bus.
 
int8_t get_temp ()
 Reads the int8_t in temperature measurement register.
 
int8_t get_status ()
 Reads the int8_t in status register.
 
int8_t wake_up ()
 Wake up request to the sensor on the specified address.
 
int8_t sleep ()
 Sleep device request to the sensor on the specified address.
 

Private Attributes

int _id
 

Detailed Description

Class that functions for interacting with a TC74 Temperature sensor.

Parameters
idSet the ID of temperature sensor, I2C address TC74_A0 0b10010000 TC74_A1 0b10010010 TC74_A2 0b10010100 TC74_A3 0b10010110 TC74_A4 0b10011000 TC74_A5 0b10011010 TC74_A6 0b10011100 TC74_A7 0b10011110

Definition at line 37 of file tc74.h.

Constructor & Destructor Documentation

◆ tc74()

tc74::tc74 ( uint8_t id)
inline

Definition at line 40 of file tc74.h.

References _id.

Member Function Documentation

◆ get_status()

int8_t tc74::get_status ( )
inline

Reads the int8_t in status register.

Returns
The status register int8_t

Definition at line 76 of file tc74.h.

References _id, TC74_AWAKE_COMMAND, and TC74_CONFIGURATION_REGISTER.

Referenced by sleep(), and wake_up().

◆ get_temp()

int8_t tc74::get_temp ( )
inline

Reads the int8_t in temperature measurement register.

Returns
The temperature int8_t

Definition at line 60 of file tc74.h.

References _id, and TC74_TEMPERATURE_REGISTER.

Referenced by loop().

◆ init()

void tc74::init ( )
inline

Initialize the I2C bus.

Definition at line 49 of file tc74.h.

References I2C_FREQ.

◆ sleep()

int8_t tc74::sleep ( )
inline

Sleep device request to the sensor on the specified address.

Returns
The status register int8_t

Definition at line 111 of file tc74.h.

References _id, get_status(), TC74_CONFIGURATION_REGISTER, and TC74_STANDBY_COMMAND.

Referenced by loop().

Here is the call graph for this function:

◆ wake_up()

int8_t tc74::wake_up ( )
inline

Wake up request to the sensor on the specified address.

Returns
The status register int8_t

Definition at line 95 of file tc74.h.

References _id, get_status(), TC74_AWAKE_COMMAND, and TC74_CONFIGURATION_REGISTER.

Referenced by loop().

Here is the call graph for this function:

Member Data Documentation

◆ _id

int tc74::_id
private

Definition at line 122 of file tc74.h.

Referenced by get_status(), get_temp(), sleep(), tc74(), and wake_up().


The documentation for this class was generated from the following file: