Skip to content

Commit a6e9eb3

Browse files
committed
experiment with a bandgap analog read (not working)
1 parent 1efed72 commit a6e9eb3

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

cores/arduino/WVariant.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ typedef enum _EAnalogChannel
5757
ADC_Channel19=19,
5858
DAC_Channel0,
5959
DAC_Channel1,
60+
ADC_Channel_Bandgap=0x1B,
61+
ADC_Channel_PTAT=0x1C,
6062
} EAnalogChannel ;
6163

6264
#if defined(__SAMD51__)

variants/pybadge_m4/variant.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ const PinDescription g_APinDescription[]=
117117
// D51 Speaker enable
118118
{ PORTA, 27, PIO_DIGITAL, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE },
119119

120+
// D52 Bandgap input
121+
{ NOT_A_PORT, PIN_NOT_A_PIN, PIO_NOT_A_PIN, PIN_ATTR_ANALOG, ADC_Channel_PTAT, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE },
120122
} ;
121123

122124
const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM]={ TCC0, TCC1, TCC2, TCC3, TCC4, TC0, TC1, TC2, TC3, TC4, TC5 } ;

variants/pybadge_m4/variant.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ extern "C"
9898
#define PIN_A7 (PIN_A0 + 7)
9999
#define PIN_A8 (PIN_A0 + 8)
100100
#define PIN_A9 (PIN_A0 + 9)
101+
#define PIN_BANDGAP_ADC 52
101102

102103
#define PIN_DAC0 PIN_A0
103104
#define PIN_DAC1 PIN_A1

0 commit comments

Comments
 (0)