Skip to content

Commit

Permalink
enable software knock on PA3 for F407 #105
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed May 12, 2023
1 parent ee1c8f0 commit 5051448
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions firmware/config/boards/f407-discovery/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ DDEFS += -DTS_SECONDARY_UxART_PORT=SD3

DDEFS += -DSTM32_I2C_USE_I2C3=TRUE

DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE

ifndef IS_RE_BOOTLOADER
DDEFS += -DHAL_USE_EEPROM=TRUE
endif
16 changes: 16 additions & 0 deletions firmware/config/boards/f407-discovery/knock_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* @file knock_config.h
*/

#pragma once

// Knock is on ADC3
#define KNOCK_ADC ADCD3

// knock 1 - pin PA3
#define KNOCK_ADC_CH1 ADC_CHANNEL_IN3
#define KNOCK_PIN_CH1 Gpio::A3

// Sample rate & time - depends on the exact MCU
#define KNOCK_SAMPLE_TIME ADC_SAMPLE_84
#define KNOCK_SAMPLE_RATE (STM32_PCLK2 / (4 * (84 + 12)))
1 change: 1 addition & 0 deletions firmware/config/boards/f407-discovery/prepend.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
! see also FLEXIBLE_CRITICAL_LED
#define ts_show_critical_led true
#define ts_show_software_knock true

0 comments on commit 5051448

Please sign in to comment.