The function bodies for the PruW1 class, tools for decoding. More...
#include "w1_prucode.bi"
#include "pruw1.hp"
#include "BBB/pruio_prussdrv.bi"
#include "BBB/pruio_intc.bi"
#include "pruw1.bi"
Go to the source code of this file.
Macros | |
#define | PRUCALL(_C_, _V_, _T_) |
Macro to call a function on the PRU, monitoring features disabled. More... | |
#define | PRUCALL(_C_, _V_, _T_) |
Macro to call a function on the PRU, monitoring features disabled. More... | |
Functions | |
FUNCTION_AS_SHORT | T_fam10 (BYVAL_AS_UBYTE_PTR Rom) |
Compute the temperature for a series 10 sensor (old format). More... | |
FUNCTION_AS_SHORT | T_fam20 (BYVAL_AS_UBYTE_PTR Rom) |
Compute the temperature for a series 20 sensor (new format). More... | |
The function bodies for the PruW1 class, tools for decoding.
This file contains the function bodies for the PruW1 class and some functions to decode the temperature from the received data.
Definition in file pruw1.bas.
#define PRUCALL | ( | _C_, | |
_V_, | |||
_T_ | |||
) |
Macro to call a function on the PRU, monitoring features disabled.
Macro to call a function on the PRU, monitoring features enabled.
#define PRUCALL | ( | _C_, | |
_V_, | |||
_T_ | |||
) |
Macro to call a function on the PRU, monitoring features disabled.
Macro to call a function on the PRU, monitoring features enabled.
FUNCTION_AS_SHORT T_fam10 | ( | BYVAL_AS_UBYTE_PTR | Rom | ) |
Compute the temperature for a series 10 sensor (old format).
Rom | The pointer where to find the data received from the device. |
This function decodes the temperature value from a DS18S20 sensor (such sensors have &h10
in the lowest byte of their ID). The returned value contains the temperature in grad Celsius in the high byte and the decimal places in the low byte. Divide the value by 256 to get a real number containing the temperatur in grad Celsius.
Parameter Rom
is usually the adress of PruW1::DRam[4].
FUNCTION_AS_SHORT T_fam20 | ( | BYVAL_AS_UBYTE_PTR | Rom | ) |
Compute the temperature for a series 20 sensor (new format).
Rom | The pointer where to find the data received from the device. |
This function decodes the temperature value from a newer Dallas sensor (the lowest byte in the ID of such sensors is either &h20
, &h22
, &h28
, &h3B
or &h42
). The returned value contains the temperature in grad Celsius in the high byte and the decimal places in the low byte. Divide the value by 256 to get a real number containing the temperatur in grad Celsius.
Parameter Rom
is usually the adress of PruW1::DRam[4].