1. Three layer model: |---+-------------------+--------------------------------------------------------------+---------------| | 3 | Application layer | Application requiring full-duplex transmission of data. | | |---+-------------------+--------------------------------------------------------------+---------------| | 2 | Transport layer | This part of software. | Comm.c | |---+-------------------+--------------------------------------------------------------+---------------| | 1 | Physical layer | Physical layer is made up by two half-duplex RF transceivers | RF.c RF_CFG.h | | | | able to synchronize transfer of single bytes. | | |---+-------------------+--------------------------------------------------------------+---------------| Frame - Data send in physical layer with clock/data synchronization Packet - Data send in transport layer with size/crc data Message - data send on application layer 2. It's supposed to be simple, yet powerful enough to accomplish most of the transmission issues. Most notably we are short on RAM: No big buffers, no seq numbers+retransmission of a given packet. Most of the configuration is done in a compile-time (Like: which is master, which is slave, what type of transmission is going to happen) Side initializing connection is "Client" or "Master". Second side is "Server/Slave". 3. We're going to send small packets of data - yet big enough to hold any information we would like to send at once. We'd rather omit splitting data and then consolidating it back again. 4. Three kinds of transmission: - Simple (Burst) - packets are dropped on error. We keep TX or RX mode unless instructed to change it. Therefore transmission is clearly half-duplex. Higher layers of software must control it, usually some master/slave approach is required. - Interleaved - packets are dropped on error. After a client sends a packet both sides swap RX/TX modes and server sends an reply ACK/NACK packet with possibly some data. ACK means that the previous packet was send successfully, whereas NACK informs about CRC error. Packets aren't resend. - Streamed - Similar to Mixed but packets are resend on error by RF driver. 5. Frame (physical layer) consists of clock synchronization bytes, transmission synchronization bytes and our packet: [Clock synch][Transmission synch][Packet] 6. Packet layout is constant: [Lenght][Type][Message][CRC] [Lenght] - Configurable; usually 1 byte containing message size [Type] - 1 byte containing bits: XYWZ RSNA A = 1 - ACK N = 1 - NACK S = 1 - Transmission reset (SYN) R - Reserved AN = 00 - Normal data packet AN = 11 - Illegal (Maybe = reset) XYWZ are currently used for making sure we are receiving correct frame (used for early receiver reset) Might contain high nibble of lenght field. [Body] - Packet content [CRC] - 2 bytes: CRC16 of Type:Length and Body field [EOF] - 0xAA 7. Will be completely interrupt driven (two interrupts - RFM one, and SPI second) 8. As fast as possible