Commit Graph

2367 Commits

Author SHA1 Message Date
Ettore Zaffaroni d8cbe961f2 .gitignore more files for eclipse
Makes it easier to work with in the current CubeMX IDE
2019-05-09 11:32:36 +00:00
Marek Koza e50ce6a876 stm32l4: Correct memorymap and add the existing CAN library 2019-04-30 20:47:14 +02:00
M J Oldfield fc8a6aa7a2 stm32: adc-v2: set _only_ the ADC calibration bit
In adc_calibrate_async() we should only set the ADCAL bit and leave the rest alone.

While in the past there were only "rs" bits in this register, this is no
longer the case.

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2019-04-28 00:11:56 +00:00
Karl Palsson f5d2d8f109 stm32f7: sort makefile object list alphabetically 2019-04-15 13:12:31 +00:00
Ross Schlaikjer 4fb67d891f stm32f7: enable existing ethernet libraries 2019-04-15 13:11:05 +00:00
Ross Schlaikjer 1290e3129d stm32f7: enable existing CAN library 2019-04-15 13:10:59 +00:00
Ross Schlaikjer 395c024458 stm32f7: enable existing syscfg headers 2019-04-15 13:10:48 +00:00
Ross Schlaikjer a92a44a7c2 stm32f7: enable existing CRC support 2019-04-15 13:10:37 +00:00
Ross Schlaikjer 0173ecec9c stm32f7: enable existing IWDG support 2019-04-15 13:10:21 +00:00
Karl Palsson 72a7284355 doc: hook up gd32f1x0 documentation
Super easy now thanks to the earlier changes.
2019-04-15 13:06:48 +00:00
Guillaume Revaillot bdc38eed16 doc: attempt to get rid of doxygenlayouts and doxyfiles.
Generate doc root doxygenlayout file, as well as devices stuff, based on main
Makefile $(TARGETS) and template files. Avoids painfull sync/merge of 20 files+
when adding a new device.
bonus : allow to build only one device doc easily (make TARGETS=stm32f0 doc)

regression: we currently loose device "fancy" naming as device name is
guessed (toUpper()..) from folder name.
2019-04-15 12:41:21 +00:00
Guillaume Revaillot ebe8c4a66c Makefile: pass TARGETS to doc Makefile. 2019-04-15 12:41:21 +00:00
Ross Schlaikjer 4db40e0839 stm32f7: Include i2c_common_v2
With the addition of a define for I2C4, the existing common i2c
functions seem to work out of the box on the F7 (tested on an
STM32F750).
2019-04-04 22:11:20 +00:00
Karl Palsson edb39d43ee HACKING: update link to kernel code style doc
Old link was broken.

Reported-as: https://github.com/libopencm3/libopencm3/pull/1035
2019-04-04 21:06:03 +00:00
Icenowy Zheng 330d5fd5be gd32: add new chip series f1x0
GD32F1X0 (X can be 3, 5, 7 and 9) is a series of Cortex-M3 MCUs by
GigaDevice, which features pin-to-pin package compatibility with
STM32F030 MCU line. F150 adds USB support to F130, and F170/F190 adds
CAN support.

Currently the code mainly targets GD32F130 and F150 chips. Some register
are different between F130/150 and F170/190, just like the difference
between STM32F1 Performance line and Connectivity line.

