Skip to content

Commit

Permalink
added macros for ADC variable gain
Browse files Browse the repository at this point in the history
  • Loading branch information
boramonideep committed May 5, 2023
1 parent e73be6f commit 448e285
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cores/wiring_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ return value;
0 1
1 3
2 6
3 12
3 12
Also, refer to macros in wiring_analog.h
*/

uint32_t analogRead_variableGain( uint8_t channel, uint8_t gain_value )
Expand Down
9 changes: 9 additions & 0 deletions cores/wiring_analog.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@
extern "C" {
#endif

/*********************************************************************************************************************
* MACROS
********************************************************************************************************************/
// ADC gain macros
#define ADC_VAR_GAIN_FACTOR_1 0
#define ADC_VAR_GAIN_FACTOR_3 1
#define ADC_VAR_GAIN_FACTOR_6 2
#define ADC_VAR_GAIN_FACTOR_12 3

//****************************************************************************
// @External Prototypes
//****************************************************************************
Expand Down

0 comments on commit 448e285

Please sign in to comment.