µracoli Arduino-Support-Package
Version foo
|
Description of the UASP functions. More...
Data Structures | |
struct | radio_buffer_t |
class | HardwareRadio |
struct radio_buffer_t |
Element of a chained list of frame buffers
Data Fields | ||
---|---|---|
uint8_t | frm[PHY_MAX_FRAME_SIZE] |
array that can store a maximum IEEE 802.15.4 frame |
uint8_t | idx |
read/write index |
uint8_t | len |
Length of payload |
struct radio_buffer * | next |
pointer to next list element or NULL if list terminates |
class HardwareRadio |
Hardware Radio class
Public Member Functions | |
radio_buffer_t * | alloc_buffer (void) |
void | free_buffer (radio_buffer_t *pbuf) |
HardwareRadio (void) | |
void | begin (void) |
void | begin (uint8_t channel, uint8_t idlestate) |
virtual int | available (void) |
virtual int | peek (void) |
virtual int | read (void) |
virtual void | flush (void) |
virtual size_t | write (uint8_t) |
void | write (char *str) |
void | write (uint8_t *buf, uint8_t size) |
HardwareRadio::HardwareRadio | ( | void | ) |
constructor
radio_buffer_t* HardwareRadio::alloc_buffer | ( | void | ) |
Allocate a radio buffer
|
virtual |
return number of available bytes in current RX buffer
void HardwareRadio::begin | ( | void | ) |
Starting the hardware radio class with default parameters
void HardwareRadio::begin | ( | uint8_t | channel, |
uint8_t | idlestate | ||
) |
Starting the hardware radio class with explicit parameters
channel | radio channel (11 - 26 for 2.4GHz radios, 0 - 10 for SubGHz radios) |
idlestate | default state of the radio, supported values are listed in radio_state_t. |
|
virtual |
flush TX and RX queues. RX queue data are discarded, TX data is sent.
void HardwareRadio::free_buffer | ( | radio_buffer_t * | pbuf | ) |
Free a radio buffer
|
virtual |
Returns the next byte (character) of incoming data (RX) without removing it from the internal serial buffer.
|
virtual |
Returns the next byte (character) of incoming data (RX)
|
virtual |
write a byte to the TX stream
void HardwareRadio::write | ( | char * | str | ) |
write a string to the TX stream
str | \0 terminated string |
void HardwareRadio::write | ( | uint8_t * | buf, |
uint8_t | size | ||
) |
write a binary buffer (buf, size) to the TX stream
buf | pointer to the buffer |
size | number of bytes in the buffer. |
#define PHY_DEFAULT_CHANNEL (17) |
Default radio channel number in 2.4 GHz band
#define PHY_MAX_CHANNEL (26) |
Maximun radio channel number in 2.4 GHz band
#define PHY_MAX_FRAME_SIZE (127) |
Maximum size of a IEEE 802.15.4 frame
#define PHY_MIN_CHANNEL (11) |
Minimun radio channel number in 2.4 GHz band