91 Commits

Author SHA1 Message Date
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
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
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
Piotr Esden-Tempski
c904c3ae57 Merging pull request #63 Improvements to STM32F1 I2C, CAN, RCC, and USB (f107)
Merge remote-tracking branch 'icd/master'
2013-01-06 17:52:43 -08:00
Jeff Ciesielski
db35fbb7ba Merge branch 'master' of git://github.com/libopencm3/libopencm3 into upstream-merge 2012-11-13 13:13:40 -08:00
Ken Sarkies
4ab5c94b90 Proposed deduplication of peripherals, GPIO example
See rambling post on dev list for justification
2012-11-13 18:41:31 +10:30
Piotr Esden-Tempski
b2af3ca540 [doc] Cosmetic. 2012-11-12 15:14:06 -08:00
Ken Sarkies
35c0863a75 Documentation updates 2012-11-12 21:44:52 +10:30
Karl Palsson
2011941b55 Vectors and Memory Map for STM32L1 series 2012-11-07 21:50:27 +00:00
Andrey Smirnov
12e1786863 Add a desig_get_unique_id_as_string
This commit adds desig_get_unique_id_as_string which is useful if one
wants to use device ID as USB serial number(iSerialNumber), for example.
2012-11-06 16:48:40 -08:00
Jeff Ciesielski
6c41c808c3 stm32/f1/can: Add clearing of can timing bits on init
This corrects a bug introduced with the addition of allowing loopback
and silent parameters in the init function.
2012-11-01 18:02:11 -07:00
Jeff Ciesielski
fa1d5f8e43 stm32/f1/can: clean up can_available_mailbox ->fewer 'if' statements 2012-10-31 17:03:26 -07:00
Piotr Esden-Tempski
507a1742dc Merge pull request #57 F2/F4 timer merging action
Merge remote-tracking branch 'tdaede/f4-timer'
2012-10-31 13:47:54 -07:00
Piotr Esden-Tempski
60aa32e2b9 Merge pull request #53 CAN fixes
Merge remote-tracking branch 'tdaede/master'
2012-10-31 13:37:19 -07:00
Ken Sarkies
5a6b1a1934 STM32F1 Addition to DMA to add interrupt flag read and clear.
Additional macros and defines added to header for the purpose.
Also disable of increment modes (seem to have been omitted originally).
2012-10-31 13:35:59 -07:00
Piotr Esden-Tempski
6b2ca89f48 Merge pull request #22 fixing usb and f4 alignment issues
Merge remote-tracking branch 'jdk/master'

Conflicts:
	lib/stm32/f1/Makefile
	lib/stm32/f4/Makefile
