| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
| |
This was used with the 8051 bit-addressing mode to provide
single-instruction access to GPIO pins.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Don't use a global variable to hold the result.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Don't try to disable packet slave mode when the product doesn't
support packet slave mode.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
| |
When the receive timeout happens, the radio may still interrupt while
the SPI bus is getting shut down. If this happens, the interrupt
handler shouldn't touch the SPI bus at all as it may well be turned
off, which would cause the receive function to wedge waiting for a spi
byte transfer to happen.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Instead of reading NUM_TXBYTES, set the FIFO_THR pin to indicate when
64 bytes are available in the buffer.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This replaces direct register access with function calls to allow that
code to respect the hardware requirements.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Having arbitrary alarms firing in the middle of complicated device
logic makes no sense at all. Therefore only correct use of ao_alarm
and ao_clear_alarm was around a specific ao_sleep call, with correct
recovery in case the alarm fires.
This patch replaces all uses of ao_alarm/ao_sleep/ao_clear_alarm with
ao_sleep_for, a new function which takes the alarm timeout directly.
A few cases which weren't simply calling ao_sleep have been reworked
to pass the timeout value down to the place where sleep *is* being
called, and having that code deal with the return correctly.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
| |
The cc1120 receive code is 'twisty', in that it acquires the SPI mutex
in the middle of an interrupt handler so that it can quickly start the
radio when the signal comes in. This means we have to be careful to
drop that mutex in all paths which leave the receive code, including
when the packet receive is aborted mid-way through the process.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
| |
There's no reason to use 20.5kHz deviation at 2400 and 9600 baud, and
if we get a better receiver, we'll want to use narrower deviation to
have less bandwidth sucking noise into the radio. The new values are
(nominally) 5.125kHz deviation for 9600 baud and 1.5kHz deviation for
2400 baud.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
| |
Instead of blocking on PQT, just set up the receiver to start going
and when the first bit interrupt comes in, grab the SPI bus if
possible and configure it for reception. This improves sensitivity in
the radio by a significant amount while making the code conceptually a
bit nicer.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This supports the new 2400 and 9600 baud rates
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Unused variables, mismatching signed/unsigned and a few other misc
warnings.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Unused variables, functions and labels, missing enums in switch.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This sets the deviation to 0, enables the preamble and turns on the
transmitter. It will sit there happily sending a bare carrier forever
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
I finally found a bunch of references to APRS on the net and they all
appear to assume a 3kHz deviation. Let's see if this works better with
Yaesu radios.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Was returning an uninitialized value, which was often not zero
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
| |
Instead of dragging around the weird CC1111 RSSI values, just compute
a dBm value in a signed 8-bit integer, ao_radio_rssi. Use that
everywhere we need RSSI internally. We leave the weird CC1111 value in
the packet reply as that's what the host expects.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
This just goes and clears the transmitter before using it, just in
case it got wedged somehow. It also clears the bits while waiting for
the radio to go idle, otherwise it'd never make it.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
| |
Otherwise, we may come in and try to use the radio again too quickly,
causing it to go into a TX fifo error state.
This change watches the MARC status until the transmitter is
explicitly marked as finished.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
| |
Instead of using ao_alarm around calls to ao_radio_recv, provide an
explicit timeout value as needed by radio functions with more
complicated system interaction than the cc1111. The timeout is 8 bits
of clock ticks.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This involved figuring out which GPIO signal would reliably indicate
that the transmitter was finished; I ended up using the PA_PD bit for
this.
This also converts all of the radio users to the long packet support
as the CC115L has only a 64-byte fifo, not large enough to hold either
an RDF tone or a regular AltOS telemetry packet.
This also renames the public API for sending APRS packets from
ao_radio_send_lots to ao_radio_send_aprs, which is at least more
accurate. The workings of that API haven't changed, just the name.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
Most of the chip can run at 8MHz, but extended register access is
limited to 6.1MHz. Instead of pushing things, just run the SPI bus at
4MHz.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Reading the incoming data bypasses the SPI API and touches the SPI
data register directly; which port that is needs to be specified in
the pins file
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|/
|
|
|
|
|
|
|
|
| |
Sometimes the radio will give a spurious wakeup indicating that a
preamble seems to have arrived, but no packet data will appear. In
this case, abandon the packet reception and go back to waiting for a
preamble again. This releases the SPI bus for other users and also
avoids missing packets.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
RDF function had changed, and APRS isn't available on megadongle.
Signed-off-by: Keith Packard <keithp@gag.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the radio drops out of RX or TX mode due to an error, it changes
the MARC status, and sends pulse down a configured GPIO. Use this to
tell when something 'bad' happened during TX or RX so that we can
recover from losing the SPI bus in the middle of transmission or
reception.
Without this, the radio would change state and we'd never know,
leaving the radio code waiting for an interrupt that would never arrive.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
This fixes the FIFO management, ensuring that the data are streamed
into the radio fast enough to keep the packet continuous. Sounds like
it works, but testing with an actual APRS receiver is required.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This adds an arbitrary-length packet writing function to the radio
code.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
so whether the radio got turned on was random.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Stop using cli/sei, which are avr-specific
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Add sample-based profiling, using a 1kHz timer
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Make it easier to tell which component is failing self test
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Move api to ao_radio_cmac.h include file.
Expose ao_radio_test as standard API.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
Just like cc1111, stick the serial number and radio calibration values
at known fixed addresses so that when re-flashing the board, we can go
find the existing values.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
AO_RSSI_FROM_RADIO and AO_RADIO_FROM_RSSI.
Removes a bunch of open-coded versions of the same function.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This is especially useful for telemini which has no beeper, allowing
you to hear the continuity signal while at the pad over the air.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This blocks starting the decoder until all of the data have arrived so
that the time spent in the decoder is easily computed.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Make the FEC code just set the CRC_OK bit like the cc1111 radio does;
eliminates a bunch of weird conventions across the FEC API.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
STM needs it to be provided when enabling the SPI device, so just fix
AVR and cc1111 to do the same.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Make some variables static, remove stale debug code
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Integrate interleaving, CRC and padding within the decode/encode
functions.
Provide for ISR priorities so that the 1120 RX interrupt takes
precedence over the other interrupts or we risk losing bits.
Optimize the viterbi decoder a bit (goes from 10ms per packet to 7ms
per packet).
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
Decode radio input one interleave block at a time. This overlaps the
decode computation with the packet reception, leading to lower latency
in an attempt to keep up with the transmitter.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Call the fec decode function, compute RSSI and check CRC
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Interrupt-per-bit, but it seems to work
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
It gets called from multiple tasks, so put local data on the stack.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Add CRC, whitening, FEC and interleaving routines for transmission
path to allow cc1120 to send telem packets to cc1111.
Signed-off-by: Keith Packard <keithp@keithp.com>
|