Commit Graph

1200 Commits

Author SHA1 Message Date
Felix Ruess 9e24b33d90 [cm3] add missing declaration for systick_get_reload 2013-02-24 16:06:27 +01:00
Piotr Esden-Tempski 3277c58550 Merge remote-tracking branch 'github/deprecationmacro' 2013-02-19 11:37:56 -08:00
Felix Ruess 3ef44bff54 [cm3] fix doxygen for systick_get_value, add systick_get_reload
Fix the reload value in the examples:
to get a SysTick interrupt every N clock pulses: set reload to N-1
see http://infocenter.arm.com/help/topic/com.arm.doc.dui0552a/BGBEEJHC.html#BABGACGG
2013-02-19 19:22:49 +01:00
Piotr Esden-Tempski 46263e90b4 Merge pull request #88 "Fix logical operator error in tim_ic_set_input reported by hmjack2008"
Merge remote-tracking branch 'ksarkies/timer'
2013-02-18 14:19:53 -08:00
Piotr Esden-Tempski b4634ba8ff Merge pull request #92 "DMA tidyup"
Merge remote-tracking branch 'karlp/dma_tidy'
2013-02-18 14:14:22 -08:00
Piotr Esden-Tempski b13e55da8c Adjusted code for l1 to the new api introduced by karlp in pr #84 2013-02-18 14:12:48 -08:00
Piotr Esden-Tempski 3c110fec8e Merge pull request #85 "Add notes on build prerequisites"
Merge remote-tracking branch 'karlp/pr_prereq_docs'
2013-02-18 14:10:10 -08:00
Piotr Esden-Tempski 6eef01ce26 Merge pull request #84 "Pr flash reg rename"
Merge remote-tracking branch 'karlp/pr_flash-reg-rename'

Conflicts:
	include/libopencm3/stm32/l1/flash.h
2013-02-18 14:09:31 -08:00
Piotr Esden-Tempski f980f197ca Merge pull request #81 "[examples f1] ADC+DAC very basic example"
Merge remote-tracking branch 'karlp/pr_f1_adc_dac'
2013-02-18 14:07:00 -08:00
Piotr Esden-Tempski 9095f58fa3 Merge pull request #79 "More L1 support (and f2/f4 rtc)"
Merge remote-tracking branch 'karlp/pr_more_l1_rtc'
2013-02-18 14:06:02 -08:00
Piotr Esden-Tempski b903ae75d8 Merging pull request #78 "Remove assembly forcing stack."
Merge remote-tracking branch 'karlp/destroy-all-the-asm'
2013-02-18 14:03:19 -08:00
Piotr Esden-Tempski daf4cc0feb Merging pull request #76 "LM4F clock api"
Merge remote-tracking branch 'mrnuke/lm4f_clock_api'
2013-02-18 13:53:57 -08:00
Piotr Esden-Tempski 9193d3d273 Fixes #93 copypasta error in RCC_CSR_BORRSTF definition. 2013-02-15 16:14:30 -08:00
Karl Palsson 7afc13930f [stm32] Use common memorymap include for consistency
Most peripheral headers simply include <libopencm3/stm32/memorymap.h>
which, like the rest of libopencm3 requires the correct compiler define
flag to be set.  A few peripherals were directly including the platform
include, libopencm3/stm32/xx/memorymap.h, and in some of those cases it
wasn't even correctly including the correct platform.  (Likely the
result of copy/paste errors)

These direct includes have been eliminated
2013-02-06 11:47:23 +00:00
Karl Palsson e4c0a50286 [stm32-dma] Eliminate redundant write.
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)
2013-02-06 11:43:20 +00:00
Ken Sarkies e20ef7a416 Fix logical operator error in tim_ic_set_input reported by hmjack2008 2013-02-01 21:44:00 +10:30
Piotr Esden-Tempski c9276b7aa2 Fixing gpio_set_af now really... 2013-01-29 13:42:11 -08:00
Piotr Esden-Tempski ae55194d4a Fix gpio_set_af register usage. 2013-01-29 13:33:58 -08:00
Piotr Esden-Tempski 8b062bb659 Added IRQ USART example for the f4 discovery board. 2013-01-29 13:33:58 -08:00
Karl Palsson b2722a010b Add notes on build prerequisites 2013-01-23 21:21:27 +00:00
Karl Palsson 40d9d630f0 [flash] f4: use "proper" bit definition naming.
Part 4 of 4: updated f4 to use flash_<reg>_bit instead of just
flash_bit
2013-01-23 13:58:11 +00:00
Karl Palsson 316b068cb4 [flash] f2: use "proper" bit definition naming.
Part 3 of 4: updated f2 to use flash_<reg>_bit instead of just
flash_bit
2013-01-23 13:58:11 +00:00
Karl Palsson 1eb4e6ed29 [flash] f1: use "proper" bit definition naming.
Part 2 of 4: updated f1 to use flash_<reg>_bit instead of just
flash_bit
2013-01-23 13:58:11 +00:00
Karl Palsson c0ea749452 [flash] l1: use "proper" bit definition naming.
Part 1 of 4: updated l1 to use flash_<reg>_bit instead of just flash_bit
2013-01-23 13:58:06 +00:00
Karl Palsson d9fb4f7401 Add examples making use of the RTC
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.
2013-01-23 00:01:46 +00:00
Karl Palsson e5b3250382 [stm32] Support the "new" BCD style RTC peripheral
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.
2013-01-22 23:55:59 +00:00
Karl Palsson b6ee57a5b9 [l1] rcc: support MSI clocking
Some new definitions and helpers.  Main change really that the list of
preconfigured clock configs is no longer restricted to HSI/PLL
2013-01-22 22:55:25 +00:00
Karl Palsson 2306c907ab [l1] Update to newest ref man definitions
Support for the Medium+ and High density parts, mostly by way of extra
irqs and register definitions.
2013-01-22 22:55:25 +00:00
Karl Palsson df5e3e5ff1 [l1] PWR: fix style for common code
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.
2013-01-22 22:55:19 +00:00
Karl Palsson 48eed286b9 [l1] fix whitespace and missing license info
Earlier additions to the L1 support were not correctly using linux
coding guidelines as specified in /HACKING.

