-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetector.h
More file actions
30 lines (19 loc) · 854 Bytes
/
Copy pathdetector.h
File metadata and controls
30 lines (19 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef DETECTOR_H_
#define DETECTOR_H_
#include <stdint.h>
#include <stdbool.h>
#define DETECTOR_TEST_INPUT_PIN 15 // JF12 on ZYBO Board. Also bit 0 when reading a bank. Easy to AND.
#define DETECTOR_HIT_THRESHOLD_MULTIPLIER 200 // Just a guess where the max value is around 280 for 200 ms pulse.
#define DETECTOR_HIT_ARRAY_SIZE (FILTER_IIR_FILTER_COUNT)
typedef uint16_t detector_hitCount_t;
// Always have to init things.
void detector_init();
// Runs the entire detector: decimating fir-filter, iir-filters, power-computation, hit-detection.
void detector();
// Invoke to determine if a hit has occurred.
bool detector_hitDetected();
// Clear the detected hit once you have accounted for it.
void detector_clearHit();
// Get the current hit counts.
void detector_getHitCounts(detector_hitCount_t hitArray[]);
#endif /* DETECTOR_H_ */