mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
rp2/machine_adc: Add support for external ADC channels.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
This commit is contained in:
committed by
Damien George
parent
4358faab0c
commit
5e52389f99
@@ -34,7 +34,8 @@ enum {
|
||||
MACHINE_PIN_MODE_IN = 0,
|
||||
MACHINE_PIN_MODE_OUT = 1,
|
||||
MACHINE_PIN_MODE_OPEN_DRAIN = 2,
|
||||
MACHINE_PIN_MODE_ALT = 3
|
||||
MACHINE_PIN_MODE_ALT = 3,
|
||||
MACHINE_PIN_MODE_ANALOG = 4
|
||||
};
|
||||
|
||||
typedef struct _machine_pin_af_obj_t {
|
||||
@@ -71,10 +72,14 @@ extern const mp_obj_type_t pin_board_pins_obj_type;
|
||||
extern const mp_obj_dict_t pin_board_pins_locals_dict;
|
||||
|
||||
void machine_pin_ext_init(void);
|
||||
bool machine_pin_ext_is_adc_channel(const machine_pin_obj_t *self);
|
||||
uint32_t machine_pin_ext_to_adc_channel(const machine_pin_obj_t *self);
|
||||
void machine_pin_ext_set(machine_pin_obj_t *self, bool value);
|
||||
bool machine_pin_ext_get(machine_pin_obj_t *self);
|
||||
uint16_t machine_pin_ext_read_u16(uint32_t channel);
|
||||
void machine_pin_ext_config(machine_pin_obj_t *self, int mode, int value);
|
||||
|
||||
const machine_pin_obj_t *machine_pin_find(mp_obj_t pin);
|
||||
const machine_pin_obj_t *machine_pin_find_named(const mp_obj_dict_t *named_pins, mp_obj_t name);
|
||||
const machine_pin_af_obj_t *machine_pin_find_alt(const machine_pin_obj_t *pin, uint8_t fn);
|
||||
const machine_pin_af_obj_t *machine_pin_find_alt_by_index(const machine_pin_obj_t *pin, mp_uint_t af_idx);
|
||||
|
||||
Reference in New Issue
Block a user