Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4157

General • Re: On rp2040, reading 2.15V off a 5V voltage divider

$
0
0
Interesting, normally I am paranoid about the pulls and I always like to add gpio_disable_pulls() with the GPIO config stuff, but in my copy of C SDK 1.5.1 (below), gpio_disable_pulls() is called when doing ADC pin init:

Code:

static inline void adc_gpio_init(uint gpio) {    invalid_params_if(ADC, gpio < 26 || gpio > 29);    // Select NULL function to make output driver hi-Z    gpio_set_function(gpio, GPIO_FUNC_NULL);    // Also disable digital pulls and digital receiver    gpio_disable_pulls(gpio);    gpio_set_input_enabled(gpio, false);}
So if adc_gpio_init() is called, it should have called gpio_disable_pulls() too. I'm not sure I understand what happened here... :| just puzzled.

Statistics: Posted by katak255 — Tue Jan 07, 2025 1:55 am



Viewing all articles
Browse latest Browse all 4157

Trending Articles