42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
65#define HBRIDGE2_MAP_MIKROBUS( cfg, mikrobus ) \
66 cfg.gin= MIKROBUS( mikrobus, MIKROBUS_AN ); \
67 cfg.dir= MIKROBUS( mikrobus, MIKROBUS_RST ); \
68 cfg.end= MIKROBUS( mikrobus, MIKROBUS_CS ); \
69 cfg.pwm= MIKROBUS( mikrobus, MIKROBUS_PWM )
76#define HBRIDGE2_RETVAL uint8_t
78#define HBRIDGE2_OK 0x00
79#define HBRIDGE2_INIT_ERROR 0xFF
86#define HBRIDGE2_OUT1_H_OUT2_H 0x00
87#define HBRIDGE2_OUT1_H_OUT2_L 0x01
88#define HBRIDGE2_OUT1_L_OUT2_H 0x02
89#define HBRIDGE2_OUT1_Z_OUT2_Z 0x03
91#define HBRIDGE2_DISABLE 0x00
92#define HBRIDGE2_ENABLE 0x01
94#define HBRIDGE2_GOUT_HIGH 0x00
95#define HBRIDGE2_GOUT_LOW 0x01
#define HBRIDGE2_RETVAL
Definition hbridge2.h:76
void hbridge2_enable(hbridge2_t *ctx, uint8_t state)
Enable function.
HBRIDGE2_RETVAL hbridge2_init(hbridge2_t *ctx, hbridge2_cfg_t *cfg)
Initialization function.
void hbridge2_set_gout(hbridge2_t *ctx, uint8_t state)
GOUT Set function.
void hbridge2_cfg_setup(hbridge2_cfg_t *cfg)
Config Object Initialization function.
uint8_t hbridge2_set_output(hbridge2_t *ctx, uint8_t out_state)
Output Set function.
Click configuration structure definition.
Definition hbridge2.h:125
pin_name_t dir
Definition hbridge2.h:129
pin_name_t end
Definition hbridge2.h:130
pin_name_t pwm
Definition hbridge2.h:131
pin_name_t gin
Definition hbridge2.h:128
Click ctx object definition.
Definition hbridge2.h:109
digital_out_t pwm
Definition hbridge2.h:115
digital_out_t end
Definition hbridge2.h:114
digital_out_t dir
Definition hbridge2.h:113
digital_out_t gin
Definition hbridge2.h:112