From the perspective of registers and memory map, GD32F1X0 seems like a
mixture between STM32F1 and STM32F0 (because it is designed to be
pin-to-pin compatible with F0, but with Cortex-M3 like F1). A bunch of
code are shared between STM32 and GD32, and these code are specially
processed to include the GD32 headers instead of STM32 headers when meet
GD32F1X0.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
gd32/rcc.[ch] are forks of stm32f1/rcc
gd32/flash.[ch] are forks of stm32f0/flash
No attempts at deduplicating this have been done at this stage.  We can
see where they move in the future.
2019-04-03 12:53:33 +00:00
Karl Palsson d109a1ddeb readme: fix link to template
Fixes: https://github.com/libopencm3/libopencm3/issues/1033
2019-04-02 12:48:10 +00:00
Mike Szczys 0fd4f74ee3 stm32f1: adc: fixed deprecated/broken example code 2019-02-09 16:47:52 -06:00
ALeX Kazik 8064f6d0cb stm32f4: fmc: add missing DECLS wrappers
Function prototypes need DECLS wrappers for inclusion in c++/asm
2019-01-31 09:59:59 +00:00
Guillaume Revaillot c4c0d14ea4 stm32: exti: stm32g0 have enhanced EXTI_[FR]PR regs instead of EXTIR_PR, use them if defined.
Make exti_get_flag_status and exti_reset_request use EXTI_RPR and EXTI_FPR if present instead of EXTI_PR.

This is less precise than offered by the RPR/FPR registers, but makes
for a consistent experience in the common API.

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2019-01-31 09:57:46 +00:00
Guillaume Revaillot b98dd8eee0 stm32: exti: exti_select_source: rework and use EXTI_EXTICR.
EXTICR on stm32g0 is in exti registers range. Previous chips used to have that
gpio port exti mux configuration accessible via AFIO_EXTICR or SYSCFG_EXTICR.

Also, the new chip now use 8 bits coded value instead of previously 4 for the
extcr mux selection value (see AFIO/SYSCFG/EXTI_EXTICR_FIELDSIZE)

Let's define two helpers:  EXTICR_SELECTION_REG (to get proper AFIO/SYSCFG/
EXTI_EXTICR register) and EXTICR_SELECTION_FIELDSIZE (to get proper AFIO/SYSCFG/
EXTI_EXTICR_FIELDSIZE value), and use it them exti_select_source to determine
exticr mux selection bits shift and mask.
2019-01-31 09:57:46 +00:00
Guillaume Revaillot 553c876fa5 stm32: exti: define AFIO/SYSCFG_EXTICR_FIELDSIZE for all chip.
While on all current chips, exticr gpio port mux selection is coded on 4 bits,
stm32g0 EXTI_EXTICR register uses 8 bits.  Align all exti header to reference
that value (was previously defined for f0 as SYCFG_EXTICR_SKIP)
2019-01-31 09:57:43 +00:00
Guillaume Revaillot 7afd86db30 stm32l[01]: flash common: add flash_unlock_acr, allowing to unlock FLASH_ACR RUN_PD bit.
flash_unlock_acr allows to unlock RUN_PD bit from FLASH_ACR register. Relock is done automatically
when writing 0 to RUN_PD, so no flash_lock_acr method.
2019-01-31 09:35:55 +00:00
Guillaume Revaillot 74f460feac stm32f0: adc: fix doc. 2019-01-25 15:25:11 +01:00
Guillaume Revaillot ff9664389b stm32: exti: move register definition of all current stm32 devices to common_v1
Preparation for stm32g0 support, as this chip's exti register map evolved and is
no longer common ...
2019-01-18 18:33:55 +01:00
Harold Tay 9cadd60b3c stm32: rtc: Fixed typo in macro def (RTC_DR_MT_MASK) 2019-01-18 10:32:43 +00:00
Guillaume Revaillot 708fe1516c stm32: fix nvic channels name to match dma1/2 on stm32f09x 2019-01-18 10:31:32 +00:00
Guillaume Revaillot b725a793bf doc: align doc, add missing entries in layouts. 2019-01-17 16:35:50 +01:00
Karl Palsson 9551da6b6b devices.data: add stm32l15xx E series
Bigger brother parts, such as the l152re nucleo64 board.
2019-01-16 22:25:01 +00:00
Darrell Harmon 718f86935a EFM32 I2C: fix base undeclared
libopencm3/include/libopencm3/efm32/common/i2c_common.h:234:29: error: 'base' undeclared (first use in this function)
 #define I2C0_CTRL  I2C_CTRL(base)
2019-01-14 11:51:08 +00:00
Karl Palsson 33387e8f96 stm32f0:adc: add missing declaration
fixes: 7e1d3daa stm32f0: adc: API call to clear EOS flag
2019-01-12 22:19:49 +00:00
Karl Palsson 4edba3111d common: support inclusion into assembly files
Suggested in https://github.com/libopencm3/libopencm3/pull/981
2019-01-11 23:09:27 +00:00
Karl Palsson 72e449f529 stm32f3: rcc: fix typo in PLL clocks for APB1
Reported by jabjoe on irc, fixed by zyp
2019-01-10 14:42:54 +00:00
Karl Palsson ad10e96811 stm32l4:dma: add Channel Selection defines
Far from complete support for the channel selection systems on f0/l4,
but at least brings in the defines needed for doing this yourself.

Fixes https://github.com/libopencm3/libopencm3/issues/1001
2018-12-30 21:03:40 +00:00
Patrick Yeon 7e1d3daa11 stm32f0: adc: API call to clear EOS flag 2018-12-06 18:40:30 -08:00
Alfred Klomp 1adc418f9a stm32f42/f43: rcc: add 180 MHz clock options 2018-11-12 21:41:05 +00:00
Alfred Klomp f0e5c73d98 stm32: pll: disable before configuring 2018-11-12 16:49:56 +01:00
Karl Palsson 8b13977ea0 stm32f0: add DMA1 compatibility alias 2018-11-09 15:34:58 +00:00
Alfred Klomp b7a9968e4f fixup! stm32f09: add register definitions for DMA2 2018-11-06 18:48:18 +01:00
Alfred Klomp a9c0008290 stm32f09: add register definitions for DMA2 2018-11-06 12:58:36 +01:00
Alfred Klomp 53347c266b stm32f09: add register definitions for USART5..8 2018-11-06 11:35:40 +01:00
Karl Palsson 3af05fb862 stm32f7: spi: fix include error
Badly splitting commits.

Fixes: 2619a45 stm32f7: use spi v2 peripheral
2018-10-23 21:43:29 +00:00
Karl Palsson 1883a4311f msp432: whitespace fixups spaces->tabs
whitespace only change.
2018-10-23 21:33:16 +00:00
Dmitry Rezvanov a63d0499de msp432/e4: Add GPIO support 2018-10-23 21:21:54 +00:00
Karl Palsson 2619a4506c stm32f7: use spi v2 peripheral.
F7 indeed has v2 peripheral, not the v1.  Distinguishing figure is the
8/16bit fifo.
2018-10-23 21:21:42 +00:00
Karl Palsson 076cd67530 stm32: spi-v2: Frame format is available for all.
All spi v2 peripherals include the Motorola/TI Frame formatting options
introduced with F2.
2018-10-23 21:21:36 +00:00
mfm f6517f7816 stm32: adc common v2: add circular dma mode
Tested only on the F3 so far.
2018-10-20 11:46:47 +00:00
Karl Palsson bc7e454741 stm32f7: include common dma code
Originally reported at https://github.com/libopencm3/libopencm3/pull/978
2018-10-20 11:40:38 +00:00
Guillaume Revaillot 18eadcfda5 stm32: timer_common: add timer21-22, found on stm32l0 chips.
stm32l0 devices have tim21 and tim22.
2018-10-06 09:53:54 +00:00
Filip Moc 4b16af6e24 stm32: iwdg: correct calculation for all ranges.
The original calculations miscalculated ranges such as
512..639 or 1024..1151 or ... or 32768..32895

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2018-10-05 23:31:52 +00:00
Karl Palsson 239b4a4704 stm32f7: add irqs from latest ref manuals
Updated from RM410 rev4, RM0385rev8 and RM0431 rev3

Originally reported at https://github.com/libopencm3/libopencm3/issues/974
2018-10-03 17:12:42 +00:00