hbridge10 2.0.0.0
hbridge10.h File Reference

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

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

Go to the source code of this file.

Data Structures

struct  hbridge10_t
 H-Bridge 10 Click context object. More...
 
struct  hbridge10_cfg_t
 H-Bridge 10 Click configuration object. More...
 

Macros

#define HBRIDGE10_IN_STATUS_RESET   0x8000
 H-Bridge 10 data input register setting.
 
#define HBRIDGE10_IN_OUT_LS1_ON   0x1000
 
#define HBRIDGE10_IN_OUT_HS1_ON   0x0800
 
#define HBRIDGE10_IN_OUT_LS2_ON   0x0100
 
#define HBRIDGE10_IN_OUT_HS2_ON   0x0080
 
#define HBRIDGE10_IN_OUT_LS3_ON   0x0010
 
#define HBRIDGE10_IN_OUT_HS3_ON   0x0008
 
#define HBRIDGE10_IN_OPEN_LOAD_OFF   0x0004
 
#define HBRIDGE10_IN_SHORT_SD_DELAY_12MS   0x0002
 
#define HBRIDGE10_IN_SHORT_SD_DELAY_1p5MS   0x0000
 
#define HBRIDGE10_IN_SOFT_ENABLE   0x0001
 
#define HBRIDGE10_OUT_OVER_TEMP_SD   0xFFFF
 H-Bridge 10 data output register setting.
 
#define HBRIDGE10_OUT_OVER_TEMP_WARNING   0x8000
 
#define HBRIDGE10_OUT_STATUS_LS1_ON   0x1000
 
#define HBRIDGE10_OUT_STATUS_HS1_ON   0x0800
 
#define HBRIDGE10_OUT_STATUS_LS2_ON   0x0100
 
#define HBRIDGE10_OUT_STATUS_HS2_ON   0x0080
 
#define HBRIDGE10_OUT_STATUS_LS3_ON   0x0010
 
#define HBRIDGE10_OUT_STATUS_HS3_ON   0x0008
 
#define HBRIDGE10_OUT_SHORT_CIRCUIT_DETECTED   0x0004
 
#define HBRIDGE10_OUT_NORMAL_OPERATION   0x0002
 
#define HBRIDGE10_OUT_VS_UNDER_VOLTAGE   0x0001
 
#define HBRIDGE10_CHANNEL_OUT1   1
 H-Bridge 10 output setting.
 
#define HBRIDGE10_CHANNEL_OUT2   2
 
#define HBRIDGE10_CHANNEL_OUT3   3
 
#define HBRIDGE10_OUT_OFF   0
 
#define HBRIDGE10_OUT_HIGH   1
 
#define HBRIDGE10_OUT_LOW   2
 
#define HBRIDGE10_OUT_MASK   3u
 
#define HBRIDGE10_ADC_VREF   3.3
 H-Bridge 10 ADC reading voltage reference setting.
 
#define HBRIDGE10_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define HBRIDGE10_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define HBRIDGE10_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  hbridge10_return_value_t { HBRIDGE10_OK = 0 , HBRIDGE10_ERROR = -1 }
 H-Bridge 10 Click return value data. More...
 

Functions

void hbridge10_cfg_setup (hbridge10_cfg_t *cfg)
 H-Bridge 10 configuration object setup function.
 
err_t hbridge10_init (hbridge10_t *ctx, hbridge10_cfg_t *cfg)
 H-Bridge 10 initialization function.
 
err_t hbridge10_default_cfg (hbridge10_t *ctx)
 H-Bridge 10 default configuration function.
 
err_t hbridge10_transfer_data (hbridge10_t *ctx, uint16_t data_in, uint16_t *data_out)
 H-Bridge 10 transfer data function.
 
err_t hbridge10_set_output_state (hbridge10_t *ctx, uint8_t channel, uint8_t state)
 H-Bridge 10 set output state function.
 
err_t hbridge10_get_status (hbridge10_t *ctx, uint16_t *status)
 H-Bridge 10 get status function.
 
err_t hbridge10_read_an_pin_value (hbridge10_t *ctx, uint16_t *data_out)
 H-Bridge 10 read AN pin value function.
 
err_t hbridge10_read_an_pin_voltage (hbridge10_t *ctx, float *data_out)
 H-Bridge 10 read AN pin voltage level function.
 
void hbridge10_enable_device (hbridge10_t *ctx)
 H-Bridge 10 enable device function.
 
void hbridge10_disable_device (hbridge10_t *ctx)
 H-Bridge 10 disable device function.
 
uint8_t hbridge10_get_fault_pin (hbridge10_t *ctx)
 H-Bridge 10 get fault function.
 

Detailed Description

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

Enumeration Type Documentation

◆ hbridge10_return_value_t

H-Bridge 10 Click return value data.

Predefined enum values for driver return values.

Enumerator
HBRIDGE10_OK 
HBRIDGE10_ERROR