pwm2 2.0.0.0
Public function

Functions

void pwm2_cfg_setup (pwm2_cfg_t *cfg)
 Config Object Initialization function.
 
PWM2_RETVAL pwm2_init (pwm2_t *ctx, pwm2_cfg_t *cfg)
 Initialization function.
 
void pwm2_set_duty_cycle (pwm2_t *ctx, float duty_cycle)
 Generic sets PWM duty cycle.
 
void pwm2_pwm_stop (pwm2_t *ctx)
 Stop PWM module.
 
void pwm2_pwm_start (pwm2_t *ctx)
 Start PWM module.
 
void pwm2_generic_transfer (pwm2_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
void pwm2_toggle_phase_shift (pwm2_t *ctx)
 Toggle phase shift.
 
uint8_t pwm2_set_channel (pwm2_t *ctx, uint8_t n_channel, uint16_t width, uint8_t correction)
 Set channel function.
 
void pwm2_default_cfg (pwm2_t *ctx)
 Click Default Configuration function.
 

Detailed Description

Function Documentation

◆ pwm2_cfg_setup()

void pwm2_cfg_setup ( pwm2_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.

◆ pwm2_default_cfg()

void pwm2_default_cfg ( pwm2_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for PWM 2 Click.

◆ pwm2_generic_transfer()

void pwm2_generic_transfer ( pwm2_t * ctx,
uint8_t * wr_buf,
uint16_t wr_len,
uint8_t * rd_buf,
uint16_t rd_len )

Generic transfer function.

Parameters
ctxClick object.
wr_bufWrite data buffer
wr_lenNumber of byte in write data buffer
rd_bufRead data buffer
rd_lenNumber of byte in read data buffer

@description Generic SPI transfer, for sending and receiving packages

◆ pwm2_init()

PWM2_RETVAL pwm2_init ( pwm2_t * ctx,
pwm2_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ pwm2_pwm_start()

void pwm2_pwm_start ( pwm2_t * ctx)

Start PWM module.

Parameters
ctxClick object.

@description This function starts PWM module.

◆ pwm2_pwm_stop()

void pwm2_pwm_stop ( pwm2_t * ctx)

Stop PWM module.

Parameters
ctxClick object.

@description This function stops PWM module.

◆ pwm2_set_channel()

uint8_t pwm2_set_channel ( pwm2_t * ctx,
uint8_t n_channel,
uint16_t width,
uint8_t correction )

Set channel function.

Parameters
ctxClick object.
n_channelChannel select.
widthChannel width.
correctionCorrection.

@description This function choose one or more channel of 48.

◆ pwm2_set_duty_cycle()

void pwm2_set_duty_cycle ( pwm2_t * ctx,
float duty_cycle )

Generic sets PWM duty cycle.

Parameters
ctxClick object.
duty_cycleDuty cycle.

@description This function sets the PWM duty cycle.

◆ pwm2_toggle_phase_shift()

void pwm2_toggle_phase_shift ( pwm2_t * ctx)

Toggle phase shift.

Parameters
ctxClick object.

@description This function set toggle phase shift.