Commit Graph

550 Commits

Author SHA1 Message Date
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 f83f8d55d7 Merging pull request #74 LM4F initial support
Merge remote-tracking branch 'mrnuke/lm4f_initial'
2013-01-06 18:09:21 -08:00
Piotr Esden-Tempski 1f9911e35b Merging pull request #69 Add __attribute__ ((naked)) to reset_handler()
Merge remote-tracking branch 'nfbraun/master'
2013-01-06 18:00:15 -08:00
Piotr Esden-Tempski 27ccf45182 Merging pull request #67 L1 support: flash, power basics, timers
Merge remote-tracking branch 'karlp/pr_l1_flash-rcc-pwr-timers'
2013-01-06 17:58:27 -08:00
Piotr Esden-Tempski 44e350ad20 Merging pull request #64 Various changes
Merge remote-tracking branch 'bgamari/master'
2013-01-06 17:56:13 -08:00
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
Alexandru Gagniuc 60ceec0266 lm4f: Compile in the interrupt vector table
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>
2012-12-31 01:35:27 -06:00
Alexandru Gagniuc c1381bf54a lm4f: Compile with FPU support
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>
2012-12-31 01:35:27 -06:00
Alexandru Gagniuc b2ac2ffc4b lm4f: Remove erroneous references to lm3s
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2012-12-31 01:35:27 -06:00
Alexandru Gagniuc 326c945b55 lm4f: Add lm4f support files copied from lm3s
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>
2012-12-31 01:35:25 -06:00
Norbert Braun 569ebfdffb Add __attribute__ ((naked)) to reset_handler() 2012-11-28 15:28:42 +01:00
Ben Gamari 08a14a9d9e stm32/f4/adc: DMA can always be used with ADC2
I can't find any evidence in the manual to support this comment's claim.
2012-11-14 20:07:28 -05:00
Karl Palsson 523943a3d2 [l1] Add common timer code support.
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.
2012-11-14 00:27:13 +00:00
Karl Palsson df1808e2dc [l1] Add rcc clock setup helper routines
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
2012-11-14 00:16:56 +00:00
Karl Palsson 72666a5b93 [l1] Add Flash Memory Controller Register defns for L1.
Also, some of the most basic essential helper functions.
2012-11-14 00:16:46 +00: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 70746ccd67 Change to make L1 series fit with common files 2012-11-13 18:43:06 +10:30
Ken Sarkies 7d55ebbe0c Adjustments to fix documentation 2012-11-13 18:41:31 +10:30
Ken Sarkies e34ad9b3d2 rebase and fix 2012-11-13 18:41:31 +10:30
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 d08d366e75 [doc] Added preliminary STM32 CAN documentation. 2012-11-12 15:43:45 -08:00
Piotr Esden-Tempski b2af3ca540 [doc] Cosmetic. 2012-11-12 15:14:06 -08:00
Piotr Esden-Tempski d64ec3cf58 Merge pull request #62 "Documentation updates for new devices"
Merge remote-tracking branch 'ksarkies/doc'
2012-11-12 14:11:46 -08:00
Ken Sarkies 35c0863a75 Documentation updates 2012-11-12 21:44:52 +10:30
Piotr Esden-Tempski f714ee42c0 Merging pull request #60 Miscellaneous DMA fixes for F4
Merge remote-tracking branch 'bgamari/master'
2012-11-08 12:04:28 -08:00
Ben Gamari 9fea26e455 stm32/usart: Add enable_/disable_error_interrupt 2012-11-08 14:54:41 -05:00
Ben Gamari 095e6cdb5d stm32f4/dma: Fix cut-and-paste error 2012-11-08 12:20:36 -05:00
Ben Gamari 2fe567e25d stm32f4: Add dma.o 2012-11-08 12:12:59 -05:00
Karl Palsson d417666095 Eliminate redundant gpio code from f2/f4/l1
Implemented as per exti2
2012-11-07 21:58:16 +00:00
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 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 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
Andrey Smirnov 720e85f850 Further re-factor USB string handling code
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;
2012-11-07 11:30:44 -08:00
Andrey Smirnov c5c4db0196 Extend control hook framework
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.
2012-11-07 10:33:51 -08: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
Andrey Smirnov 7a5da60e26 Change USB strings handling code
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.
2012-11-06 16:46:55 -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 def9b9f381 Added new f4 adc module to the library makefile. 2012-10-31 13:39:24 -07: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
Thomas Daede 016c74af25 F2 timers are the same as F4 timers, so make the same changes to them 2012-10-31 15:34:10 -05:00
Thomas Daede 9468933735 Add back timer_set_option for STM32F4, and document. 2012-10-31 00:42:58 -05:00
Thomas Daede a56764667c Update comments and copy author from F4 version. 2012-10-31 00:11:59 -05:00
Thomas Daede d7296f176a Move timer.c to be common to all stm32 series 2012-10-30 16:52:54 -05: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 f385341495 Release the correct fifo in can_receive() 2012-10-28 02:53:53 -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 f80bf1ccb1 stm32/i2c: Add DOXYGEN strings for i2c helper functions.
Also: Define i2c_dutycycle group in i2c header
2012-10-22 15:48:22 -07: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
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
Silvio Gissi 0a1cf977eb Added irq.yaml to lpc_13xx and lpc_17xx families 2012-10-21 08:54:40 +02:00
Jeff Ciesielski ffe392c11b stm32/f1/i2c: remove unnecessary parenthesis 2012-10-19 23:16:08 -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 be4ee41ef9 stm32/f1/i2c: add a whole bevy of additional helper functions 2012-10-19 16:29:20 -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 1e88ad186f remove common modules from efm32*'s explicit build list
this is 75c216582 for the efm32 branch, see there for details
2012-10-19 19:30:25 +02:00
chrysn a433217c5d Merge branch 'generalizations' into efm32 2012-10-19 19:29:32 +02:00
chrysn f62eee7644 remove nvic.o from stm32/f[24]'s explicit list
this was missed out in 75c216582, see there for details
2012-10-19 19:29:06 +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 99d7b21032 define platform specific constants for all chips
previously, only stm32 chips passed the information about which chip to
build on into the compiler. this information is essential to dispatch,
thus defining LPC13XX, LPC17XX, LPC43XX and LM3S in analogy to
STM32F1..4.
2012-10-19 19:10:42 +02: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 1210738845 add generic OBJS to efm32 libraries
better fixes would be adding them to the generic (included) Makefile or
building the really device independent stuff in a _generic library
2012-10-19 17:03:23 +02:00
chrysn 6706899551 build vector.o on lpc13xx
no idea how this ever worked...
2012-10-19 15:18:21 +02:00
chrysn 843660dbfd copied over linker scripts
this will need some generalization too...
2012-10-19 15:02:09 +02:00
chrysn e11edaff11 build all efm32 families 2012-10-19 14:53:06 +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 962f328691 renamed linker file to work with included makefile 2012-10-19 00:41:22 +02:00
chrysn d13043d787 change discriminator in efm32 series from TINYGECKO to EFM32TG 2012-10-19 00:31:10 +02:00
chrysn fa3c1ea6a2 pulling in a simplification in per-arch makefiles 2012-10-19 00:19:07 +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 becfbc70e1 Merge branch 'generalizations' into efm32 2012-10-18 19:06:58 +02:00
chrysn 0548317683 fix bug resulting from equally named files
the local vector.o files shadowed the ../cm3/vector.c from VPATH,
resulting in empty reset vectors.
2012-10-18 18:54:52 +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 5afa53f01a drop two-line vector.c dispatchers in favor of central dispatch 2012-10-18 16:29:58 +02:00
chrysn 9c13299f25 unified nvic.c 2012-10-18 13:22:12 +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 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
Thomas W. Barr f94d71efee add _end and __end symbols for compatibility with code written against CodeSourcery linkers 2012-10-08 16:42:47 -05:00
Thomas W. Barr 8f9f2bdc00 complete peripheral handlers in vector table 2012-10-08 16:40:36 -05: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 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
chrysn b5de267b06 use _data_loadaddr instead of _etext
this change was done in master in [1] and just merged here.

