From 079d95c48f803eaac0fcdd31a632140953d6bc72 Mon Sep 17 00:00:00 2001 From: rusefillc <48498823+rusefillc@users.noreply.github.com> Date: Wed, 17 Apr 2024 23:49:53 -0400 Subject: [PATCH] Create knock_config.h --- knock_config.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 knock_config.h diff --git a/knock_config.h b/knock_config.h new file mode 100644 index 0000000..73e5185 --- /dev/null +++ b/knock_config.h @@ -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)))