Erriez Oregon THN128 433MHz temperature sensor library for Arduino  1.1.0
This is an Oregon THN128 433MHz temperature sensor transmit/receive library for Arduino.
Macros | Functions
ErriezOregonTHN128.c File Reference

Oregon THN128 433MHz temperature transmit/receive library for Arduino. More...

#include <string.h>
#include <stdio.h>
#include "ErriezOregonTHN128.h"
Include dependency graph for ErriezOregonTHN128.c:

Go to the source code of this file.

Macros

#define SET_ROL_ADDR(x)   (((x) & 0x07) << 0)
 
#define GET_ROL_ADDR(x)   (((x) & 0x07) << 0)
 
#define SET_CHANNEL(x)   ((((x) - 1) & 0x03) << 6)
 
#define GET_CHANNEL(x)   ((((x) >> 6) & 0x03) + 1)
 
#define SET_TEMP(x)
 
#define GET_TEMP(x)
 
#define SIGN_BIT   (1UL << 21)
 
#define LOW_BAT_BIT   (1UL << 23)
 
#define SET_CRC(x)   ((uint32_t)(x) << 24)
 
#define GET_CRC(x)   ((x) >> 24)
 

Functions

bool OregonTHN128_CheckCRC (uint32_t rawData)
 Verify checksum. More...
 
void OregonTHN128_TempToString (char *temperatureStr, uint8_t temperatureStrLen, int16_t temperature)
 Convert temperature to string. More...
 
uint32_t OregonTHN128_DataToRaw (OregonTHN128Data_t *data)
 Convert data structure to 32-bit raw data. More...
 
bool OregonTHN128_RawToData (uint32_t rawData, OregonTHN128Data_t *data)
 Cnonvert 32-bit raw data to OregonTHN128Data_t structure. More...
 

Detailed Description

Oregon THN128 433MHz temperature transmit/receive library for Arduino.

Source: https://github.com/Erriez/ErriezOregonTHN128 Documentation: https://erriez.github.io/ErriezOregonTHN128

Definition in file ErriezOregonTHN128.c.

Function Documentation

◆ OregonTHN128_CheckCRC()

bool OregonTHN128_CheckCRC ( uint32_t  rawData)

Verify checksum.

Parameters
rawData32-bit raw data input
Returns
true: Success, false: error

Definition at line 101 of file ErriezOregonTHN128.c.

◆ OregonTHN128_DataToRaw()

uint32_t OregonTHN128_DataToRaw ( OregonTHN128Data_t data)

Convert data structure to 32-bit raw data.

Parameters
dataInput
Returns
Output

Definition at line 141 of file ErriezOregonTHN128.c.

◆ OregonTHN128_RawToData()

bool OregonTHN128_RawToData ( uint32_t  rawData,
OregonTHN128Data_t data 
)

Cnonvert 32-bit raw data to OregonTHN128Data_t structure.

Parameters
rawData32-bit input
dataoutput
Returns
CRC true: Success, false: error

Definition at line 180 of file ErriezOregonTHN128.c.

◆ OregonTHN128_TempToString()

void OregonTHN128_TempToString ( char *  temperatureStr,
uint8_t  temperatureStrLen,
int16_t  temperature 
)

Convert temperature to string.

Parameters
temperatureStrCharacter buffer
temperatureStrLenSize of character buffer
temperatureInput temperature

Definition at line 118 of file ErriezOregonTHN128.c.