1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

191 Commits

Author SHA1 Message Date
84f9f63ab8
cpu/stm32_common: implement low-power modes for F7 2019-03-21 19:39:16 +01:00
679fee7f9c
cpu/stm32_common: implement low-power modes for L4 2019-03-21 19:39:15 +01:00
d7b3091abc
Merge pull request #9521 from OTAkeys/pr/stm32f0_pm
cpu/stm32f0: add periph_pm support
2019-03-19 18:26:00 +01:00
Vincent Dupont
7590d528b8 cpu/stm32f0: add pm_layered support 2019-03-19 17:53:12 +01:00
Vincent Dupont
e83f27140a cpu/stm32_common: refactor pm implementation 2019-03-19 17:51:19 +01:00
Yegor Yefremov
ca8f74a0b0 cpu/stm32_common: use correct data bits macro
USART_CR1_M combines both USART_CR1_M0 and USART_CR1_M1 macros
affecting bits 12 and 28 on 7 data bits capable UARTs. Whereas
for other UARTs USART_CR1_M macro affects only bit 12.

This patch fixes wrong data bits usage on 7 data bits capable
UARTs with using USART_CR1_M0 macro for modes 8-E-x and 8-O-x.

It also simplifies bits unsetting as USART_CR1_M macro clears
all data bits related bits for both UART types.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-03-17 18:58:34 +01:00
francisco
e254235265 cpu/stm32_common: set ULP and regulator LP during stop/standby 2019-03-13 09:57:21 +01:00
francisco
4dda8abecb cpu/stm32l1: add support for STOP & STAND_BY mode 2019-03-13 09:57:17 +01:00
francisco
78c77c497a cpu/stm32_common: remove WKUP2 pin enable 2019-03-12 16:34:44 +01:00
Yegor Yefremov
97d0851de1 cpu/stm32_common: fix UART documentation
Don't include overridden typedefs into doxygen as otherwise,
they'll appear twice.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-02-06 12:46:27 +01:00
Yegor Yefremov
60f745a033 cpu/stm32_common: add support for uart_mode routine
Add support for specifying data bits, stop bits and parity at
runtime.

Introduce feature periph_uart_modecfg for uart_mode() till all
other CPUs implement it.

STM32 L1, F1, F2, F4 supports following modes:

* 7E1, 7E2
* 7O1, 7O2
* 8N1, 8N2
* 8E1, 8E2
* 8O1, 8O2

STM32 L0, L4, F0, F3, F7 supports following modes:

* 6E1, 6E2
* 6O1, 6O2
* 7E1, 7E2
* 7O1, 7O2
* 7N1, 7N2
* 8N1, 8N2
* 8E1, 8E2
* 8O1, 8O2

Use USART_CR1_M1 macro to detect 7-bit support because
even inside one family there could be devices that don't
support 7-bit mode. So just using a family macro is not
enough.

As stated in the datasheets for L0, L4, F0, F3, F7 devices,
data bits can only be changed when UART is disabled (UE=0).
Introduce uart_stop() routine to satisfy this requirement.

