Skip to content

Commit

Permalink
Merge pull request #826 from mattallen37/master
Browse files Browse the repository at this point in the history
Add support for VDDHDIV5
  • Loading branch information
hathach authored Jul 18, 2024
2 parents bba4b53 + d487674 commit 4dcfa3b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cores/nRF5/wiring_analog.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ extern uint32_t analogRead( uint32_t ulPin ) ;
*/
extern uint32_t analogReadVDD( void ) ;

#ifdef SAADC_CH_PSELP_PSELP_VDDHDIV5
/*
* \brief Read the value from the vddh pin with div5.
*
* \return Read value from vddh pin with div5, if no error.
*/
extern uint32_t analogReadVDDHDIV5( void ) ;
#endif

/*
* \brief Set the resolution of analogRead return values. Default is 10 bits (range from 0 to 1023).
Expand Down
7 changes: 7 additions & 0 deletions cores/nRF5/wiring_analog_nRF52.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,13 @@ uint32_t analogReadVDD( void )
return analogRead_internal(SAADC_CH_PSELP_PSELP_VDD);
}

#ifdef SAADC_CH_PSELP_PSELP_VDDHDIV5
uint32_t analogReadVDDHDIV5( void )
{
return analogRead_internal(SAADC_CH_PSELP_PSELP_VDDHDIV5);
}
#endif

void analogCalibrateOffset( void )
{
// Enable the SAADC
Expand Down

0 comments on commit 4dcfa3b

Please sign in to comment.