-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add driver support for ADC1 of stm32 #13447
Changes from all commits
7e8f8f6
2ae1f39
85d246f
7b68bc3
9bb471d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,3 +93,7 @@ arduino_spi: &spi1 { | |
}; | ||
}; | ||
}; | ||
|
||
&adc1 { | ||
status = "ok"; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ supported: | |
- nvs | ||
- spi | ||
- watchdog | ||
- adc | ||
testing: | ||
ignore_tags: | ||
- net | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,3 +78,7 @@ arduino_spi: &spi1 { | |
&iwdg { | ||
status = "ok"; | ||
}; | ||
|
||
&adc1 { | ||
status = "ok"; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ supported: | |
- spi | ||
- pwm | ||
- watchdog | ||
- adc |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,3 +72,7 @@ arduino_serial: &usart6 {}; | |
&iwdg { | ||
status = "ok"; | ||
}; | ||
|
||
&adc1 { | ||
status = "ok"; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ supported: | |
- gpio | ||
- usb_device | ||
- watchdog | ||
- adc |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,3 +82,7 @@ arduino_spi: &spi2 {}; | |
&rtc { | ||
status = "ok"; | ||
}; | ||
|
||
&adc1 { | ||
status = "ok"; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ supported: | |
- pwm | ||
- rtc | ||
- counter | ||
- adc |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,3 +117,7 @@ arduino_spi: &spi1 { | |
&rtc { | ||
status = "ok"; | ||
}; | ||
|
||
&adc1 { | ||
status = "ok"; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,6 @@ supported: | |
- gpio | ||
- i2c | ||
- spi | ||
- adc | ||
ram: 96 | ||
flash: 512 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,9 @@ static const struct pin_config pinconf[] = { | |
{STM32_PIN_PB14, STM32F4_PINMUX_FUNC_PB14_SPI2_MISO}, | ||
{STM32_PIN_PB15, STM32F4_PINMUX_FUNC_PB15_SPI2_MOSI}, | ||
#endif /* CONFIG_SPI_1 */ | ||
#ifdef CONFIG_ADC_1 | ||
{STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_ADC123_IN0}, | ||
#endif /* CONFIG_ADC_1 */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this empty There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, my mistake |
||
}; | ||
|
||
static int pinmux_stm32_init(struct device *port) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,3 +108,7 @@ arduino_spi: &spi1 {}; | |
phase_seg2 = <5>; | ||
status = "ok"; | ||
}; | ||
|
||
&adc1 { | ||
status = "ok"; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ supported: | |
- rtc | ||
- counter | ||
- can | ||
- adc |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,3 +65,7 @@ arduino_spi: &spi1 { | |
&iwdg { | ||
status = "ok"; | ||
}; | ||
|
||
&adc1 { | ||
status = "ok"; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ supported: | |
- i2c | ||
- spi | ||
- watchdog | ||
- adc |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,3 +79,7 @@ arduino_i2c: &i2c1 { | |
&rtc { | ||
status = "ok"; | ||
}; | ||
|
||
&adc1 { | ||
status = "ok"; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,6 @@ supported: | |
- i2c | ||
- rtc | ||
- counter | ||
- adc | ||
ram: 96 | ||
flash: 1024 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Kconfig - ADC configuration options | ||
|
||
# | ||
# Copyright (c) 2019 Intel Corporation | ||
# Copyright (c) 2019 Endre Karlson | ||
# Copyright (c) 2019 Song Qiang <songqiang1304521@gmail.com> | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
menuconfig ADC_STM32 | ||
bool "STM32 ADC driver" | ||
depends on SOC_FAMILY_STM32 | ||
help | ||
Enable the driver implementation for the stm32xx ADC | ||
|
||
if ADC_STM32 | ||
|
||
config ADC_1 | ||
bool "ADC1" | ||
default y | ||
help | ||
Enable ADC1 | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Miss ADC_2 and _3, since available in the driver There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm actually thinking about removing them, because there are so many different product lines, and different amount of ADCs they have, and also some ADCs share interrupt vector, so there should be some code for identifying which instance calls the interrupt. I would like another PR to do these things because this PR can be merged so users of STM32 can have basic ADC support.
So if this passes all tests and clean, we should be able to merge this PR soon, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is up to @galak to settle on this. Though, I'm not quite in favor of it. Even it could not be a source of regression, it could be a source of bugs, and branch maturity is tightly controlled. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Understand, so I'll just wait. ;) |
||
endif # ADC_STM32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also add drivers/adc/adc_stm32.c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK