Continuity and diode mode initial implementation

Reads continuity at a fixed ~100ohm or lower, and diodes with intelligent detection of LEDs vs normal diodes. Some values may need to be changed still.
This commit is contained in:
true
2023-10-21 19:45:15 -07:00
parent 859c04f782
commit 0afa454588
10 changed files with 289 additions and 53 deletions

View File

@@ -13,7 +13,7 @@
#define ADC_CHANNELS 6
#define ADC_CHANNELS 5
#define ADC_HISTLEN 16
@@ -25,6 +25,8 @@ extern uint16_t adc_avg[ADC_CHANNELS];
void adc_init();
uint8_t adc_next();
void adc_switch0();
#endif /* _INC_ADC_H */

21
include/probe.h Normal file
View File

@@ -0,0 +1,21 @@
/*
* probe.c: helping you probe things
*
* file creation: 20231021 1717
*/
#ifndef _INC_PROBE_H
#define _INC_PROBE_H
#include <stdint.h>
void probe_mode_switch(uint8_t mode);
void probe_measure();
#endif /* _INC_PROBE_H */

View File

@@ -77,9 +77,9 @@
#define ADC_PROBE 1
#define ADC_VREF_INT 5
#define ADC_VREF_INT 4
#define ADC_VREF_EXT 0
#define ADC_THERM 4
// #define ADC_THERM 4

View File

@@ -4,9 +4,33 @@
* file creation: 20231016 1505
*/
#ifndef _INC_USERIO_H
#define _INC_USERIO_H
#include <stdint.h>
#define MODE_CONT 0
#define MODE_CONT_TARGET 3072 // (4096 * (1 - (1 / 4)))
#define MODE_FUN 1
#define MODE_FUN_TARGET 2731 // (4096 * (1 - (1 / 3)))
#define MODE_DIODE 2
#define MODE_DIODE_TARGET 2048 // (4096 * 1 - ((1 / 2)))
extern uint8_t knob[2];
void userio_parse();
uint8_t userio_get_mode();
#endif /* _INC_USERIO_H */