8000 Merge pull request #826 from mattallen37/master · adafruit/Adafruit_nRF52_Arduino@4dcfa3b · GitHub
[go: up one dir, main page]

Skip to content

Commit 4dcfa3b

Browse files
authored
Merge pull request #826 from mattallen37/master
Add support for VDDHDIV5
2 parents bba4b53 + d487674 commit 4dcfa3b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

cores/nRF5/wiring_analog.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ extern uint32_t analogRead( uint32_t ulPin ) ;
9292
*/
9393
extern uint32_t analogReadVDD( void ) ;
9494

95+
#ifdef SAADC_CH_PSELP_PSELP_VDDHDIV5
96+
/*
97+
* \brief Read the value from the vddh pin with div5.
98+
*
99+
* \return Read value from vddh pin with div5, if no error.
100+
*/
101+
extern uint32_t analogReadVDDHDIV5( void ) ;
102+
#endif
95103

96104
/*
97105
* \brief Set the resolution of analogRead return values. Default is 10 bits (range from 0 to 1023).

cores/nRF5/wiring_analog_nRF52.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,13 @@ uint32_t analogReadVDD( void )
284284
return analogRead_internal(SAADC_CH_PSELP_PSELP_VDD);
285 7638 285
}
286286

287+
#ifdef SAADC_CH_PSELP_PSELP_VDDHDIV5
288+
uint32_t analogReadVDDHDIV5( void )
289+
{
290+
return analogRead_internal(SAADC_CH_PSELP_PSELP_VDDHDIV5);
291+
}
292+
#endif
293+
287294
void analogCalibrateOffset( void )
288295
{
289296
// Enable the SAADC

0 commit comments

Comments
 (0)
0