39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
69#define HBRIDGE8_MODE_REVERSE 0
70#define HBRIDGE8_MODE_FORWARD 1
88#define HBRIDGE8_DEF_FREQ 225000
106#define HBRIDGE8_MAP_MIKROBUS( cfg, mikrobus ) \
107 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
108 cfg.en = MIKROBUS( mikrobus, MIKROBUS_RST ); \
109 cfg.mod = MIKROBUS( mikrobus, MIKROBUS_CS ); \
110 cfg.flt = MIKROBUS( mikrobus, MIKROBUS_INT )
void hbridge8_cfg_setup(hbridge8_cfg_t *cfg)
H-Bridge 8 configuration object setup function.
err_t hbridge8_set_mode(hbridge8_t *ctx, uint8_t mode)
H-Bridge 8 set operating mode function.
err_t hbridge8_init(hbridge8_t *ctx, hbridge8_cfg_t *cfg)
H-Bridge 8 initialization function.
uint8_t hbridge8_get_fault_indication(hbridge8_t *ctx)
H-Bridge 8 get fault indication function.
err_t hbridge8_pwm_start(hbridge8_t *ctx)
H-Bridge 8 start PWM module.
err_t hbridge8_pwm_stop(hbridge8_t *ctx)
H-Bridge 8 stop PWM module.
err_t hbridge8_disable(hbridge8_t *ctx)
H-Bridge 8 set IC disable function.
err_t hbridge8_enable(hbridge8_t *ctx)
H-Bridge 8 set IC enable function.
err_t hbridge8_set_duty_cycle(hbridge8_t *ctx, float duty_cycle)
H-Bridge 8 sets PWM duty cycle.
err_t hbridge8_default_cfg(hbridge8_t *ctx)
H-Bridge 8 default configuration function.
hbridge8_return_value_t
H-Bridge 8 Click return value data.
Definition hbridge8.h:165
@ HBRIDGE8_OK
Definition hbridge8.h:166
@ HBRIDGE8_ERROR
Definition hbridge8.h:167
uint8_t mode
Definition main.c:32
H-Bridge 8 Click configuration object.
Definition hbridge8.h:146
pin_name_t mod
Definition hbridge8.h:152
uint32_t dev_pwm_freq
Definition hbridge8.h:156
pin_name_t flt
Definition hbridge8.h:153
pin_name_t en
Definition hbridge8.h:151
pin_name_t pwm
Definition hbridge8.h:148
H-Bridge 8 Click driver selector.
Definition hbridge8.h:125
digital_out_t mod
Definition hbridge8.h:128
digital_in_t flt
Definition hbridge8.h:131
uint32_t pwm_freq
Definition hbridge8.h:137
digital_out_t en
Definition hbridge8.h:127
pwm_t pwm
Definition hbridge8.h:134