2012-10-31 13:34:18 -07:00
Thomas Daede
d7296f176a Move timer.c to be common to all stm32 series 2012-10-30 16:52:54 -05:00
Thomas Daede
1bb0e9b970 Add CAN support for F2 and F4 series.
All stm32 series currently released share the same bxCAN hardware, so share can.c among all the families.
2012-10-28 02:50:46 -05:00
Jeff Ciesielski
94abf6e529 stm32/f1: Add user_reset_hook to reset_handler w/ jump_to_dfu preset
This allows for pragramatic jumping to the DFU bootloader on CL devices, or
could be used for things like CRC checking of the firmware before boot
2012-10-22 14:45:44 -07:00
Jeff Ciesielski
dd5e797d61 stm32/f1/can: Add function to detect if can system has an available mailbox 2012-10-22 13:26:58 -07:00
Jeff Ciesielski
24a35126bf stm32/f1/can: Replace mistaken logical operators with bitwise operators.
also: remove unnecessary parenthesis
2012-10-19 23:05:37 -07:00
Jeff Ciesielski
1cb373464c stm32/f1/gpio: use |= instead of = when setting up registers 2012-10-19 16:33:38 -07:00
Jeff Ciesielski
527eeacbff stm32/f1/rtc: add PLL2/3 to switch statement to avoid compiler warning 2012-10-19 16:32:37 -07:00
Jeff Ciesielski
069a758f6c stm32/f1/rcc: add 25mhz in to 72mhz out clock tree setup function.
also: added support for previously undefined PLLs
2012-10-19 16:31:52 -07:00
Jeff Ciesielski
153e81bc96 stm32/f1/vector: add ability to boot to DFU bootloader
note: Only works on CL devices
also: this could probably use a helper function
2012-10-19 16:30:27 -07:00
Jeff Ciesielski
a2fc8768c6 stm32/f1/dma: add clear_flag helper function 2012-10-19 16:28:44 -07:00
Jeff Ciesielski
4b86c28141 stm32/f1/can: Add loopback/silent vars to init function.
Also: add helper function for mailbox checking
2012-10-19 16:27:17 -07:00
chrysn
75c2165827 build common .o files everywhere (fixes issue #29)
vector.o, nvic.o, scb.o and assert.o are available on every platform,
but at least some of them differ between the implementations. they
already got built explicityly on some platforms; now adding them to the
common Makefile.include.
2012-10-19 18:56:39 +02:00
chrysn
e20f1c0d8f unify scb (system control block)
these register definitions are common to all cortex mcus. some of the
registers might not be implemented everywhere (especially the floating
point registers), but defining them does no harm.

this modification does not result in any changes in the example
binaries.
2012-10-18 21:45:20 +02:00
chrysn
5afa53f01a drop two-line vector.c dispatchers in favor of central dispatch 2012-10-18 16:29:58 +02:00
chrysn
7c33025c31 Merge branch 'master' into generalizations
Conflicts:
	lib/lm3s/vector.c -- split out to lm3s/irq.h
	lib/stm32/f4/vector.c -- put the floating point initialization code into a function like in lpc43xx
2012-10-17 18:55:54 +02:00
Ken Sarkies
0834f41383 stm32f1:
Add object files to Makefile to include new modules into lib.

Correct typo in pwr.c

Add two new functions to timer.c to preset the counter (for use
with deadman style timeouts) and to identify an interrupt
source.

Also noticed lib/makefile.include didn't clean lib/stm32, which
isn't a target. Added a fix.
2012-10-16 14:05:45 -07:00
Ken Sarkies
4efa64c278 Doc changes to go with previous commit 2012-10-05 14:04:40 +09:30
Ken Sarkies
7d0611609b Code changes to stm32f1 adc.c and adc.h
remove rcc_set_adc_clk - use rcc version
Added functions:
 - adc_power_on
 - adc_start_conversion_direct
 - adc_set_dual_mode
 - adc_eoc
 - adc_eoc_injected
 - adc_read_regular
 - adc_read_injected
 - adc_set_injected_offset
Tested dual mode scanned regular, but no tests of injected yet.
Changes: "discontinuous" was misspelled.
 - adc_set_discontinuous_mode_regular - added "length" parameter
 - adc_disable_discontinuous_mode_regular - name change
 - adc_enable_discontinuous_mode_injected - name change
 - adc_enable_automatic_injected_group_conversion - disable triggers
 - adc_enable_jeoc_interrupt - name change to match common usage in lib
 - adc_disable_jeoc_interrupt - ditto
 - adc_enable_external_trigger_regular - remove incorrect test on parameter
 - adc_enable_external_trigger_injected - ditto
 - adc_set_sample_time - name change to match function's purpose
 - adc_set_conversion_time_on_all_channels - ditto
 - adc_set_injected_sequence - changed order of register loading (ref Barlow's issue)
 - adc_enable_analog_watchdog_on_all_channels - flipped AWDSGL
 - adc_enable_analog_watchdog_on_selected_channel - ditto
added aliases for expected commonly used functions to avoid sudden user code breakage

In adc.h, corrected errors in SQR names
added "deprecated" compiler warnings to adc_on and to aliases defined in adc.c
2012-10-05 13:50:42 +09:30
chrysn
a69d83d312 unified vector table initialization
the cortex generic interrupts get moved to lib/cm3/vector.c, the
platorms' individual irq names, initialization and handler prototypes go
to platoform specific irq.h files.

as the vector.c file heavily depends on platoform specific headers, it
can't be built once-and-for-all in lib/cm3/, so there are inclusion
stubs in the various architecture dirs; this might be better solved with
Makefile / include path handling.

one particular file is lib/lpc43xx/vector.c; that platform's
initialization code contains an additional section to copy everything
from flash to ram (which probably performs better there). that code
still resides in the inclusion stub, and gets mashed in using defines.
would need a cleaner implementation together with the Makefile solution.

this commit contains some files of the upcoming efm32 branch, from which
it was cherry-picked.

the .bin files produced from before and after this commit only differ in
lpc43xx, where the startup sequence was subtly modified.
2012-10-05 00:55:24 +02:00
Tomaz Solc
fc4047e4b4 Add assert macros to aid in debugging.
Adds libopencm3/cm3/assert.h header that provides assertion check macros
similar to those provided by the standard C library.

Thanks to Nicolas Schodet for help.
2012-10-02 08:48:45 +02:00
Jason Kotzin
34beeae925 USB core updated for reentrance based on Christian Cier-Zniewski's branch 2012-09-13 10:43:35 -07:00
Piotr Esden-Tempski
7373bfcb9b Merging pull request #26 "Linker script cleanup/improvements"
Merge remote-tracking branch 'schodet/linker-script'
2012-09-10 13:42:10 -07:00
Nicolas Schodet
82ef2936a6 Support exceptions on all targets 2012-09-03 20:41:15 +02:00
Nicolas Schodet
74cd991e7e Use a specific symbol for data source address in flash
That way, data source address does not depend on any other unrelated change in
linker script.

This also fixes cases when .data input section is aligned on 8 bytes.  The new
version does not provide any address for the output section so that it is
aligned to the strictest input section.  The _data_loadaddr symbol will
always take this alignment into account.
2012-09-03 20:28:12 +02:00
Nicolas Schodet
2a35377980 Clean up and make linker scripts more uniform
This includes:

 - fix some comments indent,
 - add entry point,
 - align exported symbols,
 - remove unneeded "." assignments.
2012-09-03 19:53:43 +02:00
Ken Sarkies
9af50d6e5c STM32F1xx Additional minor changes to adc.h and adc.c 2012-08-31 21:47:30 +09:30
Ken Sarkies
acc276a612 ADC documentation added
In adc.h additional defines needed to assist documentation - lines 172-191
added, and 384,436-451 are duplicates of earlier defines to complete
parameter sets (compiler has no trouble with these).

Minor doc corrections to other files.

No code changes (apart from additional defines).
2012-08-31 09:54:31 +09:30
Piotr Esden-Tempski
d98dab6ae2 Merging pull request #23 Changed markup to get more control over documentation.
Merge remote-tracking branch 'ksarkies/doc'
2012-08-25 15:16:50 -07:00