brushless26 2.1.0.0
|
API for configuring and manipulating Brushless 26 Click driver. More...
Topics | |
Brushless 26 Registers List | |
List of registers of Brushless 26 Click driver. | |
Brushless 26 Registers Settings | |
Settings for registers of Brushless 26 Click driver. | |
Brushless 26 MikroBUS Map | |
MikroBUS pin mapping of Brushless 26 Click driver. | |
Functions | |
void | brushless26_cfg_setup (brushless26_cfg_t *cfg) |
Brushless 26 configuration object setup function. | |
err_t | brushless26_init (brushless26_t *ctx, brushless26_cfg_t *cfg) |
Brushless 26 initialization function. | |
err_t | brushless26_default_cfg (brushless26_t *ctx) |
Brushless 26 default configuration function. | |
err_t | brushless26_generic_write (brushless26_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Brushless 26 I2C writing function. | |
err_t | brushless26_generic_read (brushless26_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Brushless 26 I2C reading function. | |
void | brushless26_set_rst_pin (brushless26_t *ctx, uint8_t pin_state) |
Brushless 26 set rst pin function. | |
void | brushless26_reset_port_exp (brushless26_t *ctx) |
Brushless 26 reset port expander function. | |
uint8_t | brushless26_get_flt_pin (brushless26_t *ctx) |
Brushless 26 get fault pin function. | |
err_t | brushless26_write_reg (brushless26_t *ctx, uint8_t reg, uint8_t data_in) |
Brushless 26 write register function. | |
err_t | brushless26_read_reg (brushless26_t *ctx, uint8_t reg, uint8_t *data_out) |
Brushless 26 read register function. | |
err_t | brushless26_set_pins (brushless26_t *ctx, uint8_t set_mask, uint8_t clr_mask) |
Brushless 26 set pins function. | |
err_t | brushless26_set_trap_com_state (brushless26_t *ctx, uint8_t state) |
Brushless 26 set trapezoidal com state function. | |
err_t | brushless26_toggle_pin (brushless26_t *ctx, uint8_t pin_mask, uint8_t speed) |
Brushless 26 toggle pin function. | |
err_t | brushless26_perform_com_seq (brushless26_t *ctx, uint8_t dir, uint8_t speed) |
Brushless 26 perform com sequence function. | |
err_t | brushless26_drive_motor (brushless26_t *ctx, uint8_t dir, uint8_t speed, uint32_t time_ms) |
Brushless 26 drive motor function. | |
API for configuring and manipulating Brushless 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 brushless26_cfg_setup | ( | brushless26_cfg_t * | cfg | ) |
Brushless 26 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See brushless26_cfg_t object definition for detailed explanation. |
err_t brushless26_default_cfg | ( | brushless26_t * | ctx | ) |
Brushless 26 default configuration function.
This function executes a default configuration of Brushless 26 click board.
[in] | ctx | : Click context object. See brushless26_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t brushless26_drive_motor | ( | brushless26_t * | ctx, |
uint8_t | dir, | ||
uint8_t | speed, | ||
uint32_t | time_ms ) |
Brushless 26 drive motor function.
This function drives the motor for a desired time by performing multiple commutation sequences for the selected rotation direction at a desired speed.
[in] | ctx | : Click context object. See brushless26_t object definition for detailed explanation. |
[in] | dir | : Rotation direction. |
[in] | speed | : Speed (0-100). |
[in] | time_ms | : Driving time in milliseconds. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t brushless26_generic_read | ( | brushless26_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Brushless 26 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See brushless26_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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t brushless26_generic_write | ( | brushless26_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Brushless 26 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See brushless26_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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t brushless26_get_flt_pin | ( | brushless26_t * | ctx | ) |
Brushless 26 get fault pin function.
This function returns the fault pin logic state.
[in] | ctx | : Click context object. See brushless26_t object definition for detailed explanation. |
err_t brushless26_init | ( | brushless26_t * | ctx, |
brushless26_cfg_t * | cfg ) |
Brushless 26 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See brushless26_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See brushless26_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t brushless26_perform_com_seq | ( | brushless26_t * | ctx, |
uint8_t | dir, | ||
uint8_t | speed ) |
Brushless 26 perform com sequence function.
This function performs a single commutation sequence for the selected rotation direction at a desired speed.
[in] | ctx | : Click context object. See brushless26_t object definition for detailed explanation. |
[in] | dir | : Rotation direction. |
[in] | speed | : Speed (0-100). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t brushless26_read_reg | ( | brushless26_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Brushless 26 read register function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See brushless26_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. void brushless26_reset_port_exp | ( | brushless26_t * | ctx | ) |
Brushless 26 reset port expander function.
This function resets the port expander by toggling the RST pin.
[in] | ctx | : Click context object. See brushless26_t object definition for detailed explanation. |
err_t brushless26_set_pins | ( | brushless26_t * | ctx, |
uint8_t | set_mask, | ||
uint8_t | clr_mask ) |
Brushless 26 set pins function.
This function sets and clears the value of the selected pins of PCA9538A port expander.
[in] | ctx | : Click context object. See brushless26_t object definition for detailed explanation. |
[in] | clr_mask | : Pin clear mask. |
[in] | set_mask | : Pin set mask. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void brushless26_set_rst_pin | ( | brushless26_t * | ctx, |
uint8_t | pin_state ) |
Brushless 26 set rst pin function.
This function sets the RST pin logic state.
[in] | ctx | : Click context object. See brushless26_t object definition for detailed explanation. |
[in] | state | : State of the RST pin. |
err_t brushless26_set_trap_com_state | ( | brushless26_t * | ctx, |
uint8_t | state ) |
Brushless 26 set trapezoidal com state function.
This function sets the pin state for the selected trapezoidal commutation state.
[in] | ctx | : Click context object. See brushless26_t object definition for detailed explanation. |
[in] | state | : Trapezoidal commutation state (0-7) - BRUSHLESS26_TR_COM_STATE_x macros. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t brushless26_toggle_pin | ( | brushless26_t * | ctx, |
uint8_t | pin_mask, | ||
uint8_t | speed ) |
Brushless 26 toggle pin function.
This function toggles the selected pin of port expander BRUSHLESS26_NUM_PIN_TOGGLE times with a delay of (speed + 1) * 100us between each toggle.
[in] | ctx | : Click context object. See brushless26_t object definition for detailed explanation. |
[in] | pin_mask | : Pin to toggle mask. |
[in] | speed | : Speed (0-100). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t brushless26_write_reg | ( | brushless26_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Brushless 26 write register function.
This function writes a desired data byte to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See brushless26_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.