qmk_firmware/drivers/chibios
Sergey Vlasov 65c9752762
Update ADC driver for STM32F1xx, STM32F3xx, STM32F4xx (#12403)
* Fix default ADC_RESOLUTION for ADCv3 (and ADCv4)

Recent ChibiOS update removed ADC_CFGR1_RES_10BIT from the ADCv3 headers
(that macro should not have been there, because ADCv3 has CFGR instead of
CFGR1).  Fix the default value for ADC_RESOLUTION to use ADC_CFGR_RES_10BITS
if it is defined (that name is used for ADCv3 and ADCv4).

* Update ADC docs to match the actually used resolution

ADC driver for ChibiOS actually uses the 10-bit resolution by default
(probably to match AVR); fix the documentation accordingly.  Also add
both ADC_CFGR_RES_10BITS and ADC_CFGR1_RES_10BIT constants (these names
differ according to the ADC implementation in the particular MCU).

* Fix pinToMux() for B12 and B13 on STM32F3xx

Testing on STM32F303CCT6 revealed that the ADC mux values for B12 and
B13 pins were wrong.

* Add support for all possible analog pins on STM32F1xx

Added ADC mux values for pins A0...A7, B0, B1, C0...C5 on STM32F1xx
(they are the same at least for STM32F103x8 and larger F103 devices, and
also F102, F105, F107 families).  Actually tested on STM32F103C8T6
(therefore pins C0...C5 were not tested).

Pins F6...F10, which are present on STM32F103x[C-G] in 144-pin packages,
cannot be supported at the moment, because those pins are connected only
to ADC3, but the ChibiOS ADC driver for STM32F1xx supports only ADC1.

* Add support for all possible analog pins on STM32F4xx

Added ADC mux values for pins A0...A7, B0, B1, C0...C5 and optionally
F3...F10 (if STM32_ADC_USE_ADC3 is enabled).  These mux values are
apparently the same for all F4xx devices, except some smaller devices may
not have ADC3.

Actually tested on STM32F401CCU6, STM32F401CEU6, STM32F411CEU6 (using
various WeAct “Blackpill” boards); only pins A0...A7, B0, B1 were tested.

Pins F3...F10 are inside `#if STM32_ADC_USE_ADC3` because some devices
which don't have ADC3 also don't have the GPIOF port, therefore the code
which refers to Fx pins does not compile.

* Fix STM32F3xx ADC mux table in documentation

The ADC driver documentation had some errors in the mux table for STM32F3xx.
Fix this table to match the datasheet and the actual code (mux settings for
B12 and B13 were also tested on a real STM32F303CCT6 chip).

* Add STM32F1xx ADC pins to the documentation

* Add STM32F4xx ADC pins to the documentation
2021-04-25 11:15:37 +10:00
..
analog.c Update ADC driver for STM32F1xx, STM32F3xx, STM32F4xx (#12403) 2021-04-25 11:15:37 +10:00
analog.h Initial arm->chibios pass - simplify some platform logic (#8450) 2020-03-21 16:20:04 +11:00
i2c_master.c 2020 November 28 Breaking Changes Update (#11053) 2020-11-28 12:02:18 -08:00
i2c_master.h Normalise include statements in core code (#11153) 2020-12-11 13:45:24 +11:00
serial_usart.c Merge remote-tracking branch 'origin/master' into develop 2020-12-16 03:27:52 +00:00
serial.c Normalise include statements in core code (#11153) 2020-12-11 13:45:24 +11:00
serial.h ARM split - Add uart half duplex transport support (#7987) 2020-05-21 18:00:21 +01:00
spi_master.c Align ChibiOS spi_master behaviour with AVR (#11404) 2021-01-03 14:53:53 +11:00
spi_master.h Normalise include statements in core code (#11153) 2020-12-11 13:45:24 +11:00
uart.c Format code according to conventions (#11905) 2021-02-15 06:55:43 +11:00
uart.h UART driver refactor (#11637) 2021-01-27 17:42:49 +11:00
usbpd_stm32g4.c Format code according to conventions (#11907) 2021-02-15 11:53:15 +11:00
ws2812_pwm.c Add support for complementary outputs to the WS2812 PWM driver (#11988) 2021-03-02 20:26:06 -08:00
ws2812_spi.c Format code according to conventions (#12292) 2021-03-19 16:24:36 +00:00
ws2812.c Add BGR byte order for WS2812 drivers (#11562) 2021-01-16 08:42:30 +11:00