Skip to content

Commit

Permalink
Update RadioDriver.md docs
Browse files Browse the repository at this point in the history
  • Loading branch information
terrillmoore committed Dec 22, 2019
1 parent 93539d9 commit 1dcfbfa
Showing 1 changed file with 43 additions and 5 deletions.
48 changes: 43 additions & 5 deletions doc/RadioDriver.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,23 @@
<!-- markdownlint-disable -->
<!-- TOC depthFrom:2 updateOnSave:true -->

- [Radio Driver Operation](#radio-driver-operation)
- [`os_radio(RADIO_RST)`](#os_radioradio_rst)
- [`os_radio(RADIO_TX)`](#os_radioradio_tx)
- [`os_radio(RADIO_RX)`](#os_radioradio_rx)
- [`os_radio(RADIO_RXON)`](#os_radioradio_rxon)
- [Common parameters](#common-parameters)
- [`LMIC.rps` (IN)](#lmicrps-in)
- [`LMIC.freq` (IN)](#lmicfreq-in)
- [`LMIC.saveIrqFlags` (OUT)](#lmicsaveirqflags-out)
- [`LMIC.osjob` (IN/OUT)](#lmicosjob-inout)
- [Transmit parameters](#transmit-parameters)
- [`LMIC.radio_txpow` (IN)](#lmicradio_txpow-in)
- [`LMIC.frame[]` (IN)](#lmicframe-in)
- [`LMIC.datalen` (IN)](#lmicdatalen-in)
- [`LMIC.txend` (OUT)](#lmictxend-out)
- [Receive parameters](#receive-parameters)
- [LMIC.frame[] (OUT)](#lmicframe-out)
- [`LMIC.frame[]` (OUT)](#lmicframe-out)
- [`LMIC.datalen` (OUT)](#lmicdatalen-out)
- [`LMIC.rxtime` (IN/OUT)](#lmicrxtime-inout)
- [`LMIC.lbt_ticks` (IN)](#lmiclbt_ticks-in)
Expand All @@ -37,6 +43,34 @@
<!-- markdownlint-restore -->
<!-- Due to a bug in Markdown TOC, the table is formatted incorrectly if tab indentation is set other than 4. Due to another bug, this comment must be *after* the TOC entry. -->

## Radio Driver Operation

The LMIC radio driver operates asynchronously. Operations are started by calling the `os_radio()` function with a parameter describing the operation to be performed.

Various parameters in the LMIC structure are as input to control the operation; others are updated to return results.

### `os_radio(RADIO_RST)`

The radio is reset, and put to sleep. This operation is synchronous.

### `os_radio(RADIO_TX)`

A frame is transmitted. The parameters are given in [common parameters](#common-parameters) and [transmit parameters](#transmit-parameters).

When the operation completes, `LMIC.osjob` is scheduled.

### `os_radio(RADIO_RX)`

A single frame is received ad the specified time, and the radio is put back to sleep if no frame is found.

When the operation completes, `LMIC.osjob` is scheduled.

### `os_radio(RADIO_RXON)`

The radio is placed in continuous receive mode. If a frame is received, `LMIC.osjob` is scheduled. Continuous receive is canceled by calling [`os_radio(RADIO_RST)`](#os_radioradio_rst).

This operation is not supported in FSK mode.

## Common parameters

### `LMIC.rps` (IN)
Expand All @@ -57,6 +91,10 @@ This specifies the frequency, in Hertz.

Updated for LoRa operations only; the IRQ flags at the time of interrupt.

### `LMIC.osjob` (IN/OUT)

When asynchronous operations complete, `LMIC.osjob.func` is used as the callback function, and `LMIC.osjob` is used to schedule the work.

## Transmit parameters

### `LMIC.radio_txpow` (IN)
Expand All @@ -77,9 +115,9 @@ The OS time at which the TX end interrupt was recognized.

## Receive parameters

### LMIC.frame[] (OUT)
### `LMIC.frame[]` (OUT)

Filled with data received..
Filled with data received.

### `LMIC.datalen` (OUT)

Expand All @@ -89,7 +127,7 @@ Set to number of bytes received in total.

Input: When to start receiving, in OS tick time.

Output: time of RXDONE interrupt. (FSK timeout doesn't currently set.)
Output: time of RXDONE interrupt. (Note: FSK timeout doesn't currently set this cell on RX timeout.)

### `LMIC.lbt_ticks` (IN)

Expand All @@ -101,7 +139,7 @@ Maximum RSSI on channel before transmit.

### `LMIC.rxsyms` (IN)

The timeout in symbols.
The timeout in symbols. Only used for `os_radio(RADIO_RX)`; not used for continuous receive.

### `LMIC.noRXIQinversion` (IN)

Expand Down

0 comments on commit 1dcfbfa

Please sign in to comment.