sandeepmistry / arduino-LoRa

An Arduino library for sending and receiving data using LoRa radios.
MIT License
1.64k stars 627 forks source link

Some questions about the code #314

Open panosss opened 4 years ago

panosss commented 4 years ago

I 'm trying to understand the code and understand how from the datasheet of the SX1278 you ended up to this code, Most of the parts of your code can, relatively easily, be 'found' in the datasheet. But some parts, not. Like the Lora.print.

  1. Is it the 'LoRaClass::write'? And how using 'Lora.print()' we actually call the function 'Lora.write'?
  2. And how did you end up to this code? From transmit sequence in page 38 in the datasheet?
  3. this transmit sequence actually is 3 functions? -LoRaClass::beginPacket -LoRaClass::write -LoRaClass::endPacket

This is the transmit sequence in pseudo code:

TRANSMIT SEQUENCE

Mode request Stdby
Tx init
Write Data FIFO :LINE3
    LoRaTMTransmit Data FIFO Filling
    In order to write packet data into FIFO user should:
    1. Set FifoPtrAddr to FifoTxPtrBase.
    2. Write PayloadLength bytes to the FIFO (RegFifo)  (payload=ωφέλιμο φορτίο)
Mode Request TX
Wait for IRQ TxDone
Automatic Mode change STAND BY
if new TX
    goto LINE3
else
    New Mode request

From the 1st line you endend using this code:

// put in standby mode
  idle();

Ok, understandable.

But, next line? I mean the 'Tx init'. Which part of your code does this?