Commit Graph

28 Commits

Author SHA1 Message Date
Marek Koza e50ce6a876 stm32l4: Correct memorymap and add the existing CAN library 2019-04-30 20:47:14 +02:00
Karl Palsson 7a27795d8c stm32: flash: pull out i/d cache support.
Copied a few times.
2018-07-29 20:31:17 +00:00
Karl Palsson da7ebafcbe stm32: flash: pull lock/unlock up to common_f.
This is a common operation, so definition in _all, and every part except
l0/l1 have the same implementation.  Bring in an _f file too.
2018-07-29 20:31:17 +00:00
Karl Palsson b23dccc7ae stm32: flash: pull up prefetch to _all
Turns out, there's lots of common code for flash.  Pull up prefetch
on/off to start with, as there's only a single bit name different.

Pull up the definitions of common API functions too, starting with
flash_set_ws.  Even if the implementations are different, things that
meant to be the same, should be defined centrally.
2018-07-29 20:31:17 +00:00
Karl Palsson bc70d3b459 add USB mass storage class code where it was ommitted
Quite a few families didn't get the usb mass storage class code added.
Add it to all devices with usb support.
2018-06-07 12:09:11 +00:00
Guillaume Revaillot bf125e91f9 stm32: rework spi, based on PR #740 and #742.
split spi stuff in three part:
 - v1 : basic spi peripheral
 - v1_frf : v1 spi with frf mode additional bit in spi_cr2 / spi_sr
 - v2 : spi with variable datasize, fifo and other fancy stuff.

v1 maps to f1 chips
v1_frf to f2, f4 and l0,l1
v2 to f0, f3 and l4

This breaks spi_master_init API for v2 devices : function prototype from
common spi header used to be abused, with DFF bit reused for CRCL bit.
New v2 spi_master_init does not handle anymore CRCL bits, as it does not
usually mess with other crc configuration.
2018-04-28 21:12:27 +00:00
Karl Palsson 1379ab4777 stm32l4: enable common exti functionality
tested on l476 disco board.
2018-03-04 00:02:44 +00:00
Bruno Randolf b438edf45d stm32:l4: Add SPI
Same as F3, tested
2018-02-13 23:57:43 +00:00
Bruno Randolf 075ef82a4b stm32:l4: Enable USB FS support
Reviewed against RM0394 and tested with STM32L433CC.
Aparently some other L4 have USB OTG.
2018-02-13 23:57:42 +00:00
Bruno Randolf de39ab1584 stm32:l4: Add CRS
Reviewed against RM0394, untested
2018-02-13 23:57:42 +00:00
Bruno Randolf 0cd92c31d6 stm32:l4: Add RTC
Use common, some additional registers missing
2018-02-13 23:57:42 +00:00
Bruno Randolf c90c9fe801 stm32:l4: Add IWDG
Same as F3, reviewed against RM0394, tested
2018-02-13 23:57:42 +00:00
Karl Palsson 55ea31fd04 stm32l4: crc-v2: enable common code
Possible now that the v2 unification code has landed.
2018-02-13 23:57:42 +00:00
Bruno Randolf 7b6710a914 stm32:l4: Add DMA
Same as L1 according to L1-L4 migration guide, untested
2018-02-13 23:57:42 +00:00
Karl Palsson f67966046a stm32:l4: enable usart peripheral
Tests in https://github.com/karlp/libopencm3-tests/tree/master/tests/uart-basic
2017-10-25 23:54:32 +00:00
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 59ef83a440 stm32: l0/l4: add i2c support
According to reference manuals both l0 and l4 have "v2" i2c peripheral.
This patch adds i2c support to l0 and l4 using previously unified "v2" i2c
headers and implementation.

No real hardware has been tested so far. Only compilation tests for both
libopencm3 and libopencm3-examples for all stm32 families.

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
2017-03-30 21:48:07 +00:00
Karl Palsson 05829037de stm32:rng: add common v1 to l0,l4,f7
This is a common peripheral based on reference manual inspection.
2017-03-30 21:48:07 +00:00
Karl Palsson 0b84540ecb stm32l4: add common timer code. 2016-03-30 16:59:57 +00:00
benjaminlevine 69a3ba6e2a stm32l4: flash: support basic core operations
Heavily reformatted by: Karl Palsson <karlp@tweak.net.au>
Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2016-03-30 16:59:57 +00:00
Karl Palsson 97d644c4d3 stm32l4: rcc: Add core functions
Based on STM32L1, and rather a lot of duplication unfortunately.
2016-03-30 16:59:57 +00:00
benjaminlevine d60fd7ca94 stm32l4: pwr: basic core functionality
Only support for voltage range setting.

Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2016-03-30 16:59:57 +00:00
Karl Palsson 1755098617 stm32: adc-v2: pull up voltage regulator control.
L4 and F3 actually have the same bits to write in the same order, but F3 hides
the name of the deep power down bit.  Keep the like that for now, but there's a
standard API for enabling and disabling the regulator.
2016-03-30 16:59:56 +00:00
Karl Palsson f9b2ffe8cf stm32l4: adc-v2: enable sampling time setting
Link in the "multi" extensions to the adc-v2 periperhal code.
2016-03-30 16:59:56 +00:00
Karl Palsson 697c975dde stm32l4: adc: Initial support for the adc-v2 periph
Now that there's an adc-v2 peripheral layer, we can just use it straight away
for L4.
2016-03-30 16:59:56 +00:00
Karl Palsson f14c678ccb stm32l4: add gpio support
Just the basic core common functionality gained for free by being a common
peripheral.  Enough for a miniblink.

Fixes some errors in the GPIO memory map.  ST's naming of AHB2 vs AHB3 is
confusing.
2015-11-13 02:13:31 +00:00
Karl Palsson 8afc983f3e stm32l4: Add RCC definitions
Bring in the core common code, and now that it's used, pull in the common
memorymap
2015-11-13 01:15:17 +00:00
Karl Palsson 507c184456 stm32l4: initial memorymap and vector support
Values from RM0351rev1, with the correction of the duplicate TIM1_CC entry.

Only stub support so far, but this opens up the beginning of build testing.
2015-11-10 23:47:57 +00:00