HPM SDK
HPMicro Software Development Kit
hpm_mcl_detect.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023 HPMicro
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 #ifndef HPM_MCL_DETECT_H
8 #define HPM_MCL_DETECT_H
9 
10 #include "hpm_mcl_common.h"
11 #include "hpm_mcl_loop.h"
12 
17 typedef struct {
23 
28 typedef struct {
29  hpm_mcl_stat_t (*disable_output)(void);
30  void (*user_process)(mcl_detect_status status);
32 
37 typedef struct {
39  struct {
40  bool loop;
41  bool encoder;
42  bool analog;
43  bool drivers;
44  } en_submodule_detect;
47 
52 typedef struct {
56 } mcl_detect_t;
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
74  mcl_analog_t *analog, mcl_drivers_t *drivers);
75 
83 
84 #ifdef __cplusplus
85 }
86 #endif
87 
88 #endif
mcl_analog_status_t
Definition: hpm_mcl_analog.h:20
uint32_t hpm_mcl_stat_t
Definition: hpm_mcl_common.h:15
hpm_mcl_stat_t hpm_mcl_detect_loop(mcl_detect_t *detect)
Loop for detection function.
Definition: hpm_mcl_detect.c:30
hpm_mcl_stat_t hpm_mcl_detect_init(mcl_detect_t *detect, mcl_detect_cfg_t *cfg, mcl_loop_t *loop, mcl_encoder_t *encoder, mcl_analog_t *analog, mcl_drivers_t *drivers)
Initialising data structures for fault detection.
Definition: hpm_mcl_detect.c:10
mcl_drivers_status_t
Status of the drive function.
Definition: hpm_mcl_drivers.h:21
mcl_encoder_status_t
Definition: hpm_mcl_encoder.h:21
mcl_loop_status_t
Definition: hpm_mcl_loop.h:18
Operational data of the analog function.
Definition: hpm_mcl_analog.h:74
Fault Detection Callback Functions.
Definition: hpm_mcl_detect.h:28
Fault Detection Configuration.
Definition: hpm_mcl_detect.h:37
bool enable_detect
Definition: hpm_mcl_detect.h:38
bool encoder
Definition: hpm_mcl_detect.h:41
bool analog
Definition: hpm_mcl_detect.h:42
bool loop
Definition: hpm_mcl_detect.h:40
bool drivers
Definition: hpm_mcl_detect.h:43
mcl_detect_callback_t callback
Definition: hpm_mcl_detect.h:45
Fault Detection Override Functions.
Definition: hpm_mcl_detect.h:17
mcl_loop_status_t * control_loop
Definition: hpm_mcl_detect.h:18
mcl_drivers_status_t * drivers
Definition: hpm_mcl_detect.h:21
mcl_analog_status_t * analog
Definition: hpm_mcl_detect.h:20
mcl_encoder_status_t * encoder
Definition: hpm_mcl_detect.h:19
Fault detection running data.
Definition: hpm_mcl_detect.h:52
mcl_drivers_t * drivers
Definition: hpm_mcl_detect.h:55
mcl_detect_cfg_t * cfg
Definition: hpm_mcl_detect.h:53
mcl_detect_status status
Definition: hpm_mcl_detect.h:54
Driver function running data.
Definition: hpm_mcl_drivers.h:88
Encoder operation data.
Definition: hpm_mcl_encoder.h:132
Loop operation data.
Definition: hpm_mcl_loop.h:104