include/rc5.h File Reference

RC5 functions. More...

#include "../lib/rc5_common.h"

Go to the source code of this file.

Functions

uint8_t rc5_has_data_pwm (void *mask)
bool rc5_has_data (uint8_t mask)
int8_t rc5_recv_command (uint8_t dir, uint8_t source, uint8_t *command, uint16_t *data, uint8_t *real_source)
int8_t rc5_recv_command_timeout (uint8_t dir, uint8_t source, uint8_t *command, uint16_t *data, uint8_t *real_source, uint16_t ms)
int8_t rc5_recv_specific_command (uint8_t dir, uint8_t source, uint8_t command, uint16_t *data, uint8_t *real_source)
int8_t rc5_recv_specific_command_timeout (uint8_t dir, uint8_t source, uint8_t command, uint16_t *data, uint8_t *real_source, uint16_t ms)
int8_t rc5_recv_rc_command (uint8_t *rc_data)
void rc5_send_command (uint8_t dir, uint8_t dest, uint8_t command, uint16_t data)
void rc5_send_rc_command (uint8_t dir, uint8_t dev_address, uint8_t command)
void rc5_recv_clear_all (void)

Detailed Description

RC5 functions.

Definition in file rc5.h.


Function Documentation

bool rc5_has_data ( uint8_t  mask)

Check if rc5 data was received.

Parameters:
[in]maskdirections to check
Returns:
  • true data available
  • false no data available
void rc5_recv_clear_all ( void  )

Clear receive buffers

int8_t rc5_recv_command ( uint8_t  dir,
uint8_t  source,
uint8_t *  command,
uint16_t *  data,
uint8_t *  real_source 
)

Receive robot command.

Parameters:
[in]dirscan directions
[in]sourcedesired source robot id or ANY_SOURCE
[out]commandreceived command
[out]datareceived data
[out]real_sourcerobot id of the sender
Returns:
int8_t rc5_recv_command_timeout ( uint8_t  dir,
uint8_t  source,
uint8_t *  command,
uint16_t *  data,
uint8_t *  real_source,
uint16_t  ms 
)

Identical to rc5_recv_command() except with timeout

Parameters:
[in]mswait at most approximately ms milliseconds to receive otherwise timeout (0 for no timeout)
Returns:
  • < 0: error
  • >= 0: direction we received from. NODIR if timeout was reason for return
int8_t rc5_recv_rc_command ( uint8_t *  rc_data)

Receive remote control signal.

Parameters:
[out]rc_datacommand bits of the received rc5 code
Returns:
direction we received from

for more information see: RC5

int8_t rc5_recv_specific_command ( uint8_t  dir,
uint8_t  source,
uint8_t  command,
uint16_t *  data,
uint8_t *  real_source 
)

Receive specific robot command. Wait until the specified command was received.

Parameters:
[in]dirscan directions
[in]sourcedesired source robot id or ANY_SOURCE
[in]commanddesired command to receive
[out]datareceived data
[out]real_sourcerob id of the sender
Returns:
direction we received from
int8_t rc5_recv_specific_command_timeout ( uint8_t  dir,
uint8_t  source,
uint8_t  command,
uint16_t *  data,
uint8_t *  real_source,
uint16_t  ms 
)

Identical to rc5_recv_specific_command() except with timeout

Parameters:
[in]mswait at most approximately ms milliseconds to receive otherwise timeout (0 for no timeout)
Returns:
direction we received from. NODIR if timeout was reason for return
void rc5_send_command ( uint8_t  dir,
uint8_t  dest,
uint8_t  command,
uint16_t  data 
)

Send robot command to another robot.

Parameters:
[in]dirsend directions
[in]destdestination robot id or ANY_DEST
[in]commandcommand to send
[in]datadata to send
void rc5_send_rc_command ( uint8_t  dir,
uint8_t  dev_address,
uint8_t  command 
)

Send remote control signal (original RC5).

Parameters:
[in]dirsend directions
[in]rc5device address (between 0 and 31)
[in]rc5command (between 0 and 63)

for more information see: RC5