[1] 74cd991e7e
2012-10-02 12:05:36 +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
Daniel Serpell e4819d3cd2 Enable floating-point coprocessor on reset.
Always enable the floating-point coprocessor with full access on
reset, allowing usage of hard-fp toolchains.
2012-09-27 23:12:18 +02:00
Daniel Serpell 584052c28c Compile stm32-f4 library with floating point support.
This enables hard-float in the compilation of library and examples
for the stm32f40* chips.
2012-09-27 23:12:18 +02:00
chrysn 4a6f4c0f7d remove the support libraries for efm32
i don't plan to extend or support them, and they'll just grow stale
2012-09-15 01:29:31 +02:00
chrysn 0508f30d2d Merge branch 'master' into efm32
Conflicts:
	Doxyfile
	Makefile
2012-09-13 22:32:28 +02:00
Jason Kotzin fb110dd3e6 stm32 F2/F4 gpio_set_af() fix 2012-09-13 10:43:35 -07:00
Jason Kotzin 34beeae925 USB core updated for reentrance based on Christian Cier-Zniewski's branch 2012-09-13 10:43:35 -07:00
Jason Kotzin 4958fae906 fixing usb and alignment issue 2012-09-13 10:43:26 -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 11727f56c9 Minor build system fixes. 2012-08-25 19:53:15 -07:00
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
Piotr Esden-Tempski f71742c5da Merging #18 pull request. Adding nvic documentation.
Merge remote-tracking branch 'ksarkies/nvic'
2012-08-25 15:10:01 -07:00
Ken Sarkies 52533a6e3d STM32F1xx: Changed markup to get more control over documentation, each
file having its own group module rather than using @file.

