Commit Graph

462 Commits

Author SHA1 Message Date
Karl Palsson ce8f47e7df Enable nvic and exti support for L1
And include an example that uses it.
2012-11-07 21:54:18 +00:00
Karl Palsson b860504fed Add L1 to nvic, now that it's all generated 2012-11-07 21:50:27 +00:00
Karl Palsson 25acaa5878 Add usart support for L1.
Only tested with basic tx blocking, ie, the same example code as on
F2/F4, but the description of the block is almost identical.
2012-11-07 21:50:27 +00:00
Karl Palsson 4941286454 STM32L1 support, rebased onto upstream generalizations branch.
Working example again.
2012-11-07 21:50:27 +00:00
Karl Palsson e4f84278f2 Add most of the rcc functions.
(Add the forgotten gpio.c file from before)
2012-11-07 21:50:27 +00:00
Karl Palsson 9aed64a19d Finish RCC definitions => Working example! 2012-11-07 21:50:27 +00:00
Karl Palsson 8318384cf1 More progress towards L1 support.
Believe gpio is complete, but untested without finishing at least the
RCC defines.

RCC defines are a work in progress
2012-11-07 21:50:27 +00:00
Karl Palsson 2011941b55 Vectors and Memory Map for STM32L1 series 2012-11-07 21:50:27 +00:00
Piotr Esden-Tempski f5df25d6de Merge pull request #55 STM32F4: New adc module
Merge remote-tracking branch 'ksarkies/adc-f4'
2012-10-31 13:38:51 -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 68e6818761 STM32F4 New: headers and source code for DMA
This has been tested with some dac, timer and (as yet uncommitted) adc examples.
2012-10-31 13:36:07 -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
Ken Sarkies 0bd415365d STM32F4: New adc module
Note adc.h was provided by Matthew Lai but was never merged.
adc.c is new.
2012-10-30 10:22:52 +10:30
chrysn a1f4c29872 Merge branch 'efm32'
this adds support for energy micro's efm32 tiny gecko, gecko, leopard gecko and
giant gecko series.

also, the experimental libopencmsis is included in this branch, as it is
required for full operation of the free energymicro standard library
2012-10-29 14:44:37 +01:00
chrysn a01e5c201b Merge branch 'generalizations'
this merges common c and header files of different architectures, adds a
dispatch mechanism and yaml descriptions of interrupt handlers from which the
whole interrupt table setup c code is generated.
2012-10-29 14:34:42 +01:00
Thomas Daede 0fd7cc3559 Fix CAN standard ID mask to be 11 bits. 2012-10-28 02:56:22 -05:00
Karl Palsson e55a9e3875 Missing EXTI ports and flag numbers for F4
(Also missing for forthcoming L1)
2012-10-22 22:37:44 +00:00
Silvio Gissi 0a1cf977eb Added irq.yaml to lpc_13xx and lpc_17xx families 2012-10-21 08:54:40 +02:00
chrysn a433217c5d Merge branch 'generalizations' into efm32 2012-10-19 19:29:32 +02:00
chrysn 14a5fc78cf completing dispatch
the LM3S irq list was previously unused as it was missing in the
dispatch files; now it got added. (before HEAD^, it wouldn't have made
any difference because the discriminating constant wasn't defined
anyway)

also, this enhances the warning messages
2012-10-19 19:10:42 +02:00
chrysn ab5a544d45 added irqs for the rest of the efm32 devices 2012-10-19 01:11:43 +02:00
chrysn d526dd3268 rename tinygecko->efm32tg everywhere 2012-10-19 00:59:49 +02:00
chrysn d13043d787 change discriminator in efm32 series from TINYGECKO to EFM32TG 2012-10-19 00:31:10 +02:00
chrysn a818dbe729 use generalized libopencm3 functions in cmsis 2012-10-19 00:18:49 +02:00
chrysn 3a2e1c45aa Merge branch 'generalizations' into efm32 2012-10-18 23:00:25 +02:00
chrysn bc5146b710 unified systick handling
the only change this results in in the example binaries is in the
hackrf-jellybean/systick example, where the the check in
systick_set_clocksource for overflowing from the stm32 area gets used.
2012-10-18 22:48:14 +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 0e3fdc57d5 remove files not required in generalizations branch any more 2012-10-18 19:18:25 +02:00
chrysn 47c69695ce Merge branch 'generalizations' into efm32
Conflicts:
	Makefile
2012-10-18 18:43:44 +02:00
chrysn c69916ffb6 integrate irq2nvic_h script in buildprocess 2012-10-18 17:58:12 +02:00
chrysn ae832b4ee8 split irq.yaml output in nvic.h and vector_nvic.h
the weak pragmas need to be used in the very compilation unit where
their target is defined, requiring another dispatch
2012-10-18 17:33:20 +02:00
chrysn 5ceb377a37 switch all interrupt lists to yaml format 2012-10-18 16:52:48 +02:00
chrysn 1684ffe18d fallback for unknown chips 2012-10-18 13:27:33 +02:00
chrysn a8a6eb39e9 add irq cound to existing nvic.h files 2012-10-18 13:19:55 +02:00
chrysn f705d1cd6e dispatch for chip specific nvic 2012-10-18 12:46:30 +02:00
chrysn a7f5f9f576 merge irq and nvic code using a script 2012-10-18 12:44:41 +02:00
chrysn 837de3ff97 nvic.h factored out (incomplete) 2012-10-18 10:27:51 +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
Felix Ruess 4e4496f70d [fix] GCC < 4.5 that does not accept any argument for the deprecated attribute. 2012-10-17 11:45:52 +02:00
Ken Sarkies 0c779512d6 Initial documentation for SPI, I2C and CRC
(no code changes)
2012-10-16 14:08:04 -07:00
Ken Sarkies c4b7e2a76a Additional stm32/usart.c functions to enable/disable Rx/Tx
interrupts, return a status flag and check for interrupt source.
2012-10-16 14:07:34 -07:00
Ken Sarkies 6ee8e44bd7 Initial documentation for stm32/usart.c, usart.h
Some minor documentation corrections to timer.h
2012-10-16 14:07:27 -07: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
Piotr Esden-Tempski 9e77f8c361 Merging pull request #28 Random number generator defenition and example.
Merge remote-tracking branch 'tiltit/master'
2012-10-05 13:08:03 -07:00
Piotr Esden-Tempski cb60e37608 Merging pull request #37 Adds hard-float support to stm32f4, with a nice mandelbrot example
Merge remote-tracking branch 'schodet/hard-float'
2012-10-05 13:03:58 -07:00
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
chrysn 36f95447a8 add back minimal support libraries
some of the libraries removed in [1] were essential to building
anything on efm32 (especially, irq.h).

[1] 4a6f4c0f7d
2012-10-02 11:55:05 +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