brushless27 2.1.0.0
|
API for configuring and manipulating Brushless 27 Click driver. More...
Modules | |
Brushless 27 Registers List | |
List of registers of Brushless 27 Click driver. | |
Brushless 27 Registers Settings | |
Settings for registers of Brushless 27 Click driver. | |
Brushless 27 MikroBUS Map | |
MikroBUS pin mapping of Brushless 27 Click driver. | |
Functions | |
void | brushless27_cfg_setup (brushless27_cfg_t *cfg) |
Brushless 27 configuration object setup function. More... | |
err_t | brushless27_init (brushless27_t *ctx, brushless27_cfg_t *cfg) |
Brushless 27 initialization function. More... | |
err_t | brushless27_default_cfg (brushless27_t *ctx) |
Brushless 27 default configuration function. More... | |
err_t | brushless27_generic_write (brushless27_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Brushless 27 I2C writing function. More... | |
err_t | brushless27_generic_read (brushless27_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Brushless 27 I2C reading function. More... | |
uint8_t | brushless27_get_sen_pin (brushless27_t *ctx) |
Brushless 27 get Sense pin function. More... | |
uint8_t | brushless27_get_int_pin (brushless27_t *ctx) |
Brushless 27 get Interrupt pin function. More... | |
void | brushless27_reset_port_exp (brushless27_t *ctx) |
Brushless 27 reset port expander function. More... | |
err_t | brushless27_get_flt_pin (brushless27_t *ctx) |
Brushless 27 get Fault pin function. More... | |
err_t | brushless27_write_reg (brushless27_t *ctx, uint8_t reg, uint8_t data_in) |
Brushless 27 write register function. More... | |
err_t | brushless27_read_reg (brushless27_t *ctx, uint8_t reg, uint8_t *data_out) |
Brushless 27 read register function. More... | |
err_t | brushless27_set_pins (brushless27_t *ctx, uint8_t set_mask, uint8_t clr_mask) |
Brushless 27 set pins function. More... | |
err_t | brushless27_set_trap_com_state (brushless27_t *ctx, uint8_t state) |
Brushless 27 set trapezoidal com state function. More... | |
err_t | brushless27_toggle_pin (brushless27_t *ctx, uint8_t pin_mask, uint8_t speed) |
Brushless 27 toggle pin function. More... | |
err_t | brushless27_perform_com_seq (brushless27_t *ctx, uint8_t dir, uint8_t speed) |
Brushless 27 perform com sequence function. More... | |
err_t | brushless27_drive_motor (brushless27_t *ctx, uint8_t dir, uint8_t speed, uint32_t time_ms) |
Brushless 27 drive motor function. More... | |
API for configuring and manipulating Brushless 27 Click driver.
void brushless27_cfg_setup | ( | brushless27_cfg_t * | cfg | ) |
Brushless 27 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See brushless27_cfg_t object definition for detailed explanation. |
err_t brushless27_default_cfg | ( | brushless27_t * | ctx | ) |
Brushless 27 default configuration function.
This function executes a default configuration of Brushless 27 click board.
[in] | ctx | : Click context object. See brushless27_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t brushless27_drive_motor | ( | brushless27_t * | ctx, |
uint8_t | dir, | ||
uint8_t | speed, | ||
uint32_t | time_ms | ||
) |
Brushless 27 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 brushless27_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 brushless27_generic_read | ( | brushless27_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
Brushless 27 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 brushless27_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 brushless27_generic_write | ( | brushless27_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
Brushless 27 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 brushless27_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. err_t brushless27_get_flt_pin | ( | brushless27_t * | ctx | ) |
Brushless 27 get Fault pin function.
This function returns the Fault pin logic state.
[in] | ctx | : Click context object. See brushless27_t object definition for detailed explanation. |
0
- Success, -1
- Error / Fault pin active. See #err_t definition for detailed explanation. uint8_t brushless27_get_int_pin | ( | brushless27_t * | ctx | ) |
Brushless 27 get Interrupt pin function.
This function is used to get Interrupt pin state.
[in] | ctx | : Click context object. See brushless27_t object definition for detailed explanation. |
0
- Pin state low, 1
- Pin state high. uint8_t brushless27_get_sen_pin | ( | brushless27_t * | ctx | ) |
Brushless 27 get Sense pin function.
This function is used to get Sense pin state.
[in] | ctx | : Click context object. See brushless27_t object definition for detailed explanation. |
0
- Pin state low, 1
- Pin state high. err_t brushless27_init | ( | brushless27_t * | ctx, |
brushless27_cfg_t * | cfg | ||
) |
Brushless 27 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See brushless27_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See brushless27_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t brushless27_perform_com_seq | ( | brushless27_t * | ctx, |
uint8_t | dir, | ||
uint8_t | speed | ||
) |
Brushless 27 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 brushless27_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 brushless27_read_reg | ( | brushless27_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out | ||
) |
Brushless 27 read register function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See brushless27_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 brushless27_reset_port_exp | ( | brushless27_t * | ctx | ) |
Brushless 27 reset port expander function.
This function resets the port expander by toggling the RST pin.
[in] | ctx | : Click context object. See brushless27_t object definition for detailed explanation. |
err_t brushless27_set_pins | ( | brushless27_t * | ctx, |
uint8_t | set_mask, | ||
uint8_t | clr_mask | ||
) |
Brushless 27 set pins function.
This function sets and clears the value of the selected pins of PCA9538A port expander.
[in] | ctx | : Click context object. See brushless27_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. err_t brushless27_set_trap_com_state | ( | brushless27_t * | ctx, |
uint8_t | state | ||
) |
Brushless 27 set trapezoidal com state function.
This function sets the pin state for the selected trapezoidal commutation state.
[in] | ctx | : Click context object. See brushless27_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 brushless27_toggle_pin | ( | brushless27_t * | ctx, |
uint8_t | pin_mask, | ||
uint8_t | speed | ||
) |
Brushless 27 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 brushless27_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 brushless27_write_reg | ( | brushless27_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in | ||
) |
Brushless 27 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 brushless27_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.