dcmotor23 2.1.0.0
DC Motor 23 Click Driver

API for configuring and manipulating DC Motor 23 Click driver. More...

Topics

 DC Motor 23 Registers List
 List of registers of DC Motor 23 Click driver.
 
 DC Motor 23 Registers Settings
 Settings for registers of DC Motor 23 Click driver.
 
 DC Motor 23 MikroBUS Map
 MikroBUS pin mapping of DC Motor 23 Click driver.
 

Functions

void dcmotor23_cfg_setup (dcmotor23_cfg_t *cfg)
 DC Motor 23 configuration object setup function.
 
err_t dcmotor23_init (dcmotor23_t *ctx, dcmotor23_cfg_t *cfg)
 DC Motor 23 initialization function.
 
err_t dcmotor23_default_cfg (dcmotor23_t *ctx)
 DC Motor 23 default configuration function.
 
err_t dcmotor23_write_register (dcmotor23_t *ctx, uint8_t reg, uint8_t data_in)
 DC Motor 23 I2C writing function.
 
err_t dcmotor23_read_register (dcmotor23_t *ctx, uint8_t reg, uint8_t *data_out)
 DC Motor 23 I2C reading function.
 
err_t dcmotor23_get_lo_pin (dcmotor23_t *ctx, uint8_t *pin_state)
 DC Motor 23 get LO pin function.
 
err_t dcmotor23_set_output_mode (dcmotor23_t *ctx, uint8_t mode, uint8_t sel_motor)
 DC Motor 23 set output mode function.
 
err_t dcmotor23_set_clockwise (dcmotor23_t *ctx, uint8_t sel_motor)
 DC Motor 23 set clockwise function.
 
err_t dcmotor23_set_counter_clockwise (dcmotor23_t *ctx, uint8_t sel_motor)
 DC Motor 23 set counter clockwise function.
 
err_t dcmotor23_set_decay (dcmotor23_t *ctx, uint8_t sel_motor)
 DC Motor 23 set decay function.
 
err_t dcmotor23_set_outa_torque (dcmotor23_t *ctx, uint8_t torque)
 DC Motor 23 set OUTA torque function.
 
err_t dcmotor23_set_outb_torque (dcmotor23_t *ctx, uint8_t torque)
 DC Motor 23 set OUTB torque function.
 
void dcmotor23_normal_operation_mode (dcmotor23_t *ctx)
 DC Motor 23 set normal operation mode function.
 
void dcmotor23_sleep_mode (dcmotor23_t *ctx)
 DC Motor 23 set sleep operation mode function.
 
void dcmotor23_reset_device (dcmotor23_t *ctx)
 DC Motor 23 reset device function.
 
uint8_t dcmotor23_get_int_pin (dcmotor23_t *ctx)
 DC Motor 23 get INT pin function.
 
void dcmotor23_set_en_a_pin (dcmotor23_t *ctx, uint8_t state)
 DC Motor 23 set EN_A pin function.
 
void dcmotor23_set_en_b_pin (dcmotor23_t *ctx, uint8_t state)
 DC Motor 23 set EN_B pin function.
 

Detailed Description

API for configuring and manipulating DC Motor 23 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

◆ dcmotor23_cfg_setup()

void dcmotor23_cfg_setup ( dcmotor23_cfg_t * cfg)

DC Motor 23 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ dcmotor23_default_cfg()

err_t dcmotor23_default_cfg ( dcmotor23_t * ctx)

DC Motor 23 default configuration function.

This function executes a default configuration of DC Motor 23 click board.

Parameters
[in]ctx: Click context object. See dcmotor23_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.

◆ dcmotor23_get_int_pin()

uint8_t dcmotor23_get_int_pin ( dcmotor23_t * ctx)

DC Motor 23 get INT pin function.

This function get interrupt pin stste of the PCA9538 8-bit I2C-bus and SMBus low power I/O port with interrupt and reset on the DC Motor 23 Click board™.

Parameters
[in]ctx: Click context object. See dcmotor23_t object definition for detailed explanation.
Returns
INT pin logic state. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor23_get_lo_pin()

