| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
| |
When the MISO DMA priority is too low, and the processor gets busy,
it's possible for SPI input to overrun the processor, which causes the
MISO DMA to get out of sync and never finish. Set the MISO DMA
priority to HIGH to avoid this.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
Instead of having nearly duplicate versions of the SPI DMA
configuration calls, create helper funcs that do most of the work so
that the SPI API funcs are shorter and clearer.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Provides a bit better typechecking opportunities for this function.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
This provides inline functions for sending and receiving individual
bytes, and setup/finish functions to wrap them in. This make the byte
sending respect the SPI hardware interface requirements.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
These had an extra level of switch nesting for no good reason.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
This regularizes SPI hardware use and ensures that the device is
turned off after it has been used and that the status register is back
to 'normal' the next time through.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This dumps out the SPI hardware state and history of SPI operations
when compiled with -DDEBUG=1. Without that, this patch does nothing.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Provides for a bit better error checking.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
We don't write to this, so let it be const for type checking
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>
|
|
|
|
|
|
| |
SD cards require 0xff when fetching data
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
The GPIO pin settings affect the output impedence, and hence the
maximum speed for SPI. Cranking these to suitable values allows SPI to
run at full speed.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This should avoid an accidental low->high transition when switching
between multiple SPI busses.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Make sure none of the pin configurations are being used at startup
time. Split out the pin configuration into separate functions.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
This allows multiple STM pin groups to be used for each SPI
bus. Useful for the MS5607 sensor which signals conversion complete on
the MISO line.
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
The cc1120 is noisy enough to break SPI data transfers at 4MHz, so
crank things down to 1MHz. It's "stable" now, but clearly needs a
filter and shorter traces.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
cc1120 doesn't want more than 6.1MHz, otherwise it gets very angry.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This does "something" in radio test mode, appearing to generate a
730MHz signal.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
The pressure sensor seems happy at this speed.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
It's still not working right, but at least it returns something other
than all zeros...
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
All SPI transfers are done via DMA, so the DMA interrupts suffice.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Should save a bit of power.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
Signed-off-by: Keith Packard <keithp@keithp.com>
|