servo 2.0.0.0
Public function

Functions

void servo_cfg_setup (servo_cfg_t *cfg)
 Config Object Initialization function.
 
SERVO_RETVAL servo_init (servo_t *ctx, servo_cfg_t *cfg)
 Initialization function.
 
void servo_default_cfg (servo_t *ctx)
 Click Default Configuration function.
 
void servo_generic_write_of_pca9685 (servo_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function of pca9685.
 
void servo_generic_write_of_of_ltc2497 (servo_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function of ltc2497.
 
void servo_generic_read_of_pca9685 (servo_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function of pca9685.
 
void servo_generic_read_of_ltc2497 (servo_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function of ltc2497.
 
void servo_setting (servo_t *ctx, servo_pos_and_res_t pos_and_res)
 Setting function.
 
void servo_set_vref (servo_t *ctx, uint16_t v_ref)
 Set Vref function.
 
void servo_stop (servo_t *ctx)
 Stop function.
 
void servo_start (servo_t *ctx)
 Start function.
 
void servo_soft_reset (servo_t *ctx)
 Soft reset function.
 
void servo_sleep (servo_t *ctx)
 Sleep function.
 
void servo_set_mode (servo_t *ctx, uint8_t mode, uint8_t w_data)
 Set mode function.
 
void servo_set_position (servo_t *ctx, uint8_t motor, uint8_t position)
 Set position function.
 
void servo_set_freq (servo_t *ctx, uint16_t freq)
 Set frequency function.
 
uint32_t servo_get_channel (servo_t *ctx, uint8_t channel)
 Functions for reading adc value of current.
 
uint16_t setvo_get_current (servo_t *ctx, uint8_t channel)
 Functions for reading current in mA.
 

Detailed Description

Function Documentation

◆ servo_cfg_setup()

void servo_cfg_setup ( servo_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ servo_default_cfg()

void servo_default_cfg ( servo_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Servo click.

◆ servo_generic_read_of_ltc2497()

void servo_generic_read_of_ltc2497 ( servo_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function of ltc2497.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf.
lenNumber of the bytes to be read.

@description This function reads data from the desired register using slave_address of ltc2497.

◆ servo_generic_read_of_pca9685()

void servo_generic_read_of_pca9685 ( servo_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function of pca9685.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf.
lenNumber of the bytes to be read.

@description This function reads data from the desired register using slave_address of pca9685.

◆ servo_generic_write_of_of_ltc2497()

void servo_generic_write_of_of_ltc2497 ( servo_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function of ltc2497.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register using slave_address of ltc2497.

◆ servo_generic_write_of_pca9685()

void servo_generic_write_of_pca9685 ( servo_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function of pca9685.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register using slave_address of pca9685.

◆ servo_get_channel()

uint32_t servo_get_channel ( servo_t * ctx,
uint8_t channel )

Functions for reading adc value of current.

Parameters
ctxClick object.
channelThe channel from which it is read.

@description This function reads adc value of current.

◆ servo_init()

SERVO_RETVAL servo_init ( servo_t * ctx,
servo_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ servo_set_freq()

void servo_set_freq ( servo_t * ctx,
uint16_t freq )

Set frequency function.

Parameters
ctxClick object.
freqMotor to be set.

@description This function sets frequency.

◆ servo_set_mode()

void servo_set_mode ( servo_t * ctx,
uint8_t mode,
uint8_t w_data )

Set mode function.

Parameters
ctxClick object.
modeOne of the two modes to be set.
w_dataData that will be written in the register.

@description This function sets mod.

Note
Options for mode 1 that can be set: Restart ( enable or disable ) Clock ( internal clock or EXTCLK pin clock ) Auto-Increment ( enable or disable ) Mode ( normal mode or low power mod ) SubAddress 1 ( uses or does not use ) SubAddress 2 ( uses or does not use ) SubAddress 3 ( uses or does not use ) Motor all call address ( uses or does not use )

Options for mode 2 that can be set: Output logic state ( not inverted or inverted ) Outputs change ( Outputs change on STOP or ACK command ) Outputs configured ( open-drain structure or totem pole structure)

◆ servo_set_position()

void servo_set_position ( servo_t * ctx,
uint8_t motor,
uint8_t position )

Set position function.

Parameters
ctxClick object.
motorMotor to be set.
positionPosition on which the motor will be set.

@description This function sets position.

◆ servo_set_vref()

void servo_set_vref ( servo_t * ctx,
uint16_t v_ref )

Set Vref function.

Parameters
ctxClick object.
v_refV ref.

@description This function settings Vref of Servo Clicks.

◆ servo_setting()

void servo_setting ( servo_t * ctx,
servo_pos_and_res_t pos_and_res )

Setting function.

Parameters
ctxClick object.
pos_and_resStructure with position and resolution.

@description This function setting position and resolution.

◆ servo_sleep()

void servo_sleep ( servo_t * ctx)

Sleep function.

Parameters
ctxClick object.

@description Functions for sleep mode chip.

◆ servo_soft_reset()

void servo_soft_reset ( servo_t * ctx)

Soft reset function.

Parameters
ctxClick object.

@description Functions for soft reset chip.

◆ servo_start()

void servo_start ( servo_t * ctx)

Start function.

Parameters
ctxClick object.

@description Function for start work servo motor.

◆ servo_stop()

void servo_stop ( servo_t * ctx)

Stop function.

Parameters
ctxClick object.
v_refV ref.

@description When the servo_stop() function is started, all controls and communication with the servo motor are blocked. To restore communication, you need to call the servo_start() function. Use this function when you need to shut down the all motors quickly.

◆ setvo_get_current()

uint16_t setvo_get_current ( servo_t * ctx,
uint8_t channel )

Functions for reading current in mA.

Parameters
ctxClick object.
channelThe channel from which it is read.

@description This function reads the current value of Servo Click witch motor spends.