Commit Graph

50 Commits

Author SHA1 Message Date
Karl Palsson b860319785 make: use std=c99 everywhere by default.
setting "STANDARD_FLAGS=-std=c11" or similar will let you try out
alternate compilation modes.

Fixes https://github.com/libopencm3/libopencm3/issues/773
2017-06-08 23:01:45 +00:00
Sergey Matyukevich ef91856ac1 stm32: unify i2c implementations
The f1, f2, f4, l1 chip families have a similar "v1" i2c peripheral on board.
More recent f0, f3, l0, l3 chip families share another "v2" version  of i2c.

This patch unifies headers and implementation for two types of i2c peripherals:

- rename: i2c_common_all.[ch] to i2c_common_v1.[ch]
- remove i2c_common_f24.h: extra I2C blocks are defined in specific headers
- use f3 i2c code as a basis for common "v2" i2c implementation
- add f0 i2c support: use "v2" i2c implementation

Tests:
- tested on a custom f0 board
- compile-tested both libopencm3 and libopencm3-examples for all stm32

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
2017-03-30 21:48:07 +00:00
Karl Palsson 2476099f29 stm32:rng: f4 rng peripheral is common with at least f2
Pull it up as common code immediately. Rename to v1, extract to common
with a doxygen marker stubs, add to F2 makefiles.
2017-03-30 21:48:07 +00:00
Karl Palsson 614c700edb stm32f0: timers: input capture support rising/falling edges
This is common code for f0234, keep renaming files as has become standard, even
if it's a suboptimal solution.  This doesn't rename the header which was not
renamed for f3.

Reported-by: https://github.com/gtoonstra
2016-08-15 21:10:03 +00:00
Tido Klaassen aad8d06c3f make: rename CFLAGS in target Makefiles to TGT_CFLAGS
Renamed every instance of variable CFLAGS in target specific Makefiles
to TGT_CFLAGS to free up CFLAGS for user defined compiler flags.

Added information in README.md about existence and usage of CFLAGS
environment variable in build process.
2015-10-11 19:14:25 +00:00
Karl Palsson 6d658c20b8 make: use shared DEBUG_FLAGS (-gdb3) by default
-ggdb3 make slightly bigger .elf files, but allows gdb to understand
macros, which libopenocm3 uses somewhat extensively.  Make this the
default, and pull it up to the common base makefile, so it can be easily
substituted.
2015-05-04 13:45:07 +00:00
Pavol Rusnak 4b8f6e01ab stm32: f2: Add missing desig.o to Makefile
Basically the same as ad937e00fd but for stm32/f2
2015-01-31 11:24:50 +01:00
Pavol Rusnak 806ebb18fa add MSC (Mass Storage Class) support 2014-07-03 18:46:55 +02:00
Frantisek Burian 6de1b50c4e [BUILD] Fix the correct make behavior if compiling inside tree
On linux, the output of CP rule was try to write to / which is - of course, forbidden for write.

This solution adds to each part of lib correct pointer to the root of lib where the libs should be written.

Bug found by Kuldeep Singh Dhaka.
2014-02-12 15:27:03 +00:00
BuFran 723e1a69bd Better method of reset and clock handling with RCC, support L1, F1, F2, F3, F4 2014-01-02 22:00:11 +01:00
Karl Palsson 5cbf5619a1 [stm32] Unify f0/f3 SPI and correct all makefiles
The common code wasn't being included in L1 builds, even though the headers now
included the correct definitions.

This combines the two f0 and f3 spi files, which previously differed only in
the number of spi peripherals defined.

Files were renamed to the full "l1f124" style, not because I like it, but
because it's the convention we have, so it's best to apply it rigourously.

