Header file for metal detecting functionality. More...
#include <stdint.h>
#include "arm_math.h"
Go to the source code of this file.
Data Structures | |
struct | MD_Data_t |
Structure to hold signal data for metal detection. More... | |
struct | MD_Handle_t |
Structure to hold detection parameters and state. More... | |
Enumerations | |
enum | MD_DetectStatus_t { TARGET_DETECTED = 0 , NO_TARGET } |
Detection status for metal detecting. More... | |
Functions | |
MD_DetectStatus_t | md_detect (MD_Handle_t *const handle, const MD_Data_t *const data, int16_t *const phase_difference) |
Detects the presence of a target based on signal data. | |
void | md_set_gndbalance (MD_Handle_t *const handle, uint16_t new_balance) |
Sets the ground balance parameter for metal detection. | |
void | md_set_sensitivity (MD_Handle_t *const handle, uint16_t new_sens) |
Sets the sensitivity parameter for metal detection. | |
Variables | |
MD_Handle_t | md_handle |
Global handle for metal detecting operations. | |
Header file for metal detecting functionality.
This file defines the types, constants, and function prototypes for metal detecting. It includes definitions for detection status, data structures for signal information, and handle structures for metal detecting operations.
Created on: Jul 23, 2024 Author: Viktor
enum MD_DetectStatus_t |
MD_DetectStatus_t md_detect | ( | MD_Handle_t *const | handle, |
const MD_Data_t *const | data, | ||
int16_t *const | phase_difference ) |
Detects the presence of a target based on signal data.
This function evaluates whether a target is detected by comparing the received signal magnitude with ground balance and sensitivity thresholds. It calculates the phase difference between the transmitted and received signals.
handle | Pointer to the MD_Handle_t structure containing detection parameters. |
data | Pointer to the MD_Data_t structure containing the received signal data. |
phase_difference | Pointer to an integer where the calculated phase difference will be stored. |
Detects the presence of a target based on signal data.
This function determines if a target is detected by comparing the current signal magnitude with a ground balance and sensitivity threshold. It also calculates the phase difference between the transmitted and received signals.
handle | Pointer to the MD_Handle_t structure containing detection parameters. |
data | Pointer to the MD_Data_t structure containing the received signal data. |
phase_difference | Pointer to an integer where the calculated phase difference will be stored. |
< Default return value indicating no target detected
< Variable to hold the calculated phase difference
< Set the return value to indicate that a target is detected
< Convert phase difference to degrees
< Take the absolute value of the phase difference
< Store the phase difference in the provided pointer
< Return the detection status
void md_set_gndbalance | ( | MD_Handle_t *const | handle, |
const uint16_t | new_balance ) |
Sets the ground balance parameter for metal detection.
This function updates the ground balance value used in target detection.
handle | Pointer to the MD_Handle_t structure containing detection parameters. |
new_balance | New ground balance value to be set. |
< Update the ground balance parameter
void md_set_sensitivity | ( | MD_Handle_t *const | handle, |
const uint16_t | new_sens ) |
Sets the sensitivity parameter for metal detection.
This function updates the sensitivity value used in target detection.
handle | Pointer to the MD_Handle_t structure containing detection parameters. |
new_sens | New sensitivity value to be set. |
< Update the sensitivity parameter