Skip to content

drivers: adc: ambiq: fixed the error that caused adc_api test to fail #92959

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions drivers/adc/adc_ambiq.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ struct adc_ambiq_config {
struct adc_ambiq_data {
struct adc_context ctx;
void *adcHandle;
uint32_t *buffer;
uint32_t *repeat_buffer;
uint16_t *buffer;
uint16_t *repeat_buffer;
uint8_t active_channels;
struct k_sem dma_done_sem;
am_hal_adc_dma_config_t dma_cfg;
Expand Down Expand Up @@ -175,7 +175,7 @@ static void adc_ambiq_isr(const struct device *dev)
&Sample);
*data->buffer++ = Sample.ui32Sample;
}
adc_ambiq_disable(dev);
am_hal_adc_disable(data->adcHandle);
adc_context_on_sampling_done(&data->ctx, dev);
}

Expand Down
12 changes: 7 additions & 5 deletions tests/drivers/adc/adc_api/boards/apollo510_evb.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,27 @@
*/
/ {
zephyr,user {
io-channels = <&adc0 4>, <&adc0 7>;
io-channels = <&adc0 5>, <&adc0 6>;
};
};

&adc0 {
status = "okay";
interrupt-parent = <&nvic>;
interrupts = <19 0>;
#address-cells = <1>;
#size-cells = <0>;

channel@4 {
reg = <4>;
channel@5 {
reg = <5>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
};

channel@7 {
reg = <7>;
channel@6 {
reg = <6>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
Expand Down