dcmotor25 2.1.0.0
DC Motor 25 Click Driver

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

Topics

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

Functions

void dcmotor25_cfg_setup (dcmotor25_cfg_t *cfg)
 DC Motor 25 configuration object setup function.
 
err_t dcmotor25_init (dcmotor25_t *ctx, dcmotor25_cfg_t *cfg)
 DC Motor 25 initialization function.
 
err_t dcmotor25_default_cfg (dcmotor25_t *ctx)
 DC Motor 25 default configuration function.
 
err_t dcmotor25_write_byte (dcmotor25_t *ctx, uint8_t inst, uint8_t data_in)
 DC Motor 25 I2C writing function.
 
err_t dcmotor25_read_byte (dcmotor25_t *ctx, uint8_t *data_out)
 DC Motor 25 I2C reading function.
 
err_t dcmotor25_write_rdac (dcmotor25_t *ctx, uint8_t rdac_data)
 DC Motor 25 write RDAC function.
 
err_t dcmotor25_read_rdac (dcmotor25_t *ctx, uint8_t *rdac_data)
 DC Motor 25 read RDAC function.
 
err_t dcmotor25_set_digi_pot (dcmotor25_t *ctx, uint8_t wiper_pos)
 DC Motor 25 set the digital potentiometer function.
 
err_t dcmotor25_set_resistance (dcmotor25_t *ctx, uint16_t res_ohm)
 DC Motor 25 set the resistance function.
 
void dcmotor25_standby (dcmotor25_t *ctx)
 DC Motor 25 set standby mode function.
 
void dcmotor25_reverse (dcmotor25_t *ctx)
 DC Motor 25 set reverse mode function.
 
void dcmotor25_forward (dcmotor25_t *ctx)
 DC Motor 25 set forward mode function.
 
void dcmotor25_brake (dcmotor25_t *ctx)
 DC Motor 25 set brake mode function.
 

Detailed Description

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

◆ dcmotor25_brake()

void dcmotor25_brake ( dcmotor25_t * ctx)

DC Motor 25 set brake mode function.

This function set brake operating mode of the A3908, Low Voltage DC Motor Driver on the DC Motor 25 Click board™.

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

◆ dcmotor25_cfg_setup()

void dcmotor25_cfg_setup ( dcmotor25_cfg_t * cfg)

DC Motor 25 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ dcmotor25_default_cfg()

err_t dcmotor25_default_cfg ( dcmotor25_t * ctx)

DC Motor 25 default configuration function.

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

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

◆ dcmotor25_forward()

void dcmotor25_forward ( dcmotor25_t * ctx)

DC Motor 25 set forward mode function.

This function set forward operating mode of the A3908, Low Voltage DC Motor Driver on the DC Motor 25 Click board™.

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

◆ dcmotor25_init()

err_t dcmotor25_init ( dcmotor25_t * ctx,
dcmotor25_cfg_t * cfg )

DC Motor 25 initialization function.

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

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

◆ dcmotor25_read_byte()

err_t dcmotor25_read_byte ( dcmotor25_t * ctx,
uint8_t * data_out )

DC Motor 25 I2C reading function.

This function reads data bytes by using I2C serial interface.

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

◆ dcmotor25_read_rdac()

err_t dcmotor25_read_rdac ( dcmotor25_t * ctx,
uint8_t * rdac_data )

DC Motor 25 read RDAC function.

This function function reads 6-bit RDAC values of the AD5171, 64-Position OTP Digital Potentiometer on the DC Motor 25 Click board™.

Parameters
[in]ctx: Click context object. See dcmotor25_t object definition for detailed explanation.
[out]rdac_data: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor25_reverse()

void dcmotor25_reverse ( dcmotor25_t * ctx)

DC Motor 25 set reverse mode function.

This function set reverse operating mode of the A3908, Low Voltage DC Motor Driver on the DC Motor 25 Click board™.

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

◆ dcmotor25_set_digi_pot()

err_t dcmotor25_set_digi_pot ( dcmotor25_t * ctx,
uint8_t wiper_pos )

DC Motor 25 set the digital potentiometer function.

This function set the digital potentiometer wiper position of the AD5171, 64-Position OTP Digital Potentiometer on the DC Motor 25 Click board™.

Parameters
[in]ctx: Click context object. See dcmotor25_t object definition for detailed explanation.
[in]wiper_pos: Wiper position (from 0 to 63).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor25_set_resistance()

err_t dcmotor25_set_resistance ( dcmotor25_t * ctx,
uint16_t res_ohm )

DC Motor 25 set the resistance function.

This function set the resistance value of the digital potentiometer wiper position of the AD5171, 64-Position OTP Digital Potentiometer on the DC Motor 25 Click board™.

Parameters
[in]ctx: Click context object. See dcmotor25_t object definition for detailed explanation.
[in]res_ohm: Resistance (from 17000 to 50000 Ohm).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor25_standby()

void dcmotor25_standby ( dcmotor25_t * ctx)

DC Motor 25 set standby mode function.

This function set standby operating mode of the A3908, Low Voltage DC Motor Driver on the DC Motor 25 Click board™.

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

◆ dcmotor25_write_byte()

err_t dcmotor25_write_byte ( dcmotor25_t * ctx,
uint8_t inst,
uint8_t data_in )

DC Motor 25 I2C writing function.

This function writes data bytes with desired instructions by using I2C serial interface.

Parameters
[in]ctx: Click context object. See dcmotor25_t object definition for detailed explanation.
[in]inst: Instruction Byte.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor25_write_rdac()

err_t dcmotor25_write_rdac ( dcmotor25_t * ctx,
uint8_t rdac_data )

DC Motor 25 write RDAC function.

This function writes 6-bit RDAC values of the AD5171, 64-Position OTP Digital Potentiometer on the DC Motor 25 Click board™.

Parameters
[in]ctx: Click context object. See dcmotor25_t object definition for detailed explanation.
[in]rdac_data: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.