dcmotor29 2.1.0.0
DC Motor 29 Click Driver

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

Topics

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

Functions

void dcmotor29_cfg_setup (dcmotor29_cfg_t *cfg)
 DC Motor 29 configuration object setup function.
 
err_t dcmotor29_init (dcmotor29_t *ctx, dcmotor29_cfg_t *cfg)
 DC Motor 29 initialization function.
 
err_t dcmotor29_default_cfg (dcmotor29_t *ctx)
 DC Motor 29 default configuration function.
 
err_t dcmotor29_generic_write (dcmotor29_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 DC Motor 29 data writing function.
 
err_t dcmotor29_generic_read (dcmotor29_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 DC Motor 29 data reading function.
 
void dcmotor29_set_in1_pin (dcmotor29_t *ctx, uint8_t pin_state)
 DC Motor 29 set IN1 pin function.
 
void dcmotor29_set_rst_pin (dcmotor29_t *ctx, uint8_t pin_state)
 DC Motor 29 set RST pin function.
 
uint8_t dcmotor29_get_ip_pin (dcmotor29_t *ctx)
 DC Motor 29 get IP pin function.
 
uint8_t dcmotor29_get_int_pin (dcmotor29_t *ctx)
 DC Motor 29 get INT pin function.
 
err_t dcmotor29_register_write (dcmotor29_t *ctx, uint8_t reg, uint8_t data_in)
 DC Motor 29 data register writing function.
 
err_t dcmotor29_register_read (dcmotor29_t *ctx, uint8_t reg, uint8_t *data_out)
 DC Motor 29 data register reading function.
 
err_t dcmotor29_port_expander_write (dcmotor29_t *ctx, uint8_t reg, uint8_t data_in)
 DC Motor 29 port ecpander write register function.
 
err_t dcmotor29_port_expander_read (dcmotor29_t *ctx, uint8_t reg, uint8_t *data_out)
 DC Motor 29 port ecpander read register function.
 
err_t dcmotor29_set_pins (dcmotor29_t *ctx, uint8_t set_mask, uint8_t clr_mask)
 DC Motor 29 set pins function.
 
err_t dcmotor29_drvoff_state (dcmotor29_t *ctx, uint8_t drvoff_state)
 DC Motor 29 control drvoff function.
 
err_t dcmotor29_drive_motor (dcmotor29_t *ctx, uint8_t state)
 DC Motor 29 drive motor function.
 

Detailed Description

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

◆ dcmotor29_cfg_setup()

void dcmotor29_cfg_setup ( dcmotor29_cfg_t * cfg)

DC Motor 29 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ dcmotor29_default_cfg()

err_t dcmotor29_default_cfg ( dcmotor29_t * ctx)

DC Motor 29 default configuration function.

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

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

◆ dcmotor29_drive_motor()

err_t dcmotor29_drive_motor ( dcmotor29_t * ctx,
uint8_t state )

DC Motor 29 drive motor function.

This function sets motor driver into the selected state.

Parameters
[in]ctx: Click context object. See dcmotor29_t object definition for detailed explanation.
[in]state: State of the driver.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor29_drvoff_state()

err_t dcmotor29_drvoff_state ( dcmotor29_t * ctx,
uint8_t drvoff_state )

DC Motor 29 control drvoff function.

This function sets the state of the DRVOFF pin, enabling or disabling outputs.

Parameters
[in]ctx: Click context object. See dcmotor29_t object definition for detailed explanation.
[in]drvoff_state: State of the DRVOFF pin.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor29_generic_read()

err_t dcmotor29_generic_read ( dcmotor29_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

DC Motor 29 data reading function.

This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.

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

◆ dcmotor29_generic_write()

err_t dcmotor29_generic_write ( dcmotor29_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

DC Motor 29 data writing function.

This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.

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

◆ dcmotor29_get_int_pin()

uint8_t dcmotor29_get_int_pin ( dcmotor29_t * ctx)

DC Motor 29 get INT pin function.

This function is used to get state of the INT pin.

Parameters
[in]ctx: Click context object. See dcmotor29_t object definition for detailed explanation.
Returns
State of the INT pin.
Note
None.

◆ dcmotor29_get_ip_pin()

uint8_t dcmotor29_get_ip_pin ( dcmotor29_t * ctx)

DC Motor 29 get IP pin function.

This function is used to get state of the IP pin.

Parameters
[in]ctx: Click context object. See dcmotor29_t object definition for detailed explanation.
Returns
State of the IP pin.
Note
None.

◆ dcmotor29_init()

err_t dcmotor29_init ( dcmotor29_t * ctx,
dcmotor29_cfg_t * cfg )

DC Motor 29 initialization function.

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

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

◆ dcmotor29_port_expander_read()

err_t dcmotor29_port_expander_read ( dcmotor29_t * ctx,
uint8_t reg,
uint8_t * data_out )

DC Motor 29 port ecpander read register function.

This function reads a data byte from the selected register of the port expander.

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

◆ dcmotor29_port_expander_write()

err_t dcmotor29_port_expander_write ( dcmotor29_t * ctx,
uint8_t reg,
uint8_t data_in )

DC Motor 29 port ecpander write register function.

This function writes a data byte into the selected register of the port expander.

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

◆ dcmotor29_register_read()

err_t dcmotor29_register_read ( dcmotor29_t * ctx,
uint8_t reg,
uint8_t * data_out )

DC Motor 29 data register reading function.

This function reads a data byte from the selected register by using SPI serial interface.

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

◆ dcmotor29_register_write()

err_t dcmotor29_register_write ( dcmotor29_t * ctx,
uint8_t reg,
uint8_t data_in )

DC Motor 29 data register writing function.

This function writes a data byte into the selected register by using SPI serial interface.

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

◆ dcmotor29_set_in1_pin()

void dcmotor29_set_in1_pin ( dcmotor29_t * ctx,
uint8_t pin_state )

DC Motor 29 set IN1 pin function.

This function is used to set state of the IN1 pin.

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

◆ dcmotor29_set_pins()

err_t dcmotor29_set_pins ( dcmotor29_t * ctx,
uint8_t set_mask,
uint8_t clr_mask )

DC Motor 29 set pins function.

This function sets and clears the value of the selected pins of PCA9538A port expander.

Parameters
[in]ctx: Click context object. See dcmotor29_t object definition for detailed explanation.
[in]clr_mask: Pin clear mask.
[in]set_mask: Pin set mask.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor29_set_rst_pin()

void dcmotor29_set_rst_pin ( dcmotor29_t * ctx,
uint8_t pin_state )

DC Motor 29 set RST pin function.

This function is used to set state of the RST pin.

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