HPM SDK
HPMicro Software Development Kit
hpm_mcl_drivers.c File Reference
#include "hpm_mcl_drivers.h"

Functions

hpm_mcl_stat_t hpm_mcl_drivers_init (mcl_drivers_t *drivers, mcl_drivers_cfg_t *cfg)
 Initialising data for driver functions. More...
 
hpm_mcl_stat_t hpm_mcl_drivers_update_bldc_duty (mcl_drivers_t *drivers, float duty_a, float duty_b, float duty_c)
 Update the duty cycle of a brushless motor. More...
 
hpm_mcl_stat_t hpm_mcl_drivers_update_step_duty (mcl_drivers_t *drivers, float duty_a0, float duty_a1, float duty_b0, float duty_b1)
 Update the duty cycle of a step motor. More...
 
hpm_mcl_stat_t hpm_mcl_disable_all_drivers (mcl_drivers_t *drivers)
 Switch off all drive outputs. More...
 
hpm_mcl_stat_t hpm_mcl_enable_all_drivers (mcl_drivers_t *drivers)
 Enable all drive outputs. More...
 
hpm_mcl_stat_t hpm_mcl_disable_drivers (mcl_drivers_t *drivers, mcl_drivers_channel_t chn)
 Turns off the output of the specified channel of the driver. More...
 
hpm_mcl_stat_t hpm_mcl_enable_drivers (mcl_drivers_t *drivers, mcl_drivers_channel_t chn)
 Starts the output of the specified channel of the driver. More...
 
hpm_mcl_stat_t hpm_mcl_drivers_block_update (mcl_drivers_t *drivers, mcl_motor_dir_t dir, uint8_t sector)
 Block mode updates the outputs of the driver peripherals. More...
 

Function Documentation

◆ hpm_mcl_disable_all_drivers()

hpm_mcl_stat_t hpm_mcl_disable_all_drivers ( mcl_drivers_t drivers)

Switch off all drive outputs.

Parameters
driversmcl_drivers_t
Returns
hpm_mcl_stat_t

◆ hpm_mcl_disable_drivers()

hpm_mcl_stat_t hpm_mcl_disable_drivers ( mcl_drivers_t drivers,
mcl_drivers_channel_t  chn 
)

Turns off the output of the specified channel of the driver.

Parameters
driversmcl_drivers_t
chnmcl_drivers_channel_t
Returns
hpm_mcl_stat_t

◆ hpm_mcl_drivers_block_update()

hpm_mcl_stat_t hpm_mcl_drivers_block_update ( mcl_drivers_t drivers,
mcl_motor_dir_t  dir,
uint8_t  sector 
)

Block mode updates the outputs of the driver peripherals.

Parameters
driversmcl_drivers_t
dirmcl_motor_dir_t
sector1 - 6
Returns
hpm_mcl_stat_t

◆ hpm_mcl_drivers_init()

hpm_mcl_stat_t hpm_mcl_drivers_init ( mcl_drivers_t drivers,
mcl_drivers_cfg_t cfg 
)

Initialising data for driver functions.

Parameters
driversmcl_drivers_t
cfgmcl_drivers_cfg_t
Returns
hpm_mcl_stat_t

◆ hpm_mcl_drivers_update_bldc_duty()

hpm_mcl_stat_t hpm_mcl_drivers_update_bldc_duty ( mcl_drivers_t drivers,
float  duty_a,
float  duty_b,
float  duty_c 
)

Update the duty cycle of a brushless motor.

Parameters
driversmcl_drivers_t
duty_aa-phase duty cycle
duty_bb-phase duty cycle
duty_cc-phase duty cycle
Returns
hpm_mcl_stat_t

◆ hpm_mcl_drivers_update_step_duty()

hpm_mcl_stat_t hpm_mcl_drivers_update_step_duty ( mcl_drivers_t drivers,
float  duty_a0,
float  duty_a1,
float  duty_b0,
float  duty_b1 
)

Update the duty cycle of a step motor.

Parameters
driversmcl_drivers_t
duty_a0a0-phase duty cycle
duty_a1a1-phase duty cycle
duty_b0b0-phase duty cycle
duty_b1b1-phase duty cycle
Returns
hpm_mcl_stat_t

◆ hpm_mcl_enable_all_drivers()

hpm_mcl_stat_t hpm_mcl_enable_all_drivers ( mcl_drivers_t drivers)

Enable all drive outputs.

Parameters
driversmcl_drivers_t
Returns
hpm_mcl_stat_t

◆ hpm_mcl_enable_drivers()

hpm_mcl_stat_t hpm_mcl_enable_drivers ( mcl_drivers_t drivers,
mcl_drivers_channel_t  chn 
)

Starts the output of the specified channel of the driver.

Parameters
driversmcl_drivers_t
chnmcl_drivers_channel_t
Returns
hpm_mcl_stat_t