STM32 UART adds parity to the MSB of a byte to send. The same
also applies to the received bytes. As a result this bit must
be masked in order to get the pure data.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-01-31 14:15:20 +01:00
86c102e85b cpu/stm32_common: move dma attribute at end of config 2019-01-08 09:32:18 +01:00
Vincent Dupont
8c99edc18e cpu/stm32_common: fix UART ISR_TXE usage 2019-01-08 09:32:18 +01:00
Vincent Dupont
021697ae94 cpu/stm32_common: adapt DMA driver for f0/1/3/l0/1/4 2019-01-08 09:32:18 +01:00
b2c3df3381 cpu/stm32/gpio: power up port G with L4
Co-authored-by: Vincent Dupont <vincent@otakeys.com>
2018-12-27 14:15:25 +01:00
8449324cf8
Merge pull request #10610 from MrKevinWeiss/pr/fix/stmi2c1
cpu/stm_common: Refactor and cleanup i2c_1
2018-12-21 14:55:35 +01:00
Vincent Dupont
5e67986775 cpu/stm32_common/pm: use CPU_LINE for L053-specific code 2018-12-21 11:24:43 +01:00
MrKevinWeiss
f3b2a62c67 cpu/stm_common: Refactor and cleanup i2c_1
Refactor to use common read_regs.
Add error reporting and handling for unsupported low level commands.
Document hardware constraints.
2018-12-20 18:05:11 +01:00
ab061c4ae2
Merge pull request #10608 from MrKevinWeiss/pr/fix/stmi2c2
cpu/stm_common: Refactor and fix implementation for i2c_2
2018-12-20 13:51:39 +01:00
MrKevinWeiss
a2e059d18a cpu/stm_common: Refactor and fix implementation for i2c_2
Refactors i2c_2 to match the structure of i2c_1 better.
Corrects functionality issues.
Allows the common implementation of read_regs and write_regs.
Documents constraints of hardware.
Matches error messages with API.
2018-12-20 12:01:06 +01:00
Sebastian Meiling
c96021b039
Merge pull request #10637 from aabadie/pr/cpu/stm32_periph_gpio_common
boards*: move periph_gpio and periph_gpio_irq features from boards to cpu for STM32
2018-12-19 13:06:17 +01:00
Leandro Lanzieri
b32da1b13e
Merge pull request #10615 from MrKevinWeiss/pr/debug/init
cpu/stm32_common/uart: Prevent uart from sending if not initialized
2018-12-19 12:14:00 +01:00
da3bb42d18 cpu/stm32_common: define periph_gpio/irq features at cpu level 2018-12-18 21:50:34 +01:00
MrKevinWeiss
96f8438ea2 cpu/stm32_common/uart: Prevent uart from sending if not initialized
Due to the stdio getting called after periph_init the uart may send before initialized.
This adds a simple check so the uart does not get into a locked-up state.
2018-12-18 10:16:50 +01:00
Martine Lenders
a3864aa103
Merge pull request #9158 from aabadie/pr/periph/stm32_lpuart
cpu/stm32-common: add support for lpuart
2018-12-17 12:16:27 +01:00
MrKevinWeiss
d7eb070eb4 cpu/stm32f1: Add remap support for stm32f1 cpus and boards
This commit fixes configuration problems when trying to use i2c pins that need to be remapped.
All B8 and B9 pins for STM32F1 need to be remapped, so a check is done if the remappable pins are selected.
2018-12-14 09:16:37 +01:00
133968ce8a cpu/stm32_common: add support for lpuart 2018-12-13 12:39:00 +01:00
MrKevinWeiss
3e1fd9f494 cpu/stm32_common/i2c: Fix error handling in i2c_1.c
Errors flags could not clear making the i2c unusable after error.
This fix removes the error check in start so the error flags can clear and does proper checking for status bits before _bus_check.
2018-10-26 09:56:35 +02:00
e9a6ebc409 cpu: drivers/eeprom: refactor periph_eeprom implementation 2018-10-16 10:39:10 +02:00
Peter Kietzmann
b2c791c6cb
Merge pull request #10135 from miri64/cpu/enh/periph-gpio-irq-closing-endif
cpu, periph_gpio: mark closing #endif for MODULE_PERIPH_GPIO_IRQ
2018-10-15 13:41:02 +02:00
cladmi
e0a5860bb7
cpu/stm32_common: remove inadapted periph_flash_common
The `periph_flash_common` feature was only defined here to trigger
inclusion of a source file with common functions.
It even only defines private symbols `_lock` and `_unlock` so no reason
to expose it to the build system.
And in practice, all stm cpus providing `periph_flashpage` or
`periph_eeprom` were required to provide `periph_flash_common` to allow
including it.

The previous implementation was only parsing in the modules were in
`FEATURES_REQUIRED` wich did not take cases of `FEATURES_OPTIONAL` into
account.
And also, in the same time, as the dependencies was declared in
`Makefile.include` it was processed before `Makefile.dep` so never handled
cases where a module could depend on `periph_flashpage` or
`periph_eeprom` feature.

