libpruw1  0.4
One wire (W1) driver for Beaglebone hardware based on libpruio
pruw1.h
Go to the documentation of this file.
1 
18 #ifdef __cplusplus
19  extern "C" {
20 #endif /* __cplusplus */
21 
22 typedef unsigned char UInt8;
23 typedef short Int16;
24 typedef int Int32;
25 typedef unsigned int UInt32;
26 typedef unsigned long long int UInt64;
27 
29 typedef struct pruw1 pruw1;
30 
31 
46 Int16 T_FAM10(UInt8* Rom);
47 
48 
63 Int16 T_FAM20(UInt8* Rom);
64 
73 enum LineModus{
74  PRUW1_PARPOW = 0x1
75  ,PRUW1_PULLUP = 0x2
76 };
77 
78 
85 typedef struct pruw1{
86  char *Errr;
87  UInt32
88  Mask,
92  *DRam,
93  *Raw;
94 
96  UInt8 crc8_table[255 + 1];
97  UInt8 Slots[32];
98 }pruw1;
99 
138 pruw1* pruw1_new(pruIo *P, UInt8 B, UInt8 M);
139 
146 
167 char *pruw1_scanBus(pruw1* W1, UInt8 SearchType);
168 #define pruw1_scanBus(W1) pruw1_scanBus(W1, 0xF0)
169 
170 
181 
182 
192 void pruw1_sendRom(pruw1* W1, UInt64 V);
193 
194 
212 
213 
224 
225 
237 
238 
252 
253 
266 
282 
283 
293 
294 
303 
304 
313 UInt64 pruw1_getId(pruw1 *W1, UInt32 N);
314 
315 
316 #ifdef __cplusplus
317  }
318 #endif /* __cplusplus */
LineModus
Masks for line idle configuration.
Definition: pruw1.bi:28
UInt8 pruw1_resetBus(pruw1 *W1)
Send the reset signal to the bus.
UInt8 pruw1_getIn(pruw1 *W1)
Get the state of the data line.
short Int16
16 bit signed integer data type.
Definition: pruw1.h:23
Int32 pruw1_getSlotMax(pruw1 *W1)
Property to get size of array PruW1::Slots from C.
pruw1 * pruw1_new(pruIo *P, UInt8 B, UInt8 M)
Wrapper function for the constructor PruW1::PruW1().
void pruw1_eraseSlots(pruw1 *W1)
Function to empty the array PruW1::Slots from C.
unsigned int UInt32
32 bit unsigned integer data type.
Definition: pruw1.h:25
UInt8 pruw1_checkPara(pruw1 *W1)
Check line for parasite powered device.
struct pruw1 pruw1
forward declaration
Definition: pruw1.h:29
Int16 T_FAM10(UInt8 *Rom)
Compute the temperature for a series 10 sensor (old format).
unsigned char UInt8
8 bit unsigned integer data type.
Definition: pruw1.h:22
void pruw1_sendByte(pruw1 *W1, UInt8 V)
Send a byte (eight bits) to the bus.
Int16 T_FAM20(UInt8 *Rom)
Compute the temperature for a series 20 sensor (new format).
unsigned long long int UInt64
64 bit unsigned integer data type.
Definition: pruw1.h:26
UInt8 pruw1_recvBlock(pruw1 *W1, UInt8 N)
Receive a block of data (usually 9 bytes).
char * pruw1_scanBus(pruw1 *W1, UInt8 SearchType)
Function to scan the bus for all devices.
UInt8 pruw1_calcCrc(pruw1 *W1, UInt8 N)
Compute the CRC checksum for data package.
@ PRUW1_PARPOW
Set line output high during idle.
Definition: pruw1.h:74
@ PRUW1_PULLUP
Activate the internal pull up resistor.
Definition: pruw1.h:75
int Int32
32 bit signed integer data type.
Definition: pruw1.h:24
UInt8 pruw1_recvByte(pruw1 *W1)
Receive a single byte (8 bit).
UInt64 pruw1_getId(pruw1 *W1, UInt32 N)
Function to get ID from array PruW1::Slots from C.
void pruw1_destroy(pruw1 *W1)
Wrapper function for the destructor PruW1::~PruW1().
void pruw1_sendRom(pruw1 *W1, UInt64 V)
Send a ROM ID to the bus (to select a device).
The PruW1 C wrapper structure.
Definition: pruw1.h:85
char * Errr
The variable to report error messages.
Definition: pruw1.h:86
UInt32 * Raw
A pointer to the libpruio raw GPIO data.
Definition: pruw1.h:93
UInt32 Mask
The mask to select the pin in use.
Definition: pruw1.h:88
UInt32 * DRam
A pointer to the libpruw1 DRam.
Definition: pruw1.h:92
UInt8 crc8_table[255+1]
A pre-computed table for fast CRC checksum computation.
Definition: pruw1.h:96
UInt32 PruIRam
The PRU instruction ram to use.
Definition: pruw1.h:90
UInt32 PruNo
The number of the PRU to use.
Definition: pruw1.h:89
UInt32 PruLMod
The line modus to use (parasite power).
Definition: pruw1.h:91
UInt8 Slots[32]
Meta-data for FB array to store the device IDs.
Definition: pruw1.h:97