I2C_device_Arduino 1.2.0
An I²C utility class for Arduino
Loading...
Searching...
No Matches
test_LM75B Class Reference

#include <test_LM75B.h>

Inheritance diagram for test_LM75B:
I2C_device

Public Types

enum  mode { COMPARATOR , INTERRUPT }
enum  reg_num { Temp , Conf , Thyst , Tos }

Public Member Functions

 test_LM75B (const uint8_t i2c_address=(0x90 > > 1))
 test_LM75B (TwoWire &wire, const uint8_t i2c_address=(0x90 > > 1))
 ~test_LM75B ()
float read (void)
void thresholds (const float v0, const float v1)
void os_mode (const mode flag)
Public Member Functions inherited from I2C_device
 I2C_device (uint8_t i2c_address, bool repeated_start_enable=true)
 I2C_device (TwoWire &wire, uint8_t i2c_address, bool repeated_start_enable=true)
 ~I2C_device ()
void repeated_start_enable (bool en=true)
bool ping (void)
int tx (const uint8_t *data, uint16_t size, bool stop=true)
int rx (uint8_t *data, uint16_t size, bool stop=true)
virtual int reg_w (uint8_t reg_adr, const uint8_t *data, uint16_t size, bool stop=true)
virtual int reg_w (uint8_t reg_adr, uint8_t data, bool stop=true)
virtual int reg_r (uint8_t reg_adr, uint8_t *data, uint16_t size, bool stop=true)
virtual uint8_t reg_r (uint8_t reg_adr, bool stop=true)
void write_r8 (uint8_t reg, uint8_t val, bool stop=true)
void write_r16 (uint8_t reg, uint16_t val, bool stop=true)
uint8_t read_r8 (uint8_t reg, bool stop=true)
uint16_t read_r16 (uint8_t reg, bool stop=true)
void bit_op8 (uint8_t reg, uint8_t mask, uint8_t value)
void bit_op16 (uint8_t reg, uint16_t mask, uint16_t value)

Additional Inherited Members

Static Public Member Functions inherited from I2C_device
static bool ping (uint8_t addr)
static void scan (TwoWire &target_i2c=Wire, uint8_t stop=128)
Protected Member Functions inherited from I2C_device
void txrx (const uint8_t *w_data, uint8_t *r_data, uint16_t size)
Protected Attributes inherited from I2C_device
uint8_t i2c_addr
SPISettings spi_setting

Detailed Description

test_LM75B operation library for Arduino

Author
Tedd OKANO

Released under the MIT License

test_LM75B class

test class for I2C_device

About LM75B: https://www.nxp.jp/products/sensors/ic-digital-temperature-sensors/digital-temperature-sensor-and-thermal-watchdog:LM75B

Definition at line 27 of file test_LM75B.h.

Member Enumeration Documentation

◆ mode

Enumerator
COMPARATOR 

Comparator mode

INTERRUPT 

Interrupt mode

Definition at line 30 of file test_LM75B.h.

◆ reg_num

Name of the LM75B registers

Enumerator
Temp 

Temp register

Conf 

Conf register

Thyst 

Thyst register

Tos 

Tos register

Definition at line 36 of file test_LM75B.h.

Constructor & Destructor Documentation

◆ test_LM75B() [1/2]

test_LM75B::test_LM75B ( const uint8_t i2c_address = (0x90 >> 1))

Create a test_LM75B instance connected to specified I2C pins with specified address

Parameters
i2c_addressI2C-bus address (default: (0x90>>1))

Definition at line 5 of file test_LM75B.cpp.

◆ test_LM75B() [2/2]

test_LM75B::test_LM75B ( TwoWire & wire,
const uint8_t i2c_address = (0x90 >> 1) )

Create a test_LM75B instance connected to specified I2C pins with specified address

Parameters
wireTwoWire instance
i2c_addressI2C-bus address (default: (0x90>>1))

Definition at line 9 of file test_LM75B.cpp.

◆ ~test_LM75B()

test_LM75B::~test_LM75B ( )

Destructor of test_LM75B

Definition at line 13 of file test_LM75B.cpp.

Member Function Documentation

◆ os_mode()

void test_LM75B::os_mode ( const mode flag)

Set OS operation mode

Parameters
flaguse test_LM75B::COMPARATOR or test_LM75B::INTERRUPT values

Definition at line 31 of file test_LM75B.cpp.

◆ read()

float test_LM75B::read ( void )

Get temperature value in degree Celsius [°C]

Returns
temperature value in degree Celsius [°C]

Definition at line 17 of file test_LM75B.cpp.

◆ thresholds()

void test_LM75B::thresholds ( const float v0,
const float v1 )

Set Overtemperature shutdown threshold (Tos) and hysteresis (Thyst) in degree Celsius [°C]

This method takes 2 values and higher value will set as the threshold (Tos) and another will be the hysteresis (Thyst)

Parameters
v0a value in degree Celsius
v1a value in degree Celsius

Definition at line 22 of file test_LM75B.cpp.


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