28#ifndef HBRIDGEDRIVER_H
29#define HBRIDGEDRIVER_H
35#include "drv_digital_out.h"
36#include "drv_digital_in.h"
58#define HBRIDGEDRIVER_PROP_DIS 0x00
59#define HBRIDGEDRIVER_PROP_EN 0x01
77#define HBRIDGEDRIVER_MAP_MIKROBUS( cfg, mikrobus ) \
78 cfg.il2 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
79 cfg.ih2 = MIKROBUS( mikrobus, MIKROBUS_RST ); \
80 cfg.gen = MIKROBUS( mikrobus, MIKROBUS_CS ); \
81 cfg.il1 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
82 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:120
@ HBRIDGEDRIVER_OK
Definition: hbridgedriver.h:121
@ HBRIDGEDRIVER_ERROR
Definition: hbridgedriver.h:122
H-Bridge Driver Click configuration object.
Definition: hbridgedriver.h:106
pin_name_t ih2
Definition: hbridgedriver.h:108
pin_name_t ih1
Definition: hbridgedriver.h:111
pin_name_t il2
Definition: hbridgedriver.h:107
pin_name_t il1
Definition: hbridgedriver.h:110
pin_name_t gen
Definition: hbridgedriver.h:109
H-Bridge Driver Click context object.
Definition: hbridgedriver.h:92
digital_out_t il1
Definition: hbridgedriver.h:96
digital_out_t gen
Definition: hbridgedriver.h:95
digital_out_t il2
Definition: hbridgedriver.h:93
digital_out_t ih1
Definition: hbridgedriver.h:97
digital_out_t ih2
Definition: hbridgedriver.h:94