proximity15 2.0.0.0
|
API for configuring and manipulating Proximity 15 Click driver. More...
Topics | |
Proximity 15 Registers List | |
List of registers of Proximity 15 Click driver. | |
Proximity 15 Registers Settings | |
Settings for registers of Proximity 15 Click driver. | |
Proximity 15 MikroBUS Map | |
MikroBUS pin mapping of Proximity 15 Click driver. | |
Functions | |
void | proximity15_cfg_setup (proximity15_cfg_t *cfg) |
Proximity 15 configuration object setup function. | |
err_t | proximity15_init (proximity15_t *ctx, proximity15_cfg_t *cfg) |
Proximity 15 initialization function. | |
err_t | proximity15_default_cfg (proximity15_t *ctx) |
Proximity 15 default configuration function. | |
err_t | proximity15_write_registers (proximity15_t *ctx, uint16_t reg, uint8_t *tx_buf, uint8_t tx_len) |
Proximity 15 write registers function. | |
err_t | proximity15_read_registers (proximity15_t *ctx, uint16_t reg, uint8_t *rx_buf, uint8_t rx_len) |
Proximity 15 read registers function. | |
err_t | proximity15_write_register (proximity15_t *ctx, uint16_t reg, uint8_t tx_data) |
Proximity 15 write register function. | |
err_t | proximity15_read_register (proximity15_t *ctx, uint16_t reg, uint8_t *rx_data) |
Proximity 15 read register function. | |
err_t | proximity15_check_communication (proximity15_t *ctx) |
Proximity 15 check communication function. | |
err_t | proximity15_software_reset (proximity15_t *ctx) |
Proximity 15 software reset function. | |
err_t | proximity15_get_distance (proximity15_t *ctx, uint16_t *distance) |
Proximity 15 get distance function. | |
void | proximity15_enable_sensor (proximity15_t *ctx) |
Proximity 15 enable sensor function. | |
void | proximity15_disable_sensor (proximity15_t *ctx) |
Proximity 15 disable sensor function. | |
uint8_t | proximity15_get_int_pin (proximity15_t *ctx) |
Proximity 15 get int pin function. | |
err_t | proximity15_start_ranging (proximity15_t *ctx) |
Proximity 15 start ranging function. | |
err_t | proximity15_stop_ranging (proximity15_t *ctx) |
Proximity 15 stop ranging function. | |
err_t | proximity15_clear_interrupt (proximity15_t *ctx) |
Proximity 15 clear interrupt function. | |
err_t | proximity15_set_inter_measurement_period (proximity15_t *ctx, uint16_t time_ms) |
Proximity 15 set inter measurement period function. | |
err_t | proximity15_set_distance_mode (proximity15_t *ctx, uint8_t mode) |
Proximity 15 set distance mode function. | |
err_t | proximity15_get_distance_mode (proximity15_t *ctx, uint8_t *mode) |
Proximity 15 get distance mode function. | |
err_t | proximity15_set_timing_budget (proximity15_t *ctx, proximity15_timing_budget_t time) |
Proximity 15 set timing budget function. | |
err_t | proximity15_get_timing_budget (proximity15_t *ctx, proximity15_timing_budget_t *time) |
Proximity 15 get timing budget function. | |
API for configuring and manipulating Proximity 15 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void proximity15_cfg_setup | ( | proximity15_cfg_t * | cfg | ) |
Proximity 15 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See proximity15_cfg_t object definition for detailed explanation. |
err_t proximity15_check_communication | ( | proximity15_t * | ctx | ) |
Proximity 15 check communication function.
This function checks the communication by reading and verifying the model ID and module type registers.
[in] | ctx | : Click context object. See proximity15_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t proximity15_clear_interrupt | ( | proximity15_t * | ctx | ) |
Proximity 15 clear interrupt function.
This function clears the interrupt.
[in] | ctx | : Click context object. See proximity15_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t proximity15_default_cfg | ( | proximity15_t * | ctx | ) |
Proximity 15 default configuration function.
This function executes a default configuration of Proximity 15 click board.
[in] | ctx | : Click context object. See proximity15_t object definition for detailed explanation. |
0
- Success, -1
- Error.void proximity15_disable_sensor | ( | proximity15_t * | ctx | ) |
Proximity 15 disable sensor function.
This function disables the sensor by setting XSH pin to LOW logic level.
[in] | ctx | : Click context object. See proximity15_t object definition for detailed explanation. |
void proximity15_enable_sensor | ( | proximity15_t * | ctx | ) |
Proximity 15 enable sensor function.
This function enables the sensor by setting XSH pin to HIGH logic level.
[in] | ctx | : Click context object. See proximity15_t object definition for detailed explanation. |
err_t proximity15_get_distance | ( | proximity15_t * | ctx, |
uint16_t * | distance ) |
Proximity 15 get distance function.
This function waits for the data ready, then reads the distance measured by the sensor in milimeters and clears interrupts.
[in] | ctx | : Click context object. See proximity15_t object definition for detailed explanation. |
[out] | distance | : Object distance in milimeters. |
0
- Success, -1
- Error.err_t proximity15_get_distance_mode | ( | proximity15_t * | ctx, |
uint8_t * | mode ) |
Proximity 15 get distance mode function.
This function returns the current distance mode.
[in] | ctx | : Click context object. See proximity15_t object definition for detailed explanation. |
[out] | mode | :
|
0
- Success, -1
- Error.uint8_t proximity15_get_int_pin | ( | proximity15_t * | ctx | ) |
Proximity 15 get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See proximity15_t object definition for detailed explanation. |
err_t proximity15_get_timing_budget | ( | proximity15_t * | ctx, |
proximity15_timing_budget_t * | time ) |
Proximity 15 get timing budget function.
This function returns the current timing budget in miliseconds.
[in] | ctx | : Click context object. See proximity15_t object definition for detailed explanation. |
[out] | time | : Time value (enum 0-6). See proximity15_timing_budget_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t proximity15_init | ( | proximity15_t * | ctx, |
proximity15_cfg_t * | cfg ) |
Proximity 15 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See proximity15_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See proximity15_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t proximity15_read_register | ( | proximity15_t * | ctx, |
uint16_t | reg, | ||
uint8_t * | rx_data ) |
Proximity 15 read register function.
This function reads a data byte from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See proximity15_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_data | : Output read data. |
0
- Success, -1
- Error.err_t proximity15_read_registers | ( | proximity15_t * | ctx, |
uint16_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
Proximity 15 read registers 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 proximity15_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t proximity15_set_distance_mode | ( | proximity15_t * | ctx, |
uint8_t | mode ) |
Proximity 15 set distance mode function.
This function programs the distance mode.
[in] | ctx | : Click context object. See proximity15_t object definition for detailed explanation. |
[in] | mode | :
|
0
- Success, -1
- Error.err_t proximity15_set_inter_measurement_period | ( | proximity15_t * | ctx, |
uint16_t | time_ms ) |
Proximity 15 set inter measurement period function.
This function programs the inter measurement period in miliseconds.
[in] | ctx | : Click context object. See proximity15_t object definition for detailed explanation. |
[in] | time_ms | : Inter measurement period in miliseconds ( Default: 100ms ). |
0
- Success, -1
- Error.err_t proximity15_set_timing_budget | ( | proximity15_t * | ctx, |
proximity15_timing_budget_t | time ) |
Proximity 15 set timing budget function.
This function programs the timing budget in miliseconds.
[in] | ctx | : Click context object. See proximity15_t object definition for detailed explanation. |
[in] | time | : Time value (enum 0-6). See proximity15_timing_budget_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t proximity15_software_reset | ( | proximity15_t * | ctx | ) |
Proximity 15 software reset function.
This function performs the device software reset.
[in] | ctx | : Click context object. See proximity15_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t proximity15_start_ranging | ( | proximity15_t * | ctx | ) |
Proximity 15 start ranging function.
This function starts the ranging distance operation.
[in] | ctx | : Click context object. See proximity15_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t proximity15_stop_ranging | ( | proximity15_t * | ctx | ) |
Proximity 15 stop ranging function.
This function stops the ranging distance operation.
[in] | ctx | : Click context object. See proximity15_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t proximity15_write_register | ( | proximity15_t * | ctx, |
uint16_t | reg, | ||
uint8_t | tx_data ) |
Proximity 15 write register function.
This function writes a data byte to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See proximity15_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_data | : Data to be written. |
0
- Success, -1
- Error.err_t proximity15_write_registers | ( | proximity15_t * | ctx, |
uint16_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
Proximity 15 write registers 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 proximity15_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error.