Commit Graph

101 Commits

Author SHA1 Message Date
Ken Sarkies 5b8953124e This mainly moves the STM32 timers' code to the common area.
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.
2013-03-09 14:39:01 +10:30
Ken Sarkies a9a85f080b Add test in common headers for improper inclusion of such files in application.
(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.
2013-03-07 18:35:04 +10:30
Ken Sarkies e2022f5884 Repair to documentation (most documented files)
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
2013-03-07 11:14:06 +10:30
Austin Palmer 31aa3b6f5a EXTI: Added function to get flag status 2013-03-01 10:36:57 -08:00
Piotr Esden-Tempski b0233ae6fb Added more warning CFLAGS to all makefiles. 2013-02-26 16:42:20 -08:00
Piotr Esden-Tempski 5e7ec39440 FLASH: Make sure that the flash unlock register state is cleared before trying to unlock the flash. 2013-02-26 15:25:55 -08:00
Vegard Storheil Eriksen bc853e7ebd Fixed gpio_primary_remap; swjdisable is pre-shifted and therefore needs to be u32. 2013-02-26 13:49:42 +01:00
Piotr Esden-Tempski 1e1859e8c7 ADC: Fix CR usage in adc_enable_discontinuous_mode_regular. Fixes #101 2013-02-25 17:15:43 -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
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 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