From 1403298a653fdb1ed3604bab71ce17200e5017f7 Mon Sep 17 00:00:00 2001 From: Dave Hylands Date: Mon, 24 Mar 2014 10:49:23 -0700 Subject: stmhal - fixed up adc stuff Added support for the ADC channels and mappings to make_pins.py I'm not sure if the hal properly deals with the channel 16/18 differences between the 40x and 42x. It seems to deal with it partially. This particular aspect will need testing on a 42x or 43x. --- stmhal/pin.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'stmhal/pin.h') diff --git a/stmhal/pin.h b/stmhal/pin.h index d5d769058..2aa50655b 100644 --- a/stmhal/pin.h +++ b/stmhal/pin.h @@ -50,6 +50,12 @@ enum { AF_PIN_TYPE_SPI_NSS, }; +enum { + PIN_ADC1 = (1 << 0), + PIN_ADC2 = (1 << 1), + PIN_ADC3 = (1 << 2), +}; + typedef struct { mp_obj_base_t base; uint8_t idx; @@ -70,9 +76,11 @@ typedef struct { typedef struct { mp_obj_base_t base; const char *name; - uint16_t port : 4; - uint16_t pin : 4; - uint16_t num_af : 4; + uint16_t port : 4; + uint16_t pin : 4; + uint16_t num_af : 4; + uint16_t adc_channel : 4; + uint16_t adc_num : 3; // 1 bit per ADC uint16_t pin_mask; GPIO_TypeDef *gpio; const pin_af_obj_t *af; -- cgit v1.2.3