F2 and F4 have a common section to deal with the options register (TIM2 and TIM5 only)
L1 has been made common with timer_common_all as its options register has very different settings to F2/F4. Code is in the L1/timer.c L1/timer.h files
Note that F3 and F05 timers should fit into this scheme, with F3 having additional features.
Bundled with this is L1/pwr.h to change a documentation setting
Also all the Doxyfiles have added "ENABLE_PREPROCESSING = NO" to fix a problem introduced by commit 118.
(prevents inclusion and also issues warning)
Changes to some source files to remove references to common headers.
Changes to rng.h to make guard symbols the same in f2 and f4.
to remove errors, duplications and inconsistencies.
File lib/stm32/f1/pwr.c - all code removed as it duplicates that in common/pwr_common.c
Remaining changes do not affect code. Compiles OK.
TODO efm32 has no code so generates no modules
TODO F2 needs pwr.c
TODO L1 needs dma.h and dma.c
Clearing a single bit in DMA_CCR, then immediately writing a 0 over the
entire register is completely redundant on the F1, F3 and L1 DMA
peripherals. (Unlike the F2 & F4 DMA Peripheral, where this is
required)
Add an example using the RTC to help with a lower power design. This is
a sister example to the existing "button-irq-printf", which is
functionally identical, but uses far less power.
There's more tricks that can be done to lower the power even further,
but this shows a few of the early steps that can be done, using the RTC
wakeup instead of a timer.
Add the register definitions and some of the most basic helper functions
for the new style BCD RTC module found on the F2, F4, L1, F3 and F0.
This tries to keep as close to HACKING_COMMON_DOC as possible, while
maintaining sane names.
Code added for L1 to support the PWR Control block didn't properly
follow the HACKING_COMMON_DOC guidelines. The naming was wrong, and
some headers were missing. This commit has no functional changes, it
only addresses the style and structure problems.
Earlier additions to the L1 support were not correctly using linux
coding guidelines as specified in /HACKING.
Some examples were also missing license information.
Fixes#51
There should be no reason for manually trying to load the stack. Cortex
devices can be programmed with only C, and any code that needed this
would indicate broken vectors.
the "make clean" target showed a constant "stm32/f1" debug message
instead of the current relative directory. this is fixed by showing the
relevant portion of the current directory instead, relevant being
determined by evaluating the current makefile's relative position and
stripping that part off.
Add an abstraction layer to handle the clock control for the run time clock on
LM4F (RCC). Sleep and deep-sleep clock configuration is not handled.
Complete documentation for the clock control API is included in doxygen-style
comments, and is included in [doc].
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Conflicts:
lib/lm4f/Makefile
The enum definitions are specified in the form
31:5 register offset from SYSCTL_BASE for the clock register
4:0 bit offset for the given peripheral
The names have the form [clock_type]_[periph_type]_[periph_number]
Where clock_type is
RCC for run clock
SCC for sleep clock
DCC for deep-sleep clock
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Updated the documentation so that it appears in all families
Also added it to the L1 area, but is untested. An addition to the memorymap
allows commonality and a #ifdef added to the spi_common_all code to
exclude the case of SPI3 for L1 and F0 as SPI3 doesn't exist in those.
An rcc dispatch header was added to remove same code from the spi header.
In the header:
- Fix DMA_SxCR_CT: change shift from 18 to 19
For use with the convenience functions:
- Added DMA_SxCR_CHSEL generic values
- Added DMA_STREAM - generic values
- Added dma_if_offset - rather than separating out LISR and HISR
- Added masks
- Added dma_disable_double_buffer_mode()
Add an "#ifdef(LM4F)" clause to include/libopencm3/dispatch/nvic.h
and lib/dispatch/vector_nvic.c. This compiles in the vector table
and allows interrupts to be used.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Specify the -mfloat-abi=hard and -mfpu=fpv4-sp-d16 flags so that FPU
is enabled by default.
While this compiles with FPU support, in order to use the floating point types,
the FPU must be explicitly enabled at runtime.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Create lm4f code infrastructure from the lm3s infrastructure.
As far as the interrupt table is concerned, don't create an irq.yaml. Just
include the LM3S nvic.h. The LM3S vector table seems to be compatible with the
LM4F
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
This has only been tested functionally with basic timers, and basic operations.
Advanced timer support has been #ifdefed to compile, but this probably needs more testing.
Despite the L1 being a low power device, my initial focus is on making
it basically compatible with existing devices.
To that end, provide clock setup helper routines that configure it for maximum performance,
allowing some similar clock speeds to F1 devices to help with testing. This requires adding
the power chipset routines to set the voltage range.
Clock setup style is similar to the F4 code, which seems nicer than the overflow of different
routines used on the F1 code.
NOTE: Both the F4 existing pwr code, and this code don't actually include the f1 core power
code, even though it should be compatible
This commit refactors USB string code, making it, hopefully, less
buggy and more easier to understand. It also removes "magic" bit
manipulation and "magic" numbers;
This commits adds a new error code that can be return from a
registered control callback: USBD_REQ_NEXT_CALLBACK. This return code
signifies that the callback is done processing the data successfully,
but user would like to have all matching callbacks down the callback
chain to be executed too.
This change allows for example to intercept standard requests like
GET_DESCRIPTOR, do some small action upon receiving of one, but still
have the standard callback executed and do it's job. This way user
doesn't have to re-implement standard GET_DESCRIPTOR functionality if
they want to intercept that request to do some small thing.
This commit add an extra field to the _usbd_device, that allows to
keep track of the number of USB strings which allows simplify
boundaries checking code in usb_standard_get_descriptor.
This commit also changes the index base for strings in
usb_standard_get_descriptor which allows to get rid of necessity to
have a dummy one-character string in a strings array.