brickOS Kernel Developer v0.9.0
lnp-logical.h File Reference

LNP Interface: link networking protocol logical layer. More...

#include <config.h>
#include <mem.h>
#include <sys/h8.h>
Include dependency graph for lnp-logical.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void lnp_logical_range (int far)
 Set the IR transmitter range.
 
int lnp_logical_range_is_far (void)
 Test the IR transmitter range setting.
 
int lnp_logical_write (const void *buf, size_t len)
 Write buffer to IR port.
 
void lnp_logical_fflush (void)
 Empty the IR receive buffer.
 

Detailed Description

LNP Interface: link networking protocol logical layer.

Author
Markus L. Noga marku.nosp@m.s@no.nosp@m.ga.de

Definition in file lnp-logical.h.

Function Documentation

◆ lnp_logical_fflush()

void lnp_logical_fflush ( void  )
extern

Empty the IR receive buffer.

Returns
Nothing

◆ lnp_logical_range()

void lnp_logical_range ( int  far)
externinline

Set the IR transmitter range.

Configure the INFRARED transmitter power

Parameters
far0: sets short range, 1: sets long range
Returns
Nothing

NOTE1: this setting remains in effect until changed or the RCX power is turned off.

NOTE2: toggles port 4 bit 0

Todo:
determine what clears this and then correct NOTE1

Definition at line 62 of file lnp-logical.h.

References PORT4.

◆ lnp_logical_range_is_far()

int lnp_logical_range_is_far ( void  )
externinline

Test the IR transmitter range setting.

Determine if the INFRARED transmitter power is set to long range

Returns
T/F where TRUE means transmitter is set to long range

Definition at line 73 of file lnp-logical.h.

References PORT4.

◆ lnp_logical_write()

int lnp_logical_write ( const void *  buf,
size_t  len 
)
extern

Write buffer to IR port.

Write {len} chars (starting at {buf}) to IR port.

Parameters
bufpointer to array of chars to be written
lennumber of chars in array (to be written)
Returns
0 if OK, else collision

NOTE: doesn't return until all are written (blocking write)