hbridge5 2.0.0.0
hbridge5.h File Reference

This file contains API for H Bridge 5 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  hbridge5_t
 Click ctx object definition. More...
 
struct  hbridge5_cfg_t
 Click configuration structure definition. More...
 

Macros

#define HBRIDGE5_MAP_MIKROBUS(cfg, mikrobus)
 
#define HBRIDGE5_RETVAL   uint8_t
 
#define HBRIDGE5_OK   0x00
 
#define HBRIDGE5_INIT_ERROR   0xFF
 
#define HBRIDGE5_DEVICE_SLAVE_ADDR_0_0   0x70
 
#define HBRIDGE5_DEVICE_SLAVE_ADDR_0_1   0x71
 
#define HBRIDGE5_DEVICE_SLAVE_ADDR_1_0   0x72
 
#define HBRIDGE5_DEVICE_SLAVE_ADDR_1_1   0x73
 
#define HBRIDGE5_CMD_INPUT_PORT   0x00
 
#define HBRIDGE5_CMD_OUTPUT_PORT   0x01
 
#define HBRIDGE5_CMD_POLARITY_INVERSION   0x02
 
#define HBRIDGE5_CMD_CONFIGURATION   0x03
 
#define HBRIDGE5_PORT_PHASE   0x01
 
#define HBRIDGE5_PORT_ENABLE   0x02
 
#define HBRIDGE5_PORT_BRAKE   0x04
 
#define HBRIDGE5_PORT_B_MODE   0x08
 
#define HBRIDGE5_PORT_N_SLEEP   0x10
 
#define HBRIDGE5_PORT_N_FAULT   0x20
 
#define HBRIDGE5_ENABLE_ALL_OUTPUT_PORT   0xE0
 
#define HBRIDGE5_DISABLE_ALL_OUTPUT_PORT   0xFF
 

Functions

void hbridge5_cfg_setup (hbridge5_cfg_t *cfg)
 Config Object Initialization function.
 
HBRIDGE5_RETVAL hbridge5_init (hbridge5_t *ctx, hbridge5_cfg_t *cfg)
 Initialization function.
 
void hbridge5_default_cfg (hbridge5_t *ctx)
 Click Default Configuration function.
 
void hbridge5_generic_write (hbridge5_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void hbridge5_generic_read (hbridge5_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void hbridge5_rst_state (hbridge5_t *ctx, uint8_t state)
 Resets pin state.
 
uint8_t hbridge5_get_interrupt_state (hbridge5_t *ctx)
 Reads interrupt pin state.
 
uint8_t hbridge5_read_byte (hbridge5_t *ctx, uint8_t cmd)
 Function reads byte from register.
 
void hbridge5_write_byte (hbridge5_t *ctx, uint8_t cmd, uint8_t data_in)
 Function writes one byte in register.
 
void hbridge5_set_port (hbridge5_t *ctx, uint8_t port, uint8_t value)
 Function sets port.
 
void hbridge5_reverse (hbridge5_t *ctx)
 Puts motor into reverse motion.
 
void hbridge5_forward (hbridge5_t *ctx)
 Puts motor into forward motion.
 
void hbridge5_brake_low (hbridge5_t *ctx)
 Puts motor to a halt.
 
void hbridge5_brake_high (hbridge5_t *ctx)
 Puts motor to a halt.
 
void hbridge5_sync_decay_fwd (hbridge5_t *ctx)
 Synchronization fast decay foreward function.
 
void hbridge5_sync_decay_rev (hbridge5_t *ctx)
 Synchronization fast decay reverse function.
 
void hbridge5_sleep (hbridge5_t *ctx, uint8_t state)
 Sleep function.
 
void hbridge5_configuration (hbridge5_t *ctx, uint8_t cfg_data)
 Configuration function.
 
uint8_t hbridge5_n_fault_check (hbridge5_t *ctx)
 N fault check function.
 

Detailed Description

This file contains API for H Bridge 5 Click driver.