mlvibrosens
2.1.0.0
|
API for configuring and manipulating ML Vibro Sens Click driver. More...
Modules | |
ML Vibro Sens Registers List | |
List of registers of ML Vibro Sens Click driver. | |
ML Vibro Sens Registers Settings | |
Settings for registers of ML Vibro Sens Click driver. | |
ML Vibro Sens MikroBUS Map | |
MikroBUS pin mapping of ML Vibro Sens Click driver. | |
Functions | |
void | mlvibrosens_cfg_setup (mlvibrosens_cfg_t *cfg) |
ML Vibro Sens configuration object setup function. More... | |
err_t | mlvibrosens_init (mlvibrosens_t *ctx, mlvibrosens_cfg_t *cfg) |
ML Vibro Sens initialization function. More... | |
err_t | mlvibrosens_default_cfg (mlvibrosens_t *ctx) |
ML Vibro Sens default configuration function. More... | |
err_t | mlvibrosens_write_regs (mlvibrosens_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
ML Vibro Sens write regs function. More... | |
err_t | mlvibrosens_read_regs (mlvibrosens_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
ML Vibro Sens read regs function. More... | |
err_t | mlvibrosens_write_reg (mlvibrosens_t *ctx, uint8_t reg, uint8_t data_in) |
ML Vibro Sens write reg function. More... | |
err_t | mlvibrosens_read_reg (mlvibrosens_t *ctx, uint8_t reg, uint8_t *data_out) |
ML Vibro Sens read reg function. More... | |
void | mlvibrosens_balanced_enable (mlvibrosens_t *ctx) |
ML Vibro Sens balanced enable function. More... | |
void | mlvibrosens_balanced_disable (mlvibrosens_t *ctx) |
ML Vibro Sens balanced disable function. More... | |
void | mlvibrosens_unbalanced_enable (mlvibrosens_t *ctx) |
ML Vibro Sens unbalanced enable function. More... | |
void | mlvibrosens_unbalanced_disable (mlvibrosens_t *ctx) |
ML Vibro Sens unbalanced disable function. More... | |
uint8_t | mlvibrosens_get_int_pin (mlvibrosens_t *ctx) |
ML Vibro Sens get int1 pin function. More... | |
void | mlvibrosens_set_vibro_state (mlvibrosens_t *ctx, uint8_t state) |
ML Vibro Sens set vibro state function. More... | |
err_t | mlvibrosens_check_comm (mlvibrosens_t *ctx) |
ML Vibro Sens check comm function. More... | |
err_t | mlvibrosens_get_status (mlvibrosens_t *ctx, uint8_t *status) |
ML Vibro Sens get status function. More... | |
err_t | mlvibrosens_sw_reset (mlvibrosens_t *ctx) |
ML Vibro Sens sw reset function. More... | |
err_t | mlvibrosens_set_mode (mlvibrosens_t *ctx, uint8_t mode) |
ML Vibro Sens set mode function. More... | |
err_t | mlvibrosens_set_fsr (mlvibrosens_t *ctx, uint8_t fsr) |
ML Vibro Sens set fsr function. More... | |
err_t | mlvibrosens_set_odr (mlvibrosens_t *ctx, uint8_t odr) |
ML Vibro Sens set odr function. More... | |
err_t | mlvibrosens_get_data (mlvibrosens_t *ctx, mlvibrosens_data_t *data_out) |
ML Vibro Sens get data function. More... | |
API for configuring and manipulating ML Vibro Sens Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void mlvibrosens_balanced_disable | ( | mlvibrosens_t * | ctx | ) |
ML Vibro Sens balanced disable function.
This function disables balanced vibro motor by setting the BAL pin to low logic state.
[in] | ctx | : Click context object. See mlvibrosens_t object definition for detailed explanation. |
void mlvibrosens_balanced_enable | ( | mlvibrosens_t * | ctx | ) |
ML Vibro Sens balanced enable function.
This function enables balanced vibro motor by setting the BAL pin to high logic state.
[in] | ctx | : Click context object. See mlvibrosens_t object definition for detailed explanation. |
void mlvibrosens_cfg_setup | ( | mlvibrosens_cfg_t * | cfg | ) |
ML Vibro Sens configuration object setup function.
This function initializes Click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See mlvibrosens_cfg_t object definition for detailed explanation. |
err_t mlvibrosens_check_comm | ( | mlvibrosens_t * | ctx | ) |
ML Vibro Sens check comm function.
This function checks the communication by reading and verifying the device ID.
[in] | ctx | : Click context object. See mlvibrosens_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mlvibrosens_default_cfg | ( | mlvibrosens_t * | ctx | ) |
ML Vibro Sens default configuration function.
This function executes a default configuration of ML Vibro Sens Click board.
[in] | ctx | : Click context object. See mlvibrosens_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mlvibrosens_get_data | ( | mlvibrosens_t * | ctx, |
mlvibrosens_data_t * | data_out | ||
) |
ML Vibro Sens get data function.
This function reads accel X, Y, and Z axis data in g and temperature in degrees Celsius.
[in] | ctx | : Click context object. See mlvibrosens_t object definition for detailed explanation. |
[out] | data_out | : X, Y, and Z axis data in g, and temperature in degrees Celsius. See mlvibrosens_data_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t mlvibrosens_get_int_pin | ( | mlvibrosens_t * | ctx | ) |
ML Vibro Sens get int1 pin function.
This function returns the interrupt pin logic state.
[in] | ctx | : Click context object. See mlvibrosens_t object definition for detailed explanation. |
err_t mlvibrosens_get_status | ( | mlvibrosens_t * | ctx, |
uint8_t * | status | ||
) |
ML Vibro Sens get status function.
This function reads the interrupt status register.
[in] | ctx | : Click context object. See mlvibrosens_t object definition for detailed explanation. |
[out] | status | : Interrupt status read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mlvibrosens_init | ( | mlvibrosens_t * | ctx, |
mlvibrosens_cfg_t * | cfg | ||
) |
ML Vibro Sens initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
[out] | ctx | : Click context object. See mlvibrosens_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See mlvibrosens_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mlvibrosens_read_reg | ( | mlvibrosens_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out | ||
) |
ML Vibro Sens read reg function.
This function reads a data byte from the selected register.
[in] | ctx | : Click context object. See mlvibrosens_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 mlvibrosens_read_regs | ( | mlvibrosens_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
ML Vibro Sens read regs function.
This function reads a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See mlvibrosens_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 mlvibrosens_set_fsr | ( | mlvibrosens_t * | ctx, |
uint8_t | fsr | ||
) |
ML Vibro Sens set fsr function.
This function sets the accel measurement full scale range.
[in] | ctx | : Click context object. See mlvibrosens_t object definition for detailed explanation. |
[in] | fsr | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mlvibrosens_set_mode | ( | mlvibrosens_t * | ctx, |
uint8_t | mode | ||
) |
ML Vibro Sens set mode function.
This function sets the device operating mode to standby or active.
[in] | ctx | : Click context object. See mlvibrosens_t object definition for detailed explanation. |
[in] | mode | : Operating mode:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mlvibrosens_set_odr | ( | mlvibrosens_t * | ctx, |
uint8_t | odr | ||
) |
ML Vibro Sens set odr function.
This function sets the measurement output data rate.
[in] | ctx | : Click context object. See mlvibrosens_t object definition for detailed explanation. |
[in] | odr | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void mlvibrosens_set_vibro_state | ( | mlvibrosens_t * | ctx, |
uint8_t | state | ||
) |
ML Vibro Sens set vibro state function.
This function sets the vibro motors state.
[in] | ctx | : Click context object. See mlvibrosens_t object definition for detailed explanation. |
[in] | state | :
|
err_t mlvibrosens_sw_reset | ( | mlvibrosens_t * | ctx | ) |
ML Vibro Sens sw reset function.
This function performs the device software reset.
[in] | ctx | : Click context object. See mlvibrosens_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void mlvibrosens_unbalanced_disable | ( | mlvibrosens_t * | ctx | ) |
ML Vibro Sens unbalanced disable function.
This function disables unbalanced vibro motor by setting the UNB pin to low logic state.
[in] | ctx | : Click context object. See mlvibrosens_t object definition for detailed explanation. |
void mlvibrosens_unbalanced_enable | ( | mlvibrosens_t * | ctx | ) |
ML Vibro Sens unbalanced enable function.
This function enables unbalanced vibro motor by setting the UNB pin to high logic state.
[in] | ctx | : Click context object. See mlvibrosens_t object definition for detailed explanation. |
err_t mlvibrosens_write_reg | ( | mlvibrosens_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in | ||
) |
ML Vibro Sens write reg function.
This function write a data byte to the selected register.
[in] | ctx | : Click context object. See mlvibrosens_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 mlvibrosens_write_regs | ( | mlvibrosens_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
ML Vibro Sens write regs function.
This function writes a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See mlvibrosens_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.