mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-08 13:11:37 +08:00
nxp_imxrt1170-evk:Use LPADC
This commit is contained in:
@@ -99,14 +99,14 @@ const struct clock_configuration_s g_initial_clkconfig = {
|
||||
.adc1_clk_root =
|
||||
{
|
||||
.enable = 1,
|
||||
.div = 1,
|
||||
.mux = ADC1_CLK_ROOT_OSC_RC_48M_DIV2,
|
||||
.div = 6,
|
||||
.mux = ADC1_CLK_ROOT_SYS_PLL2_CLK,
|
||||
},
|
||||
.adc2_clk_root =
|
||||
{
|
||||
.enable = 1,
|
||||
.div = 1,
|
||||
.mux = ADC2_CLK_ROOT_OSC_RC_48M_DIV2,
|
||||
.div = 6,
|
||||
.mux = ADC2_CLK_ROOT_SYS_PLL2_CLK,
|
||||
},
|
||||
.acmp_clk_root =
|
||||
{
|
||||
|
||||
@@ -253,8 +253,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
|
||||
int ret = OK;
|
||||
|
||||
//board_spi_reset(10, 0xffff);
|
||||
#if 0
|
||||
board_spi_reset(10, 0xffff);
|
||||
|
||||
if (OK == board_determine_hw_info()) {
|
||||
syslog(LOG_INFO, "[boot] Rev 0x%1x : Ver 0x%1x %s\n", board_get_hw_revision(), board_get_hw_version(),
|
||||
@@ -264,8 +263,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
syslog(LOG_ERR, "[boot] Failed to read HW revision and version\n");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
px4_platform_init();
|
||||
|
||||
/* configure the DMA allocator */
|
||||
|
||||
@@ -136,7 +136,7 @@ static int dn_to_ordinal(uint16_t dn)
|
||||
static int read_id_dn(int *id, uint32_t gpio_drive, uint32_t gpio_sense, int adc_channel)
|
||||
{
|
||||
int rv = -EIO;
|
||||
#if 0 //RT7 Has LPADC needs new driver
|
||||
|
||||
const unsigned int samples = 16;
|
||||
/*
|
||||
* Step one is there resistors?
|
||||
@@ -221,13 +221,14 @@ static int read_id_dn(int *id, uint32_t gpio_drive, uint32_t gpio_sense, int adc
|
||||
/* Turn the drive lines to digital outputs High */
|
||||
|
||||
imxrt_config_gpio(gpio_drive);
|
||||
#endif
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
static int determine_hw_info(int *revision, int *version)
|
||||
{
|
||||
|
||||
int dn;
|
||||
int rv = read_id_dn(&dn, GPIO_HW_REV_DRIVE, GPIO_HW_REV_SENSE, ADC_HW_REV_SENSE_CHANNEL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user