pwm 2.0.0.0
|
Functions | |
void | pwm_cfg_setup (pwm_cfg_t *cfg) |
Config Object Initialization function. | |
PWM_RETVAL | pwm_init (pwm_t *ctx, pwm_cfg_t *cfg) |
Initialization function. | |
void | pwm_generic_write (pwm_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | pwm_generic_read (pwm_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
void | pwm_set_output (pwm_t *ctx, uint8_t en_ou) |
Output state set function. | |
void | pwm_dev_config (pwm_t *ctx, uint8_t *config) |
Device configuration function. | |
void | pwm_output_config (pwm_t *ctx, uint8_t *config1) |
Output configuration function. | |
void | pwm_channel_state (pwm_t *ctx, uint8_t chann_id, uint8_t state) |
Channel state function. | |
void | pwm_set_channel_raw (pwm_t *ctx, uint8_t chann_id, uint16_t raw_off_set, uint16_t raw_dc) |
Set channel raw function. | |
void | pwm_all_chann_state (pwm_t *ctx, uint8_t state) |
All channels state function. | |
void | pwm_set_pre_scale (pwm_t *ctx, uint8_t pre_scale) |
Set pre scale function. | |
void | pwm_set_all_raw (pwm_t *ctx, uint16_t raw_dc) |
Set all channels raw function. | |
void pwm_all_chann_state | ( | pwm_t * | ctx, |
uint8_t | state ) |
All channels state function.
ctx | Click object. |
state | if set to :
|
@description This function is used to set the state of all channels.
void pwm_cfg_setup | ( | pwm_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void pwm_channel_state | ( | pwm_t * | ctx, |
uint8_t | chann_id, | ||
uint8_t | state ) |
Channel state function.
ctx | Click object. |
chann_id | 4-bit value that defines what channel is used |
state | if set to :
|
@description This function is used to set the state of a specific channel.
void pwm_dev_config | ( | pwm_t * | ctx, |
uint8_t * | config ) |
Device configuration function.
ctx | Click object. |
config[0] | if set to :
|
config[1] | if set to :
|
config[2] | if set to :
|
config[3] | if set to :
|
config[4] | if set to :
|
config[5] | if set to :
|
@description This function configuration the device.
void pwm_generic_read | ( | pwm_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function reads data from the desired register.
void pwm_generic_write | ( | pwm_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function writes data to the desired register.
PWM_RETVAL pwm_init | ( | pwm_t * | ctx, |
pwm_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void pwm_output_config | ( | pwm_t * | ctx, |
uint8_t * | config1 ) |
Output configuration function.
ctx | Click object. |
config[0] | if set to :
|
config1[1] | if set to :
|
config1[2] | if set to :
|
config1[3] | if set to :
|
@description This function configuration output.
void pwm_set_all_raw | ( | pwm_t * | ctx, |
uint16_t | raw_dc ) |
Set all channels raw function.
ctx | Click object. |
raw_dc | 12-bit value that defines raw DC |
@description This function is used to set all channels output with raw data.
void pwm_set_channel_raw | ( | pwm_t * | ctx, |
uint8_t | chann_id, | ||
uint16_t | raw_off_set, | ||
uint16_t | raw_dc ) |
Set channel raw function.
ctx | Click object. |
chann_id | 4-bit value that defines what channel is used |
raw_off_set | 12-bit value that defines raw offset |
raw_dc | 12-bit value that defines raw DC |
@description This function is used to specific set channel output with data.
void pwm_set_output | ( | pwm_t * | ctx, |
uint8_t | en_ou ) |
Output state set function.
ctx | Click object. |
en_ou | Click object. |
@description This function set output state.
void pwm_set_pre_scale | ( | pwm_t * | ctx, |
uint8_t | pre_scale ) |
Set pre scale function.
ctx | Click object. |
pre_scale | 8-bit value that defines the frequency |
@description This function uses prescaler to program the PWM output frequency.