Skip to content

Commit

Permalink
atlas fiddling
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Nov 18, 2024
1 parent 465783e commit bf4bff2
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
7 changes: 5 additions & 2 deletions firmware/config/boards/atlas/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::F0
DDEFS += -DFIRMWARE_ID=\"atlas\"

# This stuff doesn't work on H7 yet
# DDEFS += -DSTM32_ADC_USE_ADC3=TRUE
# DEFS += -DEFI_SOFTWARE_KNOCK=TRUE
# This board has trigger scope hardware!
# DDEFS += -DTRIGGER_SCOPE
# DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE

DDEFS += -DEFI_SDC_DEVICE=SDCD1

# We are running on Atlas hardware!
DDEFS += -DHW_ATLAS=1
Expand Down
21 changes: 21 additions & 0 deletions firmware/config/boards/atlas/knock_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* @file knock_config.h
*/

#pragma once

// Knock is on ADC3
#define KNOCK_ADC ADCD3

// knock 1 - pin PF4
#define KNOCK_ADC_CH1 ADC_CHANNEL_IN14
#define KNOCK_PIN_CH1 Gpio::F4

// knock 2 - pin PF5
#define KNOCK_HAS_CH2 true
#define KNOCK_ADC_CH2 ADC_CHANNEL_IN15
#define KNOCK_PIN_CH2 Gpio::F5

// Sample rate & time - depends on the exact MCU
#define KNOCK_SAMPLE_TIME ADC_SAMPLE_84
#define KNOCK_SAMPLE_RATE (STM32_PCLK2 / (4 * (84 + 12)))
9 changes: 9 additions & 0 deletions firmware/config/boards/atlas/trigger_scope_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#define TRIGGER_SCOPE_ADC ADCD3

#define TRIGGER_SCOPE_SAMPLE_TIME ADC_SAMPLE_144

#define TRIGGER_SCOPE_PIN_CH1 Gpio::F10
#define TRIGGER_SCOPE_ADC_CH1 ADC_CHANNEL_IN8

#define TRIGGER_SCOPE_HAS_CH2 false
#define TRIGGER_SCOPE_ADC_CH2 ADC_CHANNEL_IN8

0 comments on commit bf4bff2

Please sign in to comment.