No code changes except for the following:

gpio: Added function to map the eventout signal plus two Remap functions
dma: Prevent changing base addresses while channel enabled (see datasheet)
pwr: Added pwr.c (new file)
timer: Removed the last function that I introduced recently; there is already
an equivalent function present. Changed some parameter names for consistency.
2012-08-20 17:19:20 +09:30
Ken Sarkies 70b2376c9f Update to doxygen comments to fix promiscuity problem (see later) 2012-08-18 13:32:48 +09:30
Ken Sarkies 0e5e451e22 Revert nvic_set_priority to original form. Minor doxygen markup changes. 2012-08-14 18:25:19 +09:30
Ken Sarkies cb07ab7c6e Merge branch 'master' into nvic 2012-08-14 14:47:22 +09:30
Piotr Esden-Tempski 3441bba1c4 Changed local build target for library and linker files.
- The library files are now being built into the lib subdirectory of the
  source.
- The linker files for each library are being copied into the lib source
  subdirectory.

Motivation: The relative locations of files in the source directory after make
are now the same as after make install now. This makes it easier to
reuse examples with their makefiles outside of the libopencm3
sourcecode directory.
2012-08-13 15:19:57 -07:00
Piotr Esden-Tempski a2c5b6391d Merging pull request #19 "STM32F timers. Doxygen markup added, and some code changes" by Ken Sarkies.
Merge remote-tracking branch 'ksarkies/timer'
2012-08-11 14:00:06 -07:00
Ken Sarkies 52fd7c7976 STM32F timers. Doxygen markup added, and some code changes:
1. Remove the extra mask (TIM_DIER(timer_peripheral) & flag)
in timer_get_flag. Not all flags in SR relate to IRQs and the flags that
do might be useful even if interrupts not enabled.

2. In a number of functions (e.g. timer_set_output_idle_state) that only
apply to advanced timers, add test for TIM1 and TIM8, as done in some others.

3. Added timer_force_event to manipulate the EG register

TBD DMA burst - can't get my head around why this would be useful.
Someone must have thought so!
2012-07-10 09:32:47 +09:30
Ken Sarkies 9cff0c962b Fix compile error 2012-07-09 17:12:27 +09:30
Ken Sarkies cba9561e89 NVIC_Set_Interrupt_Priority: change to use 4-bit fields.
(viz STM32F10xxx Cortex-M3 programming manual PM0056 and
Cortex-M3-Generic-User-Guide.pdf)

Doxygen commentary added
2012-07-09 16:54:01 +09:30
Ken Sarkies 0e02438a80 Code for DAC module STM32Fxxx series
Add prototypes to dac.h and small change to simplify alignment enum
2012-06-30 16:56:14 +09:30
Karl Palsson 83d62e9bfc Add linker scripts with memory maps for F100 series.
These definitions are a physical property of the device for most purposes.
No reason not to supply them premade.
2012-06-29 02:10:53 -07:00
Karl Palsson 450c3e00a1 Basic helper routines for CRC
Note, the CRC block is pretty useless for interoperability.  It only operates on 32bit
chunks, and in a different bit order.  No attempt to make full helpers for compatibility
with other implementations has been done.

https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FCRC%20computation&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=2006
2012-06-29 02:08:53 -07:00
Piotr Esden-Tempski 98174e4a0c Merge pull request #13 "Code for iwdg module STM32F series"
Merge remote-tracking branch 'ksarkies/iwdg-dev'
2012-06-27 14:02:02 -07:00
Piotr Esden-Tempski a70eabb3e1 Merge pull request #11 "Add helper function for max clock on HSI for f100"
Merge remote-tracking branch 'karlp/hsi_f1_24'
2012-06-27 13:58:14 -07:00
Piotr Esden-Tempski 4a17185791 Merge pull request #10 "Add Device Electronic Signature support."
Merge remote-tracking branch 'karlp/desig'
2012-06-27 13:56:55 -07:00
Piotr Esden-Tempski db505a87f7 Merging pull request #7 "Use ODR instead of IDR to toggle an output GPIO"
Merge remote-tracking branch 'schodet/gpio-toggle'
2012-06-27 13:49:26 -07:00
Piotr Esden-Tempski 3bfeeedceb Merge pull request #6 "Doxygen markup and grouping structrue"
Merge remote-tracking branch 'ksarkies/doc'

Conflicts:
	include/libopencm3/cm3/common.h
2012-06-27 13:30:45 -07:00
TitanMKD 81317c02ab * Updated GPIO added gpio_toggle() function.
* Fixed ROM to RAM Linker script (libopencm3_lpc43xx/libopencm3_lpc43xx_rom_to_ram.ld).
2012-06-25 22:12:00 +02:00