Metal Detector
 
Loading...
Searching...
No Matches
metal_detecting.h File Reference

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.
 

Detailed Description

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

Enumeration Type Documentation

◆ MD_DetectStatus_t

Detection status for metal detecting.

Enumerator
TARGET_DETECTED 

Indicates that a target has been detected

NO_TARGET 

Indicates that no target has been detected

Function Documentation

◆ md_detect()

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.

Parameters
handlePointer to the MD_Handle_t structure containing detection parameters.
dataPointer to the MD_Data_t structure containing the received signal data.
phase_differencePointer to an integer where the calculated phase difference will be stored.
Returns
MD_DetectStatus_t Detection status indicating whether a target was detected or not.

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.

Parameters
handlePointer to the MD_Handle_t structure containing detection parameters.
dataPointer to the MD_Data_t structure containing the received signal data.
phase_differencePointer to an integer where the calculated phase difference will be stored.
Returns
MD_DetectStatus_t Detection status indicating whether a target was detected or not.

< 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

◆ md_set_gndbalance()

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.

Parameters
handlePointer to the MD_Handle_t structure containing detection parameters.
new_balanceNew ground balance value to be set.

< Update the ground balance parameter

◆ md_set_sensitivity()

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.

Parameters
handlePointer to the MD_Handle_t structure containing detection parameters.
new_sensNew sensitivity value to be set.

< Update the sensitivity parameter