Some examples were also missing license information.
2013-01-22 21:51:24 +00:00
Karl Palsson 13dedaafc1 [examples f1] ADC+DAC very basic example
Just shows some basic working examples of using the DAC with the ADC. No
special features, but very little hardware required to demonstrate.
2013-01-22 18:07:02 +00:00
Karl Palsson 22d8891fee Remove assembly forcing stack.
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.
2013-01-16 20:41:26 +00:00
chrysn 20bfcaeb1c efm32gg990f1024: added linker script 2013-01-10 11:42:32 +01:00
chrysn c243724676 platform-independent makefile: fix old "stm32" reference
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.
2013-01-10 11:37:51 +01:00
Piotr Esden-Tempski 204eb047b4 Merging pull request #72 Doc
Merge remote-tracking branch 'ksarkies/doc'

Conflicts:
	doc/stm32f1/Doxyfile
	doc/stm32f2/Doxyfile
	doc/stm32f4/Doxyfile
	lib/stm32/f1/Makefile
	lib/stm32/f2/Makefile
	lib/stm32/f4/Makefile
2013-01-09 01:05:37 -08:00
Piotr Esden-Tempski cb2fd43666 Removed dummy character string from examples due to api change in: 7a5da60 2013-01-09 00:39:42 -08:00
Alexandru Gagniuc 7ba100f569 lm4f: Update miniblink example to demonstrate clock API
Flashes the Red, Green and Blue diodes on the board, in order. The system clock
starts at 80MHz.
Pressing SW2 toggles the system clock between 80MHz, 57MHz, 40MHz ,20MHz, and
16MHz by changing the PLL divisor.
Pressing SW1 bypasses the PLL completely, and runs off the raw 16MHz clock
provided by the external crystal oscillator.
The LEDs will toggle at different speeds, depending on the system clock. The
system clock changes are handled within the interrupt service routine.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-01-09 02:12:21 -06:00
Alexandru Gagniuc 4b2d9aca7b lm4f: Make miniblink example more readable, by defining RGB pins
Instead of setting and clearing RGB pins by PINx constants, define more readable
constants such as RGB_RED, and RGB_PORT.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-01-09 00:56:42 -06:00
Alexandru Gagniuc 7957cffaa3 lm4f: Add API for controlling the system run clock sources
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
2013-01-09 00:39:20 -06:00
Alexandru Gagniuc 03d04ad10a lm4f: Add API for enabling/disabling peripherals clock source
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>
2013-01-09 00:37:50 -06:00
Ken Sarkies 85308f562a Minor cleanup to use dispatch memorymap.h 2013-01-08 19:58:18 +10:30
Ken Sarkies efee94901a CRC moved to common area 2013-01-08 19:58:18 +10:30
Ken Sarkies e831f4db51 I2C to common area
F2/4 has now I2C3 included
2013-01-08 19:57:19 +10:30
Ken Sarkies 312d887825 IWDG moved to common area 2013-01-08 19:51:49 +10:30
Ken Sarkies 0878a534cd Move usart files to common area
Again added to L1 which is similar to F1
2013-01-08 19:51:08 +10:30
Ken Sarkies 1029597e70 Move DAC to common area
(Note there are now dummy source files dac.c (and others) that are
not compiled but are needed for documentation).
2013-01-08 19:50:22 +10:30
Ken Sarkies 7ec382c7d5 STM32: Moved SPI code into the common area.
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.
2013-01-08 19:48:52 +10:30
Ken Sarkies 61f2cb3f99 Move STM32F1 DMA files to respective common directories
This sets the stage for adding DMA to STM32F3xx (when added) and STM32L1xx as the controller appears to be identical in these.
2013-01-08 18:07:28 +10:30
Ken Sarkies a60ae5044c STM32 DMA: replaced F4 header to match that for F2, and move header and source files to common.
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()
2013-01-08 08:16:25 +10:30
Piotr Esden-Tempski 4d234c7e27 Marked some dummy variables in examples as unused, so that the newer GCC stops complaining. 2013-01-06 21:17:00 -08:00