hbridge12 2.1.0.0
hbridge12.h File Reference

This file contains API for H-Bridge 12 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  hbridge12_config_t
 H-Bridge 12 Click configuration structure. More...
 
struct  hbridge12_t
 H-Bridge 12 Click context object. More...
 
struct  hbridge12_cfg_t
 H-Bridge 12 Click configuration object. More...
 

Macros

#define HBRIDGE12_ADDR_AB   0x00
 H-Bridge 12 description register.
 
#define HBRIDGE12_ADDR_CD   0x01
 
#define HBRIDGE12_CURRENT_SCALE_20_PER   0x00
 H-Bridge 12 description setting.
 
#define HBRIDGE12_CURRENT_SCALE_38_PER   0x04
 
#define HBRIDGE12_CURRENT_SCALE_56_PER   0x02
 
#define HBRIDGE12_CURRENT_SCALE_71_PER   0x06
 
#define HBRIDGE12_CURRENT_SCALE_83_PER   0x01
 
#define HBRIDGE12_CURRENT_SCALE_92_PER   0x05
 
#define HBRIDGE12_CURRENT_SCALE_98_PER   0x03
 
#define HBRIDGE12_CURRENT_SCALE_100_PER   0x07
 
#define HBRIDGE12_PHASE_OUT1_H_OUT2_L   0x01
 H-Bridge 12 phase setting.
 
#define HBRIDGE12_PHASE_OUT1_L_OUT2_H   0x00
 
#define HBRIDGE12_ENABLE_BRIDGE_OUTPUT   0x01
 H-Bridge 12 bridge enable setting.
 
#define HBRIDGE12_DISABLE_BRIDGE_OUTPUT   0x00
 
#define HBRIDGE12_AB_BRIDGE_SEL   0x00
 H-Bridge 12 bridge selection setting.
 
#define HBRIDGE12_CD_BRIDGE_SEL   0x01
 
#define HBRIDGE12_PIN_STATE_LOW   0x00
 H-Bridge 12 pin setting.
 
#define HBRIDGE12_PIN_STATE_HIGH   0x01
 
#define HBRIDGE12_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define HBRIDGE12_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define HBRIDGE12_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  hbridge12_return_value_t { HBRIDGE12_OK = 0 , HBRIDGE12_ERROR = -1 }
 H-Bridge 12 Click return value data. More...
 

Functions

void hbridge12_cfg_setup (hbridge12_cfg_t *cfg)
 H-Bridge 12 configuration object setup function.
 
err_t hbridge12_init (hbridge12_t *ctx, hbridge12_cfg_t *cfg)
 H-Bridge 12 initialization function.
 
err_t hbridge12_default_cfg (hbridge12_t *ctx)
 H-Bridge 12 default configuration function.
 
void hbridge12_set_rst (hbridge12_t *ctx, uint8_t pin_state)
 H-Bridge 12 set RST pin state function.
 
void hbridge12_set_slp (hbridge12_t *ctx, uint8_t pin_state)
 H-Bridge 12 set SLP pin state function.
 
void hbridge12_set_strobe (hbridge12_t *ctx, uint8_t pin_state)
 H-Bridge 12 set STB pin state function.
 
void hbridge12_generate_strobe (hbridge12_t *ctx)
 H-Bridge 12 generate strobe signal function.
 
void hbridge12_get_settings (hbridge12_t *ctx, uint8_t channel_sel, hbridge12_config_t *config_data)
 H-Bridge 12 get settings function.
 
void hbridge12_set_settings (hbridge12_t *ctx, uint8_t channel_sel, hbridge12_config_t config_data)
 H-Bridge 12 set settings function.
 
err_t hbridge12_write_config (hbridge12_t *ctx, hbridge12_config_t config_data)
 H-Bridge 12 write settings function.
 
void hbridge12_set_current_scale (hbridge12_t *ctx, uint8_t channel_sel, uint8_t out1_curr_scale, uint8_t out2_curr_scale)
 H-Bridge 12 set current scale function.
 
void hbridge12_set_decay (hbridge12_t *ctx, uint8_t channel_sel, uint8_t out1_decay, uint8_t out2_decay)
 H-Bridge 12 set decay function.
 
err_t hbridge12_turn_clockwise (hbridge12_t *ctx, uint8_t channel_sel)
 H-Bridge 12 turn motor clockwise function.
 
err_t hbridge12_turn_counterclockwise (hbridge12_t *ctx, uint8_t channel_sel)
 H-Bridge 12 turn motor counterclockwise function.
 
err_t hbridge12_turn_brake_on (hbridge12_t *ctx, uint8_t channel_sel)
 H-Bridge 12 turn motor brake on function.
 
err_t hbridge12_freewheeling_on (hbridge12_t *ctx, uint8_t channel_sel)
 H-Bridge 12 set motor into freewheeling mode function.
 

Detailed Description

This file contains API for H-Bridge 12 Click Driver.

Enumeration Type Documentation

◆ hbridge12_return_value_t

H-Bridge 12 Click return value data.

Predefined enum values for driver return values.

Enumerator
HBRIDGE12_OK 
HBRIDGE12_ERROR