![]() |
roneos
Operating System for the r-one robot
|
Handles IR communication between robots using the ring of IR transmitters/receivers. More...
Go to the source code of this file.
Data Structures | |
struct | IRCommsMessage |
Message received over IR ring (contains the sending transmitter ID and receiving ID) More... | |
Typedefs | |
typedef struct IRCommsMessage | irCommsMessage |
Message received over IR ring (contains the sending transmitter ID and receiving ID) More... | |
Functions | |
void | irCommsSetSize (uint8 size) |
Sets the size, in bits, of the IR comms message. More... | |
void | irCommsSetXmitPower (uint16 power) |
Sets IR Comms xmit power. More... | |
boolean | irCommsSendMessage (irCommsMessage *irMessagePtr) |
Sends out a message through IR transmitters if RC mode isn't active. Message is 1-5 bytes of data, first byte is robot ID. More... | |
boolean | irCommsGetMessage (irCommsMessage *irMessagePtr) |
Gets a message through IR transmitters if RC mode not engaged. More... | |
void | irCommsOrientationBitMatrixPrint (uint8 *orientationBitsMatrixPtr, uint8 *rangeBitsMatrixPtr) |
Prints orientation bit matrix. More... | |
void | irCommsInit (void) |
Initializes IRComms. More... | |
Handles IR communication between robots using the ring of IR transmitters/receivers.
typedef struct IRCommsMessage irCommsMessage |
Message received over IR ring (contains the sending transmitter ID and receiving ID)
boolean irCommsGetMessage | ( | irCommsMessage * | irMessagePtr) |
Gets a message through IR transmitters if RC mode not engaged.
irMessagePtr | pointer to the irCommsMessage struct that contains receiver information |
void irCommsInit | ( | void | ) |
Initializes IRComms.
Creates the OS message queues. Initializes IR port for GPIO and set it as input. Sets PWM pins; computes and sets pwm period based on system clock. Enables PWM generators and output state. Enables a 1250hz (800us) interrupt.
void irCommsOrientationBitMatrixPrint | ( | uint8 * | orientationBitsMatrixPtr, |
uint8 * | rangeBitsMatrixPtr | ||
) |
Prints orientation bit matrix.
orientationBitsMatrixPtr | is the pointer to an orientation bit matrix |
rangeBitsMatrixPtr |
boolean irCommsSendMessage | ( | irCommsMessage * | irMessagePtr) |
Sends out a message through IR transmitters if RC mode isn't active. Message is 1-5 bytes of data, first byte is robot ID.
irMessagePtr | pointer to the irCommsMessage struct that contains the message to be sent |
void irCommsSetSize | ( | uint8 | size) |
Sets the size, in bits, of the IR comms message.
size | the size of the data portion of the ir message. |
void irCommsSetXmitPower | ( | uint16 | power) |
Sets IR Comms xmit power.
power | range from 0-256 changes duty cycle from 0-100% |