Tested on L1 and F100 boards, compile tested only for others, but the examples
repository all compiles too.  (Though the lack of SPI examples for all
platforms was how this broke in the first place)
2013-11-07 21:50:48 +00:00
Pavol Rusnak dbb65d9f5b [stm32f2] fix missing USB symbols 2013-09-14 18:28:48 +00:00
BuFran 1345a3403c [STM32F0:EXTI] Add prelimnary support of exti, common file now in common directory 2013-08-22 17:18:39 -07:00
BuFran 4bb18baa59 [STM32F0:RTC] Renamed common files to be consistent to file naming scheme 2013-08-22 17:18:38 -07:00
BuFran eb7d29e115 [STM32F0:GPIO] File renamed to meet the content 2013-08-22 17:18:36 -07:00
Alexandru Gagniuc 52d34c814b Global: Allow overriding float-abi flags
We currently default to "-mfloat-abi=hard -mfpu=fpv4-sp-d16" for M4F cores, and
and variations of "-mfloat-abi=soft" for the others. Keep the M4F default, and
move others to no FP flags for consistency, but allow overriding these flags
via the FP_FLAGS environment variable.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-07-07 18:59:33 -07:00
Piotr Esden-Tempski 7085867db6 [STM32F3] Split timer common f24 into f234 and f24. 2013-07-07 16:01:52 -07:00
Piotr Esden-Tempski 201c2706b5 [STM32] Removed exti.c from f1 and made global exti.c usable.
Because most changes are internal to a function in exti.c I am leaving
the macro checks in there, otherwise we would end up with a bunch of
code duplication if we used the dispatch system used otherwise
throughout the stm32 part of the library. I bet it could be split up
into more granular functions resulting in more generic code that we
could run through the dispatch system. But I am leaving that as an
excersize for later.
2013-07-07 16:01:52 -07:00
Piotr Esden-Tempski 590135b65f [STM32F3] Moved all F3 specific functions out of common. 2013-07-07 16:01:51 -07:00
Piotr Esden-Tempski 18da63879c [STM32] Rename the f0124 files to f124.
We don't support f0 yet so let's not fool anyone. We may rename those
files back again if when we cross check that it is actually true this
file supports f0.
2013-07-07 16:01:51 -07:00
Piotr Esden-Tempski ebb058825f [STM32F3] Removed all specific F3 stuff out of common files. 2013-07-07 16:01:51 -07:00
Piotr Esden-Tempski f8734dfcd3 [STM32F3] Move the f3 specific stuff out of common. 2013-07-07 16:01:50 -07:00
Federico Ruiz Ugalde efe08e4898 stm32f3: flash_common_f24 now includes f3 support. Also, renamed to f234.
- Makefiles of other stm32s updated accordingly.
- f3/rcc.c updated to some definition changes.
- f3/flash.c removed in order to use flash_common_f234.c to comply with new organization.
2013-07-07 16:01:49 -07:00
Federico Ruiz Ugalde 3af5833b83 Initial support for stm32f3. Changes in makefiles, gpio.
- Makefiles now include building f3 src directory.
- Gpio support added. gpio_common_f24 changed to support also f3.
- f3 still not compiling, but f2 compile not broken (probably also f4).
2013-07-07 16:01:45 -07:00
BuFran 035c67ced6 Add preliminary support for Cryptographic coprocessor on stm32 F2 and F4 2013-06-30 21:20:42 -07:00
Mikhail Avkhimenia 15e35d5bc1 [stm32] Added basic support for hash processor
Added hash processor register definitions and main functions. Hash
processor is supported in stm32f21, stm32f41 and stm32f43 and can be
used to calculate Md5 and Sha1.
2013-06-02 18:23:49 -07:00
Fergus Noble b039504494 Moving stm32 f2/f4 flash code into the common area. 2013-05-10 18:34:55 -07:00
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
Piotr Esden-Tempski b0233ae6fb Added more warning CFLAGS to all makefiles. 2013-02-26 16:42:20 -08: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
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 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
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
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
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 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
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
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 789ae97212 Some additional LGPL3+ license change cleanups.
Changed the license to LGPL3+ for some makefiles that got ommited in the
previous big patch commit.

Corrected a find and replace error in a linker file.
2012-03-02 15:39:15 -08:00
Stephen Caudle d9a76c75c2 Add timer support for STM32F2 & STM32F4 2011-11-02 14:26:36 -04:00
Stephen Caudle eb47f0cfc0 Add SCB from stm32f1 2011-10-30 17:42:49 -04:00
Stephen Caudle 1dc4645732 Update makefiles to reflect stm32 lib folder name changes 2011-10-30 17:42:49 -04:00
Stephen Caudle b3a710b0bc Rename stm32 lib folders to be consistent with include 2011-10-30 17:42:49 -04:00