83 if(HAL_OK == HAL_I2C_Mem_Read(self->
hi2c, self->
I2C_ADDR << 1, MemAddress, I2C_MEMADD_SIZE_8BIT, self->
reg16.
raw_data, 2, 100)){
172 int8_t n_adjust = (int8_t)(300 - (302.4/self->
n_eff1));
180 n_adjust = (int8_t)(300 - (302.4/self->
n_eff2));
188 n_adjust = (int8_t)(300 - (302.4/self->
n_eff3));
218 if(channel_number > (self->
type + 1))
return -999;
245 if(channel_number > (self->
type + 1))
return -128;
TMP42x_Status __TMP42x_readByte(TMP42x *self, uint8_t MemAddress)
Read a byte of data from TMP42x and stores in the tmp42x::_reg8::raw_data.
uint8_t TMP42x_getManID(TMP42x *self)
Get the manufacturer ID.
uint8_t TMP42x_getDevID(TMP42x *self)
Get the device ID.
double TMP42x_getLocalTemp(TMP42x *self)
Reads the full (floating-point) local temperature from a specified channel.
TMP42x_Status __TMP42x_readTwoBytes(TMP42x *self, uint8_t MemAddress)
Read two bytes of data from TMP42x and stores in the tmp42x::_reg16::raw_data.
TMP42x_Status TMP42x_oneShotStart(TMP42x *self)
Starts a single conversion if the device is in shutdown mode.
int8_t TMP42x_getRemoteTemp_Int(TMP42x *self, uint8_t channel_number)
Reads the integer part of the remote temperature from a specified channel.
TMP42x_Status TMP42x_softwareReset(TMP42x *self)
Resets the device.
TMP42x_Status TMP42x_init(TMP42x *self, TMP42x_Type type, I2C_HandleTypeDef *hi2c, uint8_t I2C_ADDR, TMP42x_Shutdown shutdown, TMP42x_Range range, TMP42x_ConversionRate conversion_rate, float n_eff1, float n_eff2, float n_eff3)
Initialize the TMP42x with the given config.
double TMP42x_getRemoteTemp(TMP42x *self, uint8_t channel_number)
Reads the full (floating-point) remote temperature from a specified channel.
int8_t TMP42x_getLocalTemp_Int(TMP42x *self)
Reads the integer part of the local temperature.
TMP42x_Status __TMP42x_writeByte(TMP42x *self, uint8_t MemAddress)
Write a byte of data to TMP42x from the tmp42x::_reg8::raw_data.
#define nCORRECTION2_REGISTER
#define ONE_SHOT_START_REGISTER
#define CONVERSION_RATE_REGISTER
#define DEVICE_ID_REGISTER
struct tmp42x TMP42x
Class (struct) that stores variables for interacting with TMP42x.
#define nCORRECTION3_REGISTER
#define SOFTWARE_RESET_REGISTER
#define nCORRECTION1_REGISTER
TMP42x_ConversionRate conversion_rate
union tmp42x::_reg16 reg16
struct tmp42x::_reg16::_temp_register temp_register
struct tmp42x::_reg8::_n_correction_register n_correction_register
struct tmp42x::_reg8::_man_id_register man_id_register
struct tmp42x::_reg8::_dev_id_register dev_id_register
struct tmp42x::_reg8::_conversion_rate_register conversion_rate_register
struct tmp42x::_reg8::_config2_register _config2_register
struct tmp42x::_reg8::_config1_register config1_register