mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Adding RP2350 SDK and target framework (#13988)
* Adding RP2350 SDK and target framework * Spacing * Removing board definitions
This commit is contained in:
parent
462cb05930
commit
2dd6f95aad
576 changed files with 435012 additions and 0 deletions
22
lib/main/pico-sdk/rp2_common/hardware_adc/adc.c
Normal file
22
lib/main/pico-sdk/rp2_common/hardware_adc/adc.c
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include "pico.h"
|
||||
#include "hardware/adc.h"
|
||||
#include "hardware/resets.h"
|
||||
|
||||
void adc_init(void) {
|
||||
// ADC is in an unknown state. We should start by resetting it
|
||||
reset_unreset_block_num_wait_blocking(RESET_ADC);
|
||||
|
||||
// Now turn it back on. Staging of clock etc is handled internally
|
||||
adc_hw->cs = ADC_CS_EN_BITS;
|
||||
|
||||
// Internal staging completes in a few cycles, but poll to be sure
|
||||
while (!(adc_hw->cs & ADC_CS_READY_BITS)) {
|
||||
tight_loop_contents();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue