28#ifndef HBRIDGEDRIVER_H
29#define HBRIDGEDRIVER_H
39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
72#define HBRIDGEDRIVER_PROP_DIS 0x00
73#define HBRIDGEDRIVER_PROP_EN 0x01
91#define HBRIDGEDRIVER_MAP_MIKROBUS( cfg, mikrobus ) \
92 cfg.il2 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
93 cfg.ih2 = MIKROBUS( mikrobus, MIKROBUS_RST ); \
94 cfg.gen = MIKROBUS( mikrobus, MIKROBUS_CS ); \
95 cfg.il1 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
96 cfg.ih1 = MIKROBUS( mikrobus, MIKROBUS_INT )
void hbridgedriver_dc_brake_1(hbridgedriver_t *ctx)
Motor Connected to HS/LS 1 Braking function.
err_t hbridgedriver_init(hbridgedriver_t *ctx, hbridgedriver_cfg_t *cfg)
H-Bridge Driver initialization function.
void hbridgedriver_dc_bwd_2(hbridgedriver_t *ctx)
Motor Connected to HS/LS 2 Backward motion function.
void hbridgedriver_in_hs_2(hbridgedriver_t *ctx, uint8_t state)
Input High Side 2 function.
void hbridgedriver_in_ls_2(hbridgedriver_t *ctx, uint8_t state)
Input Low Side 2 function.
void hbridgedriver_coasting(hbridgedriver_t *ctx)
H-Bridge mode coasting function.
void hbridgedriver_in_hs_1(hbridgedriver_t *ctx, uint8_t state)
Input High Side 1 function.
void hbridgedriver_dc_coast_1(hbridgedriver_t *ctx)
Motor Connected to HS/LS 1 Coasting function.
void hbridgedriver_cfg_setup(hbridgedriver_cfg_t *cfg)
H-Bridge Driver configuration object setup function.
void hbridgedriver_braking(hbridgedriver_t *ctx)
H-Bridge mode braking function.
void hbridgedriver_dc_brake_2(hbridgedriver_t *ctx)
Motor Connected to HS/LS 2 Braking function.
void hbridgedriver_dc_fwd_1(hbridgedriver_t *ctx)
Motor Connected to HS/LS 1 Foreward motion function.
void hbridgedriver_reverse(hbridgedriver_t *ctx)
H-Bridge mode reverse function.
void hbridgedriver_dc_bwd_1(hbridgedriver_t *ctx)
Motor Connected to HS/LS 1 Backward motion function.
void hbridgedriver_forward(hbridgedriver_t *ctx)
H-Bridge mode forward function.
void hbridgedriver_dc_coast_2(hbridgedriver_t *ctx)
Motor Connected to HS/LS 2 Coasting function.
void hbridgedriver_glo_enable(hbridgedriver_t *ctx, uint8_t state)
Global enable function.
void hbridgedriver_in_ls_1(hbridgedriver_t *ctx, uint8_t state)
Input Low Side 1 function.
void hbridgedriver_dc_fwd_2(hbridgedriver_t *ctx)
Motor Connected to HS/LS 2 Foreward motion function.
hbridgedriver_return_value_t
H-Bridge Driver Click return value data.
Definition hbridgedriver.h:134
@ HBRIDGEDRIVER_OK
Definition hbridgedriver.h:135
@ HBRIDGEDRIVER_ERROR
Definition hbridgedriver.h:136
H-Bridge Driver Click configuration object.
Definition hbridgedriver.h:120
pin_name_t ih2
Definition hbridgedriver.h:122
pin_name_t ih1
Definition hbridgedriver.h:125
pin_name_t il2
Definition hbridgedriver.h:121
pin_name_t il1
Definition hbridgedriver.h:124
pin_name_t gen
Definition hbridgedriver.h:123
H-Bridge Driver Click context object.
Definition hbridgedriver.h:106
digital_out_t il1
Definition hbridgedriver.h:110
digital_out_t gen
Definition hbridgedriver.h:109
digital_out_t il2
Definition hbridgedriver.h:107
digital_out_t ih1
Definition hbridgedriver.h:111
digital_out_t ih2
Definition hbridgedriver.h:108