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
data macro's

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)
 

Detailed Description

Macro Definition Documentation

◆ GET_CHANNEL

#define GET_CHANNEL (   x)    ((((x) >> 6) & 0x03) + 1)

Get channel

Definition at line 49 of file ErriezOregonTHN128.c.

◆ GET_CRC

#define GET_CRC (   x)    ((x) >> 24)

Get CRC

Definition at line 69 of file ErriezOregonTHN128.c.

◆ GET_ROL_ADDR

#define GET_ROL_ADDR (   x)    (((x) & 0x07) << 0)

Get rolling address

Definition at line 44 of file ErriezOregonTHN128.c.

◆ GET_TEMP

#define GET_TEMP (   x)
Value:
(((((x) >> 16) & 0x0f) * 100) + \
((((x) >> 12) & 0x0f) * 10) + \
(((x) >> 8) & 0x0f))

Get temperature

Definition at line 56 of file ErriezOregonTHN128.c.

◆ LOW_BAT_BIT

#define LOW_BAT_BIT   (1UL << 23)

Low battery bit

Definition at line 64 of file ErriezOregonTHN128.c.

◆ SET_CHANNEL

#define SET_CHANNEL (   x)    ((((x) - 1) & 0x03) << 6)

Set channel

Definition at line 47 of file ErriezOregonTHN128.c.

◆ SET_CRC

#define SET_CRC (   x)    ((uint32_t)(x) << 24)

Set CRC

Definition at line 67 of file ErriezOregonTHN128.c.

◆ SET_ROL_ADDR

#define SET_ROL_ADDR (   x)    (((x) & 0x07) << 0)

Set rolling address

Definition at line 42 of file ErriezOregonTHN128.c.

◆ SET_TEMP

#define SET_TEMP (   x)
Value:
((((((uint32_t)(x) / 100) % 10)) << 16) | \
((((uint32_t)(x) / 10) % 10) << 12) | \
(((x) % 10) << 8))

Set temperature

Definition at line 52 of file ErriezOregonTHN128.c.

◆ SIGN_BIT

#define SIGN_BIT   (1UL << 21)

Sign bit

Definition at line 61 of file ErriezOregonTHN128.c.