HPM SDK
HPMicro Software Development Kit
hpm_block.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021-2022 HPMicro
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 #ifndef HPM_BLOCK_H
8 #define HPM_BLOCK_H
9 
10 #if defined(__cplusplus)
11 extern "C" {
12 #endif /* __cplusplus */
13 
28 void hpm_mcl_bldc_block_ctrl(uint8_t motorindex, uint8_t dir, uint8_t step);
29 
39 uint8_t hpm_mcl_bldc_block_step_get(bldc_hall_phase_t phase, uint8_t hall_u, uint8_t hall_v, uint8_t hall_w);
40 
52 float hpm_mcl_al_pi_ctrl_func(float *memory, float targetspeed, float speed, float kp, float ki, float max);
53 
60 void hpm_mcl_bldc_pwm_enable(uint8_t motor_index, uint8_t pin_name);
61 
68 void hpm_mcl_bldc_pwm_disable(uint8_t motor_index, uint8_t pin_name);
69 
75 #if defined(__cplusplus)
76 }
77 #endif /* __cplusplus */
78 
79 #endif
void hpm_mcl_bldc_pwm_disable(uint8_t motor_index, uint8_t pin_name)
Disable the pwm output of the given pin.
void hpm_mcl_bldc_pwm_enable(uint8_t motor_index, uint8_t pin_name)
Enables the pwm output of the given pin.
void hpm_mcl_bldc_block_ctrl(uint8_t motorindex, uint8_t dir, uint8_t step)
Output pwm according to the number of motor steps.
Definition: hpm_block.c:11
uint8_t hpm_mcl_bldc_block_step_get(bldc_hall_phase_t phase, uint8_t hall_u, uint8_t hall_v, uint8_t hall_w)
Get step count based on Hall sensor status.
Definition: hpm_block.c:124
float hpm_mcl_al_pi_ctrl_func(float *memory, float targetspeed, float speed, float kp, float ki, float max)
pi loop function
Definition: hpm_block.c:141
enum bldc_hall_phase bldc_hall_phase_t
The mounting angle of the Hall sensor, 60 degrees or 120 degrees, is an inherent property of the moto...