It is replaced by selecting the common source file when module using it
are included.

The now useless feature `periph_flash_common` is removed from
`FEATURES_PROVIDED`.
2018-10-11 15:20:44 +02:00
cladmi
d8080a66e4
cpu/stm32_common: Do not use USEMODULE to select i2c implem
`cpu/stm32_common/Makefile.dep` was never included by the global
`Makefile.dep`, so declaring this `USEMODULE +=` here was never shown to
the build system and never exported as `MODULE_PERIPH_I2C_X` variables.

In fact, `USEMODULE` was only used to trigger the `periph.mk`/`SUBMODULES`
mechanism to add matching source files names to `SRC` and so select
the implementation for each CPU type.

It is replaced by just explicitly selecting the right source file.
2018-10-11 15:20:25 +02:00
Hauke Petersen
5f50db07e8 misc: use correct hauke.petersen@fu email address 2018-10-11 12:20:37 +02:00
Martine Lenders
92c5a7824a stm32_common: mark closing #endif for MODULE_PERIPH_GPIO_IRQ 2018-10-09 15:11:00 +02:00
Hauke Petersen
a956d71a67 cpu/stm32_common/gpio: use gpio_irq feature 2018-09-21 08:19:51 +02:00
MichelRottleuthner
2db68b600b
Merge pull request #9505 from PeterKietzmann/pr_puf_stm32
cpu/stm32_common: add PUF SRAM feature to makefile
2018-08-17 13:08:21 +02:00
Martine Lenders
9478274bd9 stm32_common/eeprom: fix DEBUG formatting
This fixes compilation for `periph_eeprom` with LLVM/clang and also is
more in accordance with our [coding conventions].

[coding conventions]: https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions#-wformat
2018-08-14 14:56:44 +02:00
a008b983b3 cpu/stm32_common: add flashpage support for stm32l4 2018-08-06 12:33:03 +02:00
Martine Lenders
6f78a7f331 stm32_common: i2c_2: fix for -Wunused-function
This came up when compiling an application for a STM32-based board
with LLVM/clang. The function is not used if I²C is not provided.
2018-08-03 16:12:52 +02:00
dylad
69297a0939 cpu/stm32_common: remove scl_af/sda_af attribut for STM32F1 2018-07-25 15:17:43 +02:00
5f1d5e0d83 cpu/stm32_common: various improvements in i2c_1 driver
- dont send stop if bus is busy and before any action is done on bus
- and bus check that looks for bus error, arbitration and nack events
- check for ACK (TXIS) before writing bytes on bus and not between each write
2018-07-25 12:01:39 +02:00
MrKevinWeiss
e8c56ceadc cpu/stm32_common/i2c: Fix return error code 2018-07-25 12:01:39 +02:00
MrKevinWeiss
6016266c77 cpu/stm_common/i2c: Fix error code 2018-07-25 12:01:38 +02:00
MrKevinWeiss
6a3f9f35dc cpu/stm32_common/i2c: Fix extra clear_addr 2018-07-25 12:01:38 +02:00
MrKevinWeiss
6f6c3d7926 cpu/stm_common/i2c: style fix 2018-07-25 12:01:38 +02:00
MrKevinWeiss
6c4f144e25 cpu/stm32_common/i2c: fix addr nack and flags 2018-07-25 12:01:38 +02:00
99b3bb88bd cpu/stm32_common: update return values to error codes 2018-07-25 12:01:37 +02:00
Vincent Dupont
c0c9ea034c cpu/stm32_common: add timeouts in stm32f4 i2c driver 2018-07-25 12:01:37 +02:00
06e11c5586 cpu/stm32_common: adapt i2c driver to stm32f1 2018-07-25 12:01:37 +02:00
9166fb27fa cpu/stm32_common: split common i2c periph in 2
- i2c_1 is built for f0, f3, f7, l0 and l4
- i2c_2 is built for f4
2018-07-25 12:01:36 +02:00