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).
6 years ago
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.
6 years ago
ALeX Kazik
8064f6d0cb
stm32f4: fmc: add missing DECLS wrappers
Function prototypes need DECLS wrappers for inclusion in c++/asm
6 years ago
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)
6 years ago
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.
6 years ago
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 ...
6 years ago
Harold Tay
9cadd60b3c
stm32: rtc: Fixed typo in macro def (RTC_DR_MT_MASK)
6 years ago
Guillaume Revaillot
708fe1516c
stm32: fix nvic channels name to match dma1/2 on stm32f09x
7 years ago
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)
6 years ago
Karl Palsson
33387e8f96
stm32f0:adc: add missing declaration
fixes: 7e1d3daa
stm32f0: adc: API call to clear EOS flag
6 years ago
Karl Palsson
4edba3111d
common: support inclusion into assembly files
Suggested in https://github.com/libopencm3/libopencm3/pull/981
6 years ago
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
6 years ago
Alfred Klomp
1adc418f9a
stm32f42/f43: rcc: add 180 MHz clock options
6 years ago
Karl Palsson
8b13977ea0
stm32f0: add DMA1 compatibility alias
6 years ago
Alfred Klomp
b7a9968e4f
fixup! stm32f09: add register definitions for DMA2
6 years ago
Alfred Klomp
a9c0008290
stm32f09: add register definitions for DMA2
6 years ago
Alfred Klomp
53347c266b
stm32f09: add register definitions for USART5..8
6 years ago
Karl Palsson
3af05fb862
stm32f7: spi: fix include error
Badly splitting commits.
Fixes: 2619a45
stm32f7: use spi v2 peripheral
6 years ago
Karl Palsson
1883a4311f
msp432: whitespace fixups spaces->tabs
whitespace only change.
6 years ago
Dmitry Rezvanov
a63d0499de
msp432/e4: Add GPIO support
6 years ago
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.
6 years ago
mfm
f6517f7816
stm32: adc common v2: add circular dma mode
Tested only on the F3 so far.
7 years ago
Karl Palsson
bc7e454741
stm32f7: include common dma code
Originally reported at https://github.com/libopencm3/libopencm3/pull/978
6 years ago
Guillaume Revaillot
18eadcfda5
stm32: timer_common: add timer21-22, found on stm32l0 chips.
stm32l0 devices have tim21 and tim22.
6 years ago
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
6 years ago
Karl Palsson
6b0fd864a1
stm32f7: fix RCC_APB1 defns for USART7/USART8
The reset and low power definitions for USART7/USART8 were correct, but
not the primary enable registers.
Fixes: https://github.com/libopencm3/libopencm3/issues/969
6 years ago
Karl Palsson
0d7f1f7708
stm32: f24: dma: clarify stream/channel
It's always stream on the "new" dma controller (unless it's channel....)
Fix a couple of inconsistent prototypes that had carried over from f1
originally. Reported by vampi on irc.
6 years ago
Karl Palsson
9ddafa6284
stm32f7: enable common timers support
7 years ago
Karl Palsson
cae295ee2c
doc: cm3/scb+scs: turn on existing documentation
Lots of registers were already documented extensively. Turn it all in
doxygen with groups and the right syntax.
6 years ago
Karl Palsson
1ad2cda496
doc: add all cm3 headers to doxygen.
Just get them all included as they are. Gets them grouped up and
visible so we can start clarifying the rest of their docs.
6 years ago
Clara Casas
889b7de0d7
stm32: adc: Add functions to get and clear flags
This includes adding documentation to the status flags.
Originally tracked at: https://github.com/libopencm3/libopencm3/pull/833
Modified to drop whitespace changes, and simply boolean return.
7 years ago
Daniel Gröber
743513a4b1
stm32: add dma_get_number_of_data
Original discussion at: https://github.com/libopencm3/libopencm3/pull/702
8 years ago
Karl Palsson
824beaa472
lm4f: timers: add basic register definitions
Add the timers to the memory map and the basic registers at least.
6 years ago
Florian R. Hölzlwimmer
f3c620b51b
stm32f7: spi: include common code
6 years ago
Karl Palsson
22754f0919
usb: provide lm4fusb driver reference
We provided references for all the others, provide it for the lm4f
driver too.
6 years ago
David Lamparter
ebcf197810
usb: make usb_disconnect() weak
usb_disconnect() is board/platform specific for chips that don't have
built-in handling for this. Allow the application to provide its own
version of usb_disconnect() to handle this.
See https://github.com/libopencm3/libopencm3/pull/924
7 years ago
David Lamparter
343cff4675
usb: make strings "const char * const *"
This allows the pointer table to be in Flash, by using
"static const char * const strings[] = { ... };"
See https://github.com/libopencm3/libopencm3/pull/924
7 years ago
Karl Palsson
fa7a908027
doc: msp432/e4: Fix groupings for doxygen
Proper closing tags, an outer grouping, and don't refer to missing
groups.
6 years ago
Dmitry Rezvanov
2adefd95fe
msp432/e4: new target
Basic memory map and system control.
Originally tracked via: https://github.com/libopencm3/libopencm3/pull/946
6 years ago
Karl Palsson
0c91dbf57e
cm3: scs: drop (superseded) helper macros for systick
These are superseded by cm3/systick.h and the functions there.
Reported originally under: https://github.com/libopencm3/libopencm3/issues/125
6 years ago
Karl Palsson
cfe514913f
cm3: scs: drop (superseded) dwt macros
They are all superseded by dwt.h, and the function dwt_enable_cycle_counter
Fixes https://github.com/libopencm3/libopencm3/issues/125
(But only for the cycle count enabling)
6 years ago
Karl Palsson
6fa75afbc6
usb: add USB_REQ_TYPE_OUT to match USB_REQ_TYPE_IN
#defines are free.
Fixes https://github.com/libopencm3/libopencm3/issues/515
6 years ago
Jordi Pakey-Rodriguez
21b23f1ff1
stm32f4: adc: Add VBat sensor enable/disable
Original discussion at: https://github.com/libopencm3/libopencm3/pull/770
8 years ago
Karl Palsson
0787675332
st32l1: adc: there is no adc_chan_vbat on L1x.
6 years ago
Karl Palsson
0e58ee2f65
stm32: support i2c3 properly
I2C3 is on many parts, but wasn't properly supported with the register
definitions. Declare them centrally, just depending on the memorymap
defining them. On some parts, the rcc bits were defined, but not the
base registers.
Fixes: https://github.com/libopencm3/libopencm3/issues/820
6 years ago
Karl Palsson
b8ede60d9d
stm32f3: flash: support basic write/erase operations
Originally filed as https://github.com/libopencm3/libopencm3/pull/627
6 years ago
Karl Palsson
3293913be2
stm32f3: flash: add clear write protect flag
Could actually move to flash_common_f, but they have different names for
the same bit at present.
6 years ago
Karl Palsson
f4bbe7c5bb
usb: prevent registering duplicate config callbacks
Originally discussed at https://github.com/libopencm3/libopencm3/pull/722
6 years ago
Karl Palsson
49a8c041ff
stm32f3: comparator: fix doxygen and use standard mask/shifts
Convert to standard style of unshifted field values.
6 years ago
Markus Kasten
0d0f59d8ce
stm32f3: add comparator register definitions
6 years ago