| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The driver uses a timer connected to a DMA engine to measure pulse
widths from the chip. We get 11 pulses for 4 channels; the first pulse
is caused by the timer starting up, the next two are the marker pulse
and then 8 more indicating the end of the high and low periods for
each channel.
The driver API returns the 8 pulse widths; the caller is expected to
know what to do with those values as using them requires knowing the
value of the configuration resistor and the characteristics of the
thermistors.
The test code assumes a 1k configuration resistor, using that it computes
the resistance of the four thermistors.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
In my zeal to eliminate warnings, I added declarations of all ISR
functions to a shared header file. However, I managed to include the
'weak' declaration, which meant that the intended ISR functions were
as weak as the 'default' ISR functions. This left all interrupts
non-functional, which doesn't make for a happy program.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Including interrupt vectors to catch mis-spellings.
Working toward supporting -Wmissing-prototypes
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
And update all users to be explicit about the desired config.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
These are fixed at 16 and 17.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Lets cortexelf do more things with groups of pins, rather than one pin
at a time.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
ao_gpio_set_mask and ao_gpio_get_all
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Gcc 5.4.1 tracks alignment of data through assignments, so that a
uint32_t pointer which comes from byte-aligned uint8_t data:
extern uint8_t foo[];
uint32_t *q = (void *) foo;
Fetches and stores through this pointer are done bytewise. This is
slow (meh), but if q references a device register, things to bad very
quickly.
This patch works around this bug in the compiler by adding
__attribute__((aligned(4))) tags to some variables, or changing them
from uint8_t to uint32_t. Places doing this will now be caught as I've
added -Wcast-align to the compiler flags. That required adding (void
*) casts, after the relevant code was checked to make sure the
compiler could tell that the addresses were aligned.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
These weren't the original version of the docs that we had.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
These set or clear a group of bits in a single GPIO register all together.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix the CCMR1_OC1PE and CCMR2_OC3PE values.
Disable clock when no PWM outputs are running.
Fix the apb1enr value for the timer.
Set ARR value to PWM_MAX - 1 -- ARR is off by one.
Sets the GPIO pins to 40MHz bandwidth for sharper edges.
Tested on EasyMega, but that code is not included as it breaks the
companion protocol.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This crept in while working on the stmf0 bits. oops.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This waits forever for USB writes to complete, instead of timing out
after five seconds. Useful when debugging the device.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This lets the compiler short-circuit the tests in ao_enable_gpio and
ao_disable_gpio to save a bit of code space and time.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Look at the flash size and the device id registers to figure out how
much flash is available.
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>
|
|
|
|
|
|
|
| |
Adds new telemetry and logging formats along with code for TeleMetrum
v2.0 design.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This splits the fast-timer portion out of the debounce helper code and
shares that with the quadrature driver which now uses it directly.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
And get it loaded to RAM so it can execute correctly.
Nothing calls it yet...
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
It's probably more power efficient than using one of the timers, and
it's certainly easier to configure.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This cleans up a few values, adds more comments and a few more NVIC fields.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Turn a bunch of the macros into inline functions.
Clean up the reboot method to use the stm_scb structure.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
This marks the lowest portion of the stack as inaccessible to the CPU,
causing the processor to fault when it reaches it. The fault then
generates a panic message so that the user can know what happened.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Add sample-based profiling, using a 1kHz timer
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
The EXTI routing information is in the syscfg unit, so that needs to
be powered up or writes to its registers will be lost.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Needed to support general GPIO interrupts
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
This seems better than the random loop that it replaces, but I still
have no idea why this is required; it doesn't coorespond to the docs
at all...
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This provides a simple method for getting high-resolution timer data
to use in performance tuning code. It's not used by default anywhere.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Which GPIO a particular pin interrupt comes from is selected by the
SYSCFG EXTICR registers; set these when an exti interrupt is configured.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
TX is 6, RX is 7
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>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
| |
This moves all of the STM clock configuration into ao_pins.h so that
each product can configure it separately. While doing this, I
discovered that the flash memory mode (64-bit, prefetch, latency 1)
wasn't actually getting set, which is why the CPU refused to work at
32MHz.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Drives the MegaMetrum beeper
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Not well tested yet...
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Each stm32l has two-point factory temperature calibration data.
Provide access to that for displaying temperature data.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
DMA-based driver for the STM analog to digital converter.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Eliminates a cast when assigning to them.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
When selecting an alternate function, set the pin to alternate mode as
well; there's no sense requiring two separate calls everywhere.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This gets stm-demo working
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This runs AltOS and talks over the serial port.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
The stm-bringup doesn't run altos, it just initializes the device and
writes stuff over a serial port. Works on the STM32L Discovery board
at least, should do stuff on other boards too.
Signed-off-by: Keith Packard <keithp@keithp.com>
|