dcmotor26 2.1.0.0
|
API for configuring and manipulating DC Motor 26 Click driver. More...
Topics | |
DC Motor 26 Registers List | |
List of registers of DC Motor 26 Click driver. | |
DC Motor 26 Registers Settings | |
Settings for registers of DC Motor 26 Click driver. | |
DC Motor 26 MikroBUS Map | |
MikroBUS pin mapping of DC Motor 26 Click driver. | |
Functions | |
void | dcmotor26_cfg_setup (dcmotor26_cfg_t *cfg) |
DC Motor 26 configuration object setup function. | |
err_t | dcmotor26_init (dcmotor26_t *ctx, dcmotor26_cfg_t *cfg) |
DC Motor 26 initialization function. | |
err_t | dcmotor26_default_cfg (dcmotor26_t *ctx) |
DC Motor 26 default configuration function. | |
err_t | dcmotor26_write_register (dcmotor26_t *ctx, uint8_t reg, uint32_t data_in) |
DC Motor 26 write register function. | |
err_t | dcmotor26_read_register (dcmotor26_t *ctx, uint8_t reg, uint32_t *data_out) |
DC Motor 26 read register function. | |
err_t | dcmotor26_pca9538a_write_register (dcmotor26_t *ctx, uint8_t reg, uint8_t data_in) |
DC Motor 26 pca9538a write register function. | |
err_t | dcmotor26_pca9538a_read_register (dcmotor26_t *ctx, uint8_t reg, uint8_t *data_out) |
DC Motor 26 pca9538a read register function. | |
void | dcmotor26_enter_sleep_mode (dcmotor26_t *ctx) |
DC Motor 26 enter sleep mode function. | |
void | dcmotor26_wake_up_device (dcmotor26_t *ctx) |
DC Motor 26 wake up device function. | |
uint8_t | dcmotor26_get_int_pin (dcmotor26_t *ctx) |
DC Motor 26 get int pin function. | |
void | dcmotor26_set_clk_pin (dcmotor26_t *ctx, uint8_t state) |
DC Motor 26 set clk pin function. | |
err_t | dcmotor26_set_en1_pin (dcmotor26_t *ctx, uint8_t state) |
DC Motor 26 set en1 pin function. | |
err_t | dcmotor26_get_en1_pin (dcmotor26_t *ctx, uint8_t *state) |
DC Motor 26 get en1 pin function. | |
err_t | dcmotor26_set_en2_pin (dcmotor26_t *ctx, uint8_t state) |
DC Motor 26 set en2 pin function. | |
err_t | dcmotor26_get_en2_pin (dcmotor26_t *ctx, uint8_t *state) |
DC Motor 26 get en2 pin function. | |
err_t | dcmotor26_set_cm_sel_pin (dcmotor26_t *ctx, uint8_t state) |
DC Motor 26 set cm sel pin function. | |
err_t | dcmotor26_get_cm_sel_pin (dcmotor26_t *ctx, uint8_t *state) |
DC Motor 26 get cm sel pin function. | |
err_t | dcmotor26_get_diag1_pin (dcmotor26_t *ctx, uint8_t *state) |
DC Motor 26 get diag1 pin function. | |
err_t | dcmotor26_get_diag2_pin (dcmotor26_t *ctx, uint8_t *state) |
DC Motor 26 get diag2 pin function. | |
err_t | dcmotor26_get_sleep_pin (dcmotor26_t *ctx, uint8_t *state) |
DC Motor 26 get sleep pin function. | |
err_t | dcmotor26_read_an_pin_value (dcmotor26_t *ctx, uint16_t *data_out) |
DC Motor 26 read AN pin value function. | |
err_t | dcmotor26_read_an_pin_voltage (dcmotor26_t *ctx, float *data_out) |
DC Motor 26 read AN pin voltage level function. | |
err_t | dcmotor26_get_motor_current (dcmotor26_t *ctx, float *current) |
DC Motor 26 get motor current function. | |
err_t | dcmotor26_set_ch1_operation_mode (dcmotor26_t *ctx, uint8_t mode) |
DC Motor 26 set ch1 operation mode function. | |
err_t | dcmotor26_set_ch2_operation_mode (dcmotor26_t *ctx, uint8_t mode) |
DC Motor 26 set ch2 operation mode function. | |
err_t | dcmotor26_set_ch1_drive_frequency (dcmotor26_t *ctx, uint16_t drv_freq) |
DC Motor 26 set ch1 drive frequency function. | |
err_t | dcmotor26_set_ch2_drive_frequency (dcmotor26_t *ctx, uint16_t drv_freq) |
DC Motor 26 set ch2 drive frequency function. | |
err_t | dcmotor26_set_ch1_duty_period (dcmotor26_t *ctx, uint16_t duty_period) |
DC Motor 26 set ch1 duty period function. | |
err_t | dcmotor26_set_ch2_duty_period (dcmotor26_t *ctx, uint16_t duty_period) |
DC Motor 26 set ch1 duty period function. | |
API for configuring and manipulating DC Motor 26 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void dcmotor26_cfg_setup | ( | dcmotor26_cfg_t * | cfg | ) |
DC Motor 26 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See dcmotor26_cfg_t object definition for detailed explanation. |
err_t dcmotor26_default_cfg | ( | dcmotor26_t * | ctx | ) |
DC Motor 26 default configuration function.
This function executes a default configuration of DC Motor 26 click board.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void dcmotor26_enter_sleep_mode | ( | dcmotor26_t * | ctx | ) |
DC Motor 26 enter sleep mode function.
This function sets the device to sleep mode by setting the SLP pin to low logic state.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
err_t dcmotor26_get_cm_sel_pin | ( | dcmotor26_t * | ctx, |
uint8_t * | state ) |
DC Motor 26 get cm sel pin function.
This function reads the cm sel pin logic state.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[out] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor26_get_diag1_pin | ( | dcmotor26_t * | ctx, |
uint8_t * | state ) |
DC Motor 26 get diag1 pin function.
This function reads the diag1 pin logic state.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[out] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor26_get_diag2_pin | ( | dcmotor26_t * | ctx, |
uint8_t * | state ) |
DC Motor 26 get diag2 pin function.
This function reads the diag2 pin logic state.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[out] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor26_get_en1_pin | ( | dcmotor26_t * | ctx, |
uint8_t * | state ) |
DC Motor 26 get en1 pin function.
This function reads the en1 pin logic state.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[out] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor26_get_en2_pin | ( | dcmotor26_t * | ctx, |
uint8_t * | state ) |
DC Motor 26 get en2 pin function.
This function reads the en2 pin logic state.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[out] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t dcmotor26_get_int_pin | ( | dcmotor26_t * | ctx | ) |
DC Motor 26 get int pin function.
This function returns the PCA9538A INT pin logic state.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
err_t dcmotor26_get_motor_current | ( | dcmotor26_t * | ctx, |
float * | current ) |
DC Motor 26 get motor current function.
This function reads the motor current consumption.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[out] | current | : Current value [A]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor26_get_sleep_pin | ( | dcmotor26_t * | ctx, |
uint8_t * | state ) |
DC Motor 26 get sleep pin function.
This function reads the sleep pin logic state.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[out] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor26_init | ( | dcmotor26_t * | ctx, |
dcmotor26_cfg_t * | cfg ) |
DC Motor 26 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See dcmotor26_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor26_pca9538a_read_register | ( | dcmotor26_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
DC Motor 26 pca9538a read register function.
This function reads data from the selected PCA9538A register by using I2C serial interface.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor26_pca9538a_write_register | ( | dcmotor26_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
DC Motor 26 pca9538a write register function.
This function writes a desired data byte to the selected PCA9538A register by using I2C serial interface.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor26_read_an_pin_value | ( | dcmotor26_t * | ctx, |
uint16_t * | data_out ) |
DC Motor 26 read AN pin value function.
This function reads results of AD conversion of the AN pin.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[out] | data_out | : Output ADC result. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor26_read_an_pin_voltage | ( | dcmotor26_t * | ctx, |
float * | data_out ) |
DC Motor 26 read AN pin voltage level function.
This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[out] | data_out | : Output voltage level of the analog pin [V]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor26_read_register | ( | dcmotor26_t * | ctx, |
uint8_t | reg, | ||
uint32_t * | data_out ) |
DC Motor 26 read register function.
This function reads a 24-bit data from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor26_set_ch1_drive_frequency | ( | dcmotor26_t * | ctx, |
uint16_t | drv_freq ) |
DC Motor 26 set ch1 drive frequency function.
This function sets the raw drive frequency of the channel 1.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[in] | drv_freq | : Raw drive frequency (0-2047). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor26_set_ch1_duty_period | ( | dcmotor26_t * | ctx, |
uint16_t | duty_period ) |
DC Motor 26 set ch1 duty period function.
This function sets the duty period of the channel 1.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[in] | duty_period | : Duty period (0-2047). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor26_set_ch1_operation_mode | ( | dcmotor26_t * | ctx, |
uint8_t | mode ) |
DC Motor 26 set ch1 operation mode function.
This function sets the operation mode of the channel 1.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[in] | mode | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor26_set_ch2_drive_frequency | ( | dcmotor26_t * | ctx, |
uint16_t | drv_freq ) |
DC Motor 26 set ch2 drive frequency function.
This function sets the raw drive frequency of the channel 2.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[in] | drv_freq | : Raw drive frequency (0-2047). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor26_set_ch2_duty_period | ( | dcmotor26_t * | ctx, |
uint16_t | duty_period ) |
DC Motor 26 set ch1 duty period function.
This function sets the duty period of the channel 1.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[in] | duty_period | : Duty period (0-2047). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor26_set_ch2_operation_mode | ( | dcmotor26_t * | ctx, |
uint8_t | mode ) |
DC Motor 26 set ch2 operation mode function.
This function sets the operation mode of the channel 2.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[in] | mode | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void dcmotor26_set_clk_pin | ( | dcmotor26_t * | ctx, |
uint8_t | state ) |
DC Motor 26 set clk pin function.
This function sets the CLK pin logic state.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t dcmotor26_set_cm_sel_pin | ( | dcmotor26_t * | ctx, |
uint8_t | state ) |
DC Motor 26 set cm sel pin function.
This function sets the cm sel pin logic state.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor26_set_en1_pin | ( | dcmotor26_t * | ctx, |
uint8_t | state ) |
DC Motor 26 set en1 pin function.
This function sets the en1 pin logic state.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor26_set_en2_pin | ( | dcmotor26_t * | ctx, |
uint8_t | state ) |
DC Motor 26 set en2 pin function.
This function sets the en2 pin logic state.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void dcmotor26_wake_up_device | ( | dcmotor26_t * | ctx | ) |
DC Motor 26 wake up device function.
This function wakes up the device from sleep by setting the SLP pin to high logic state.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
err_t dcmotor26_write_register | ( | dcmotor26_t * | ctx, |
uint8_t | reg, | ||
uint32_t | data_in ) |
DC Motor 26 write register function.
This function writes a 24-bit data to the selected register by using SPI serial interface and checks if it is written correctly.
[in] | ctx | : Click context object. See dcmotor26_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : 24-bit data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.