436 Commits

Author SHA1 Message Date
Karl Palsson
2c475a38d5 stm32:l0: Correctly compile as m0+, not m0.
Committed to binutils back in 2012, so even though it has no real impact, it at
least does the right thing for future compilers to make better decisions.

Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2014-11-18 21:50:10 +00:00
Frantisek Burian
f9152eb00a [stm32l0] Initial support for STM32L0 architecture, Add GPIO peripheral 2014-10-15 19:31:41 +02:00
Freek van Tienen
ac8ac8c64d [f4] Added a 25mhz clock 2014-10-15 17:27:18 +02:00
Karl Palsson
67f4f50a94 stm32: common: fix missing SPI_I2S_BASE rename regression
Fix regresion from 5d4437fe43aa68a28611e9a0aecc712833230304 where
somehow not all occurrences were replaced.  I could swear it all
compiled when I was working on it :(

Reported-by: Trevor Woerner <trevor.woerner@linaro.org>
2014-10-08 14:32:05 +00:00
Michael Spieler
50dd1c5725 stm32: gpio_toggle: ensure correct state of non-toggled pins. 2014-10-07 12:01:04 +00:00
Karl Palsson
4c190a3fa3 stm32: i2c: actually keep bit 14 set as per datasheet.
Old code did three writes, new way actually seems to follow datasheet
properly.
2014-10-07 11:25:02 +00:00
Karl Palsson
5d4437fe43 stm32/spi: Replace all SPIx_I2S_BASE with SPIx_BASE
Latest versions of all reference manuals refer to the address as SPIx_BASE, and
simply name some of the individual registers as SPI_I2SXXXX.  Likewise, the
interrupts are simply SPIx, not SPIx/I2Sx.  Rather than hacking more duplicates
into the F0 and L0 parts where this was turning up, remove the pointless _I2S_
from SPI2/SPI3 and make it all consistent

Compile tested only, with the examples collection.

Signed-off-by: Karl Palsson <karlp@tweak.net.au>

Fixes #331
Fixes #347
2014-10-07 11:21:40 +00:00
Karl Palsson
8fa7727b09 stm32f3: drop redundant gpio.c
All methods in this file are in either
* common/gpio_common_all.c
* common/gpio_common_f0234.c

Those other files have better doxygen commentary, this file should never
have been added.
2014-08-10 21:06:38 +00:00
Norbert Braun
884924d598 stm32: timers: fix mixup between TIMx_CCMR1 and TIMx_CCMR2 in timer_set_oc_mode() 2014-08-04 15:38:01 +02:00
Karl Palsson
af3389652c stm32: timers: Fix edge polarity setup
The CCxP/CCxNP bits are actually separated by a reserved bit, so the
correct mask is 0xa, (0b1010) not 0x6 (0b0110)

Reported by PyroDevil on the mailinglist
2014-07-15 13:28:02 +00:00
Karl Palsson
cf5fb002f6 [l1-flash/eeprom] Add lock/unlock/eeprom helper routines 2014-07-14 17:54:20 +00:00
Pavol Rusnak
806ebb18fa add MSC (Mass Storage Class) support 2014-07-03 18:46:55 +02:00
Felix Ruess
f6b6d62ec5 [stm32] fix dox for rcc_periph_x
closes #329
2014-06-28 02:40:36 +02:00
Felix Ruess
f49c1f264a [stm32] fix i2c_reset
rcc_periph_reset_pulse needs RST_I2Cx instead of RCC_I2Cx as argument
see also #329
2014-06-26 00:05:46 +02:00
Felix Ruess
c01f9ee323 [stm32] implement i2c_reset using rcc_periph_reset_pulse
this also adds support for I2C3 in i2c_reset
2014-06-11 12:58:05 +00:00
Karl Palsson
b37597f1db stm32/dac: Follow ref-man guidelines on GPIO config
GPIO pins should be configured for Analog IN on virtually all families
to reduce parasitic consumption.

Reported-by: Roger Wolff <R.E.Wolff@BitWizard.nl>
2014-05-19 10:29:11 +00:00
Roger Wolff
a99e3a2cd3 stm32/flash: Make comments match reality
Copy/paste commentary with wrong sizes.
2014-05-19 10:21:56 +00:00
Nikolay Merinov
ec29bd7f48 stm32l1: lcd: Basic LCD configure functions. 2014-03-11 21:44:48 +00:00
Nikolay Merinov
553a14f21d stm32l1: lcd: Define all LCD registers
Define minimal susbet of necessary functions for work with LCD screen.
2014-03-11 21:44:48 +00:00
Frantisek Burian
14f1ac4764 stm32: common: SPI: Fix spi_common_all warning
Fixes #226

This function should be deprecated in the future.
2014-03-11 21:13:03 +00:00
Frantisek Burian
bf01d890f6 [STM32F0] Add support for timers.
This commit has been based on kuldeepdhaka's pioneer work, but it was reformatted to apply libopencm3 inclusion tree correctly.

timer_common_all.c now supports new rcc_periph_reset_pulse function for all families.
2014-03-11 16:49:01 +00:00
Rick Kimball
f780075d4d add dac support to stm32 f0 2014-03-11 16:40:31 +00:00
Ken Sarkies
7816501dbc Changes to the header includes for all STM32 peripherals
to remove variations, redundancies, add missing, fix errors. All c files
refer only to the dispatch style headers in /include/stm32. Those headers
#include memorymap.h and cm3/common.h. All references to
these are removed from the family specific headers. Ethernet untouched as
it appears incomplete.

Added dummy spi.c for F0/F3. Fix some doxygen anomalies.
2014-03-11 16:40:31 +00:00
Frantisek Burian
0d08891c8d [stm32f1] Fix bad RCC_ definitions for issue #77 2014-02-24 18:44:12 +00:00
R.E. Wolff
fbf8c19ea4 stm32: dac: buffer enable bits were inverted. 2014-02-17 15:19:22 +00: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
Frantisek Burian
fc9a7260c2 [F0] Add new peripheral Clock Recovery Subsystem as defined in RM0091 Rev. 5 2014-02-07 07:46:54 +01:00
Frantisek Burian
55750d5dc6 [F0] Updated RCC module to be compatible wih RM0091 Rev. 5 2014-02-07 07:46:53 +01:00
Frantisek Burian
8d5ad52e0f Fix the stm32f0 evident bugs 2014-02-06 11:23:01 +01:00
Ken Sarkies
0af6d06eda Deduplication of flash code for STM32F0 and F1.
Extension of code for STM32F1 to allow for dual bank series XL.
Small changes to documentation for F2, F4 and L1 to add a parameter reference.

Tested with STM32F103RBT6
(note: tests show that the PG bit must be cleared after programming, otherwise
a subsequent erase attempt fails. This has been added to flash_program_half_word
for F0 and F1 only. A fix for the other families is not included in this PR.)
2014-02-06 00:52:42 +01:00
Frantisek Burian
a4d9a41093 [Style] Don't use editor droppings in files, please. 2014-02-06 00:46:05 +01:00
cmcmanis
07d0076934 Updates for STM32F429 chip
After a few rounds of review, changes are added to support
additional peripherals of the STM32F427/429
2014-02-06 00:41:52 +01:00
Karl Palsson
27bc12de61 stm32: unify bulk of adc convenience functions
This unifies stm32f1, l1, and f4 convenience functions for adc.  The code
should be useable for f2 and f37x as well, but that needs hardware for testing,
and there was no existing implementation. This is the reason for the
"adc_common_v1.c" name, as trying to put all the different families into the
common file name has become too cumbersome.

All of the deprecated routines have been dropped, they've been marked
deprecated for a very long time now, and porting them seemed unnecessary.

This has been tested on f1, l1 and f4 discovery boards, and is based on some
existing l1/f1 unification code from
https://github.com/karlp/libopencm3/tree/rme_l1_master
2014-02-05 10:39:00 +00:00
memeruiz
cf21290488 [stm32f3] Moving common f0 an f3 functions together. New init_master function. 2014-02-01 21:11:58 +01:00
Felix Ruess
8782a60b48 [stm32][f1|f3] fix adc_set_injected_sequence 2014-02-01 19:22:17 +01:00
Ken Sarkies
3c6e9fd56d Fix a number of top level doxygen issues.
So that the navigation pane works correctly in browsers.
Some additional doc fixes put in where found (but many more still to go).
Added some dummy .c and .h files to bring the associated docs into line.
makefile changed to allow 'make html' as well as 'make doc' (the latter only does html anyway).
2014-01-15 22:19:52 +01:00
Ken Sarkies
a54a12e1c9 Documentation added to flash modules for all STM32 families. 2014-01-15 22:09:36 +01:00
Piotr Esden-Tempski
a909b5ca9e [Style] Global style fix run. 2014-01-03 01:07:30 +01:00
a1ien
67efedec54 [STM32F2-F4:CRYPTO]Fix hash_set_last_word_valid_bits() 2014-01-02 22:17:46 +01:00
BuFran
52758bb8fd [Ethernet] Add support for the ethernet module STM32Fxx7 and Micrel PHY 2014-01-02 22:02:54 +01: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
molnarkares
f7620ae148 * unnecessary PG bit clearing removed from flash word and half-word programming to improve speed
* missing PG bit set is inserted at word programming
2014-01-02 21:41:33 +01:00
Onno Kortmann
fe6b542357 STM32F0: Correctly clear pll source bits. 2013-12-16 19:42:21 +00:00
Onno Kortmann
f622437cfb STM32F0: Fix PLL multiplication factor for 48MHz setup
It was set to overclocking configuration!
2013-12-16 19:37:07 +00:00
Onno Kortmann
868d65d872 STM32F0: Turn on PLL clock source when asked to
The STM32F05xxx/06xxx manual describes on p.98 (Sec 7.4.1) the RCC_CR
register, on which it says that bit 24 is the PLLON bit which has to be
enabled before using the PLL. This causes the PLL to be enabled with
rcc_osc_on(PLL).
2013-12-16 19:37:06 +00:00
BuFran
6570f6eb07 Fix the order of ADC injected channel list
According to RM0090, page 301, paragraph 11.13.12 Note. (For F4, for F1 and F3 is it in the corresponding manuals)

The JSQR are filled always ending at SQR4 ie for those lists we must set this list:

(A)       ->                               JSQ4 = A,
(A,B)     ->                     JSQ3 = A, JSQ4 = B,
(A,B,C)   ->           JSQ2 = A, JSQ3 = B, JSQ4 = C,
(A,B,C,D) -> JSQ1 = A, JSQ2 = B, JSQ3 = C, JSQ4 = D,

The readed values are in correct order, starting from JDR1:

(A)       -> JDR1 = A,
(A,B)     -> JDR1 = A, JDR2 = B,
(A,B,C)   -> JDR1 = A, JDR2 = B, JDR3 = C,
(A,B,C,D) -> JDR1 = A, JDR2 = B, JDR3 = C, JDR4 = D,
2013-12-04 22:03:23 +00:00
podhrmic
dfeeda24ba [timers] Fixed typo
- Bit shift should be 2, not 4 (see the datatsheet - TIMx_CMMR2 register)
2013-11-08 16:00:51 -07: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
Karl Palsson
a99f4fb620 [stm32] Use correct offsets for UniqueID bits
STM32L1 has a different set of offsets, not just a different base
address, so we can't have common registers definitions.  Also, out of
F0,F1,F2,F3,F4,L1, only the F1 has the odd note about 2x16bit registers
and 2x32bit registers with one 16bit register marked as "This field
value is also reserved for a future feature."  Therefore, replace the
awkward reading out as multiple words and just copy them in.

F0,F2,F3,F4 were missing definitions altogether.

This does _not_ attempt to address the problem of the mismatched base
addresses for Medium+ and High Density L1 parts.
2013-10-15 11:16:14 +00:00
Pavol Rusnak
dbb65d9f5b [stm32f2] fix missing USB symbols 2013-09-14 18:28:48 +00:00