hbridge10 2.0.0.0
H-Bridge 10 Click Driver

API for configuring and manipulating H-Bridge 10 Click driver. More...

Topics

 H-Bridge 10 Settings
 Settings of H-Bridge 10 Click driver.
 
 H-Bridge 10 MikroBUS Map
 MikroBUS pin mapping of H-Bridge 10 Click driver.
 

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

API for configuring and manipulating H-Bridge 10 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ hbridge10_cfg_setup()

void hbridge10_cfg_setup ( hbridge10_cfg_t * cfg)

H-Bridge 10 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See hbridge10_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ hbridge10_default_cfg()

err_t hbridge10_default_cfg ( hbridge10_t * ctx)

H-Bridge 10 default configuration function.

This function executes a default configuration of H-Bridge 10 click board.

Parameters
[in]ctx: Click context object. See hbridge10_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ hbridge10_disable_device()

void hbridge10_disable_device ( hbridge10_t * ctx)

H-Bridge 10 disable device function.

This function disables the device by setting the EN pin to LOW logic state.

Parameters
[in]ctx: Click context object. See hbridge10_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ hbridge10_enable_device()

void hbridge10_enable_device ( hbridge10_t * ctx)

H-Bridge 10 enable device function.

This function enables the device by setting the EN pin to HIGH logic state.

Parameters
[in]ctx: Click context object. See hbridge10_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ hbridge10_get_fault_pin()

uint8_t hbridge10_get_fault_pin ( hbridge10_t * ctx)

H-Bridge 10 get fault function.

This function returns the fault (FLT) pin logic state.

Parameters
[in]ctx: Click context object. See hbridge10_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ hbridge10_get_status()

err_t hbridge10_get_status ( hbridge10_t * ctx,
uint16_t * status )

H-Bridge 10 get status function.

This function reads the status of output register.

Parameters
[in]ctx: Click context object. See hbridge10_t object definition for detailed explanation.
[out]status: Status read from output register.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function doesn't change the input register settings.

◆ hbridge10_init()

err_t hbridge10_init ( hbridge10_t * ctx,
hbridge10_cfg_t * cfg )

H-Bridge 10 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See hbridge10_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See hbridge10_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hbridge10_read_an_pin_value()

err_t hbridge10_read_an_pin_value ( hbridge10_t * ctx,
uint16_t * data_out )

H-Bridge 10 read AN pin value function.

This function reads results of AD conversion of the AN pin.

Parameters
[in]ctx: Click context object. See hbridge10_t object definition for detailed explanation.
[out]data_out: Output ADC result.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ hbridge10_read_an_pin_voltage()

err_t hbridge10_read_an_pin_voltage ( hbridge10_t * ctx,
float * data_out )

H-Bridge 10 read AN pin voltage level function.

This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.

Parameters
[in]ctx: Click context object. See hbridge10_t object definition for detailed explanation.
[out]data_out: Output voltage level of the analog pin [V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered configuration of the ADC (resolution, reference voltage).

◆ hbridge10_set_output_state()

err_t hbridge10_set_output_state ( hbridge10_t * ctx,
uint8_t channel,
uint8_t state )

H-Bridge 10 set output state function.

This function sets the output channel state.

Parameters
[in]ctx: Click context object. See hbridge10_t object definition for detailed explanation.
[in]channel: Output channel selection [1-3].
[in]state: Channel state -
  • 0 - OFF,
  • 1 - HIGH,
  • 2 - LOW.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function affects only those bits related to the selected channel in the input register.

◆ hbridge10_transfer_data()

err_t hbridge10_transfer_data ( hbridge10_t * ctx,
uint16_t data_in,
uint16_t * data_out )

H-Bridge 10 transfer data function.

This function writes 16-bit data from input and performs an immediate read of 16-bit output data by using SPI serial interface.

Parameters
[in]ctx: Click context object. See hbridge10_t object definition for detailed explanation.
[in]data_in: Data to be written.
[in]data_out: Output data read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.