err_t dcmotor23_get_lo_pin ( dcmotor23_t * ctx,
uint8_t * pin_state )

DC Motor 23 get LO pin function.

This function reads the LO pin logic state of the TB67H480 BiCD Constant Current Dual H-bridge Driver IC on the DC Motor 23 Click board™.

Parameters
[in]ctx: Click context object. See dcmotor23_t object definition for detailed explanation.
[out]pin_state: LO pin logic state.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor23_init()

err_t dcmotor23_init ( dcmotor23_t * ctx,
dcmotor23_cfg_t * cfg )

DC Motor 23 initialization function.

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

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

◆ dcmotor23_normal_operation_mode()

void dcmotor23_normal_operation_mode ( dcmotor23_t * ctx)

DC Motor 23 set normal operation mode function.

This function set normal operation mode and enable the TB67H480 BiCD Constant Current Dual H-bridge Driver IC on the DC Motor 23 Click board™.

Parameters
[in]ctx: Click context object. See dcmotor23_t object definition for detailed explanation.
Returns
Nothing. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor23_read_register()

err_t dcmotor23_read_register ( dcmotor23_t * ctx,
uint8_t reg,
uint8_t * data_out )

DC Motor 23 I2C reading function.

This function reads data from the selected PCA9538A register by using I2C serial interface of the PCA9538 8-bit I2C-bus and SMBus low power I/O port with interrupt and reset on the DC Motor 23 Click board™.

Parameters
[in]ctx: Click context object. See dcmotor23_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor23_reset_device()

void dcmotor23_reset_device ( dcmotor23_t * ctx)

DC Motor 23 reset device function.

This function perform reset of the TB67H480 BiCD Constant Current Dual H-bridge Driver IC on the DC Motor 23 Click board™.

Parameters
[in]ctx: Click context object. See dcmotor23_t object definition for detailed explanation.
Returns
Nothing. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor23_set_clockwise()

err_t dcmotor23_set_clockwise ( dcmotor23_t * ctx,
uint8_t sel_motor )

DC Motor 23 set clockwise function.

This function set clockwise for the selected output of the TB67H480 BiCD Constant Current Dual H-bridge Driver IC on the DC Motor 23 Click board™.

Parameters
[in]ctx: Click context object. See dcmotor23_t object definition for detailed explanation.
[in]sel_motor:
  • DCMOTOR23_SEL_OUT_A - select A output OUTA,
  • DCMOTOR23_SEL_OUT_A - select B output OUTB.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor23_set_counter_clockwise()

err_t dcmotor23_set_counter_clockwise ( dcmotor23_t * ctx,
uint8_t sel_motor )

DC Motor 23 set counter clockwise function.

This function set counter clockwise for the selected output of the TB67H480 BiCD Constant Current Dual H-bridge Driver IC on the DC Motor 23 Click board™.

Parameters
[in]ctx: Click context object. See dcmotor23_t object definition for detailed explanation.
[in]sel_motor:
  • DCMOTOR23_SEL_OUT_A - select A output OUTA,
  • DCMOTOR23_SEL_OUT_A - select B output OUTB.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor23_set_decay()

err_t dcmotor23_set_decay ( dcmotor23_t * ctx,
uint8_t sel_motor )

DC Motor 23 set decay function.

This function set decay for the selected output of the TB67H480 BiCD Constant Current Dual H-bridge Driver IC on the DC Motor 23 Click board™.

Parameters
[in]ctx: Click context object. See dcmotor23_t object definition for detailed explanation.
[in]sel_motor:
  • DCMOTOR23_SEL_OUT_A - select A output OUTA,
  • DCMOTOR23_SEL_OUT_A - select B output OUTB.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
  • Slow Decay - State of the DECAY set to Low level,
  • Fast Decay - State of the DECAY set to High level.

◆ dcmotor23_set_en_a_pin()

void dcmotor23_set_en_a_pin ( dcmotor23_t * ctx,
uint8_t state )

DC Motor 23 set EN_A pin function.

This function sets the ENABLE_A pin logic state of the TB67H480 BiCD Constant Current Dual H-bridge Driver IC on the DC Motor 23 Click board™.

Parameters
[in]ctx: Click context object. See dcmotor23_t object definition for detailed explanation.
[in]state: ENABLE_A pin logic state.
Returns
Nothing. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor23_set_en_b_pin()

void dcmotor23_set_en_b_pin ( dcmotor23_t * ctx,
uint8_t state )

DC Motor 23 set EN_B pin function.

This function sets the ENABLE_B pin logic state of the TB67H480 BiCD Constant Current Dual H-bridge Driver IC on the DC Motor 23 Click board™.

Parameters
[in]ctx: Click context object. See dcmotor23_t object definition for detailed explanation.
[in]state: ENABLE_B pin logic state.
Returns
Nothing. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor23_set_outa_torque()

err_t dcmotor23_set_outa_torque ( dcmotor23_t * ctx,
uint8_t torque )

DC Motor 23 set OUTA torque function.

This function set sets the OUTA torque of the TB67H480 BiCD Constant Current Dual H-bridge Driver IC on the DC Motor 23 Click board™.

Parameters
[in]ctx: Click context object. See dcmotor23_t object definition for detailed explanation.
[in]torque:
  • DCMOTOR23_TORQUE_0 - 0% (Output OFF),
  • DCMOTOR23_TORQUE_38 -38%,
  • DCMOTOR23_TORQUE_71 -71%,
  • DCMOTOR23_TORQUE_100 -100%.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor23_set_outb_torque()

err_t dcmotor23_set_outb_torque ( dcmotor23_t * ctx,
uint8_t torque )

DC Motor 23 set OUTB torque function.

This function sets the OUTB torque of the TB67H480 BiCD Constant Current Dual H-bridge Driver IC on the DC Motor 23 Click board™.

Parameters
[in]ctx: Click context object. See dcmotor23_t object definition for detailed explanation.
[in]torque:
  • DCMOTOR23_TORQUE_0 - 0% (Output OFF),
  • DCMOTOR23_TORQUE_38 - 38%,
  • DCMOTOR23_TORQUE_71 - 71%,
  • DCMOTOR23_TORQUE_100 - 100%.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor23_set_output_mode()

err_t dcmotor23_set_output_mode ( dcmotor23_t * ctx,
uint8_t mode,
uint8_t sel_motor )

DC Motor 23 set output mode function.

This function set desired mode for the selected output of the TB67H480 BiCD Constant Current Dual H-bridge Driver IC on the DC Motor 23 Click board™.

Parameters
[in]ctx: Click context object. See dcmotor23_t object definition for detailed explanation.
[in]mode:
  • DCMOTOR23_MODE_DECAY - Decay,
  • DCMOTOR23_MODE_CCW - Counter-Clockwise,
  • DCMOTOR23_MODE_CW - Clockwise.
[in]sel_motor:
  • DCMOTOR23_SEL_OUT_A - select A output OUTA,
  • DCMOTOR23_SEL_OUT_A - select B output OUTB.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor23_sleep_mode()

void dcmotor23_sleep_mode ( dcmotor23_t * ctx)

DC Motor 23 set sleep operation mode function.

This function set sleep operation mode and disable the TB67H480 BiCD Constant Current Dual H-bridge Driver IC on the DC Motor 23 Click board™.

Parameters
[in]ctx: Click context object. See dcmotor23_t object definition for detailed explanation.
Returns
Nothing. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor23_write_register()

err_t dcmotor23_write_register ( dcmotor23_t * ctx,
uint8_t reg,
uint8_t data_in )

DC Motor 23 I2C writing function.

This function writes a desired data byte to the selected PCA9538A register the selected register by using I2C serial interface of the PCA9538 8-bit I2C-bus and SMBus low power I/O port with interrupt and reset on the DC Motor 23 Click board™.

Parameters
[in]ctx: Click context object. See dcmotor23_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.