Modules | |
| Radio Interface | |
| Serial Interfaces | |
| Linux COM Functions | |
| Loopback Interface | |
| Generic COM Functions | |
| COM Helper Functions | |
Data Structures | |
| struct | comBuf_t |
| The standard comBuf data structure is designed to be used across multiple different communication devices. A comBuf contains an array of bytes, the number of bytes, and possibly some other fields, depending on the specific platform. More... | |
Available Interfaces | |
| Each of the following can be used with the com_send(), com_recv(), com_mode(), and com_ioctl() functions. | |
| #define | IFACE_SERIAL 0 |
| the UART0 serial interface. | |
| #define | IFACE_SERIAL2 1 |
| the UART1 serial interface. | |
| #define | IFACE_RADIO 2 |
| the CC2420 or CC1000 radio interface. | |
| #define | IFACE_LOOPBACK 3 |
| the loopback interface. | |
| #define | MAX_IFS 7 |
COM Error Messages | |
| These values can be returned from com layer functions when an error occurs. | |
| #define | SELECT_IFACE_BUSY 150 |
| The requested interface is busy. | |
| #define | IFACE_NOT_REGISTERED 160 |
| The requested interface does not exist. | |
COM Select | |
| com_select can be used to check if there is data available to be read from a specified interface. This function is similar to the berkley socket select() function. | |
| #define | IF_SET(iface, set) (*set |= 1 << iface) |
| Add the specified interface to the IF_SET pointed to by set. | |
| #define | IF_CLEAR(iface, set) (*set &= ~(1 << iface)) |
| Remove the specified interface from the IF_SET pointed to by set. | |
| #define | IF_ZERO(set) (*set = 0) |
| Remove all interfaces from the IF_SET pointed to by set. | |
| #define | IF_ISSET(iface, set) (*set & (1 << iface)) |
| Returns non-zero if the specified interface is set in the IF_SET pointed to by set. | |
| #define | COM_BLOCK -1 |
| pass to com_select() to block until an interface becomes readable | |
| #define | COM_NOBLOCK 0 |
| pass to com_select() to return immediately | |
| typedef uint8_t | IF_SET |
| represents a set of interfaces | |
| uint8_t | com_select (IF_SET *iset, uint32_t msec) |
| Check a set of interfaces for valid data. | |
COM Modes | |
| These values can be passed to the com_mode() function for each com interface. Note that not all interfaces support every mode. | |
| enum | { IF_OFF = 0, IF_STANDBY, IF_IDLE, IF_LISTEN } |
| The possible mode settings for interface devices. More... | |
Defines | |
| #define | PREAMBLE 0x53 |
| #define | PREAMBLE_SIZE 2 |
| #define | ELFPKT_BYTE0 65 |
| #define | ELFPKT_BYTE1 75 |
| #define | ELFPKT_BYTE2 85 |
| #define | ELFPKT_BYTE3 95 |
Typedefs | |
| typedef comBuf_t | comBuf |
| The standard comBuf data structure is designed to be used across multiple different communication devices. A comBuf contains an array of bytes, the number of bytes, and possibly some other fields, depending on the specific platform. | |
Functions | |
| void | cc2420_init (void) |
| uint16_t | cc2420_get_last_rssi () |
| get the RSSI value of the last received packet from the CC2420 Radio. | |
| void | cc2420_wait_for_osc (void) |
| void | cc2420_set_channel (uint8_t chan) |
| Changes the channel which the CC2420 transmits and receives on. | |
| uint8_t | com_init () |
| void | com_swap_bufs (uint8_t iface, comBuf *buf, comBuf **ret) |
| This is called by a driver when it has a full recv buffer. Also called by a driver to just get another buffer, in which case buf is null. | |
| char | is_elf_packet (comBuf *buf) |
Variables | |
| uint8_t | comBuf_t::data [COM_DATA_SIZE] |
| An array of bytes representing the contents of the comBuf. The maximum number of bytes that may be placed in a comBuf is represented by COM_DATA_SIZE. | |
| uint16_t | comBuf_t::signal |
| For a comBuf received from the radio driver, The RSSI value (signal strength indicator). This member is only available of GET_RSSI has been defined in com.h. | |
| uint8_t | comBuf_t::size |
| The number of data bytes located in the data array of this comBuf. | |
| uint16_t | comBuf_t::source |
| mos_mutex_t | if_send_mutexes [MAX_IFS] |
|
|
For internal use only. used for ELF propogation |
|
|
For internal use only. used for ELF propogation |
|
|
For internal use only. used for ELF propogation |
|
|
For internal use only. used for ELF propogation |
|
|
For internal use only. The maximum number of interfaces. |
|
|
Definition at line 310 of file com.h. 00310 { 00312 IF_OFF = 0, 00314 IF_STANDBY, 00316 IF_IDLE, 00318 IF_LISTEN, 00319 #ifdef RADIO_USE_FEC 00320 00321 IF_FEC_ENABLE, 00323 IF_FEC_DISABLE 00324 #endif 00325 };
|
|
|
|
|
|
For internal use only. Initialization routine for CC2420 |
|
|
|
|
|
For internal use only. wait for the oscillator. |
|
|
For internal use only. Init com layer. Must be called before any ifaces try to register.
|
|
||||||||||||
|
|
|
||||||||||||||||
|
For internal use only. Swaps full receive buffer with a fresh buffer. Drivers must register before they call swap_bufs!
|
|
|
For internal use only. used for ELF propogation |
|
|
For internal use only. Used by the com layer to synchronize access to devices when transmiting data. |
1.4.6