proximity17
2.0.0.0
|
API for configuring and manipulating Proximity 17 Click driver. More...
Modules | |
Proximity 17 Registers List | |
List of registers of Proximity 17 Click driver. | |
Proximity 17 Registers Settings | |
Settings for registers of Proximity 17 Click driver. | |
Proximity 17 MikroBUS Map | |
MikroBUS pin mapping of Proximity 17 Click driver. | |
Functions | |
void | proximity17_cfg_setup (proximity17_cfg_t *cfg) |
Proximity 17 configuration object setup function. More... | |
err_t | proximity17_init (proximity17_t *ctx, proximity17_cfg_t *cfg) |
Proximity 17 initialization function. More... | |
err_t | proximity17_default_cfg (proximity17_t *ctx) |
Proximity 17 default configuration function. More... | |
err_t | proximity17_generic_write (proximity17_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
Proximity 17 I2C writing function. More... | |
err_t | proximity17_generic_read (proximity17_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
Proximity 17 I2C reading function. More... | |
err_t | proximity17_write_register (proximity17_t *ctx, uint8_t reg, uint8_t data_in) |
Proximity 17 write register function. More... | |
err_t | proximity17_read_register (proximity17_t *ctx, uint8_t reg, uint8_t *data_out) |
Proximity 17 read register function. More... | |
err_t | proximity17_check_communication (proximity17_t *ctx) |
Proximity 17 check communication function. More... | |
err_t | proximity17_soft_reset (proximity17_t *ctx) |
Proximity 17 soft reset function. More... | |
err_t | proximity17_read_proximity (proximity17_t *ctx, uint16_t *prox_data) |
Proximity 17 read proximity function. More... | |
uint8_t | proximity17_get_int_pin (proximity17_t *ctx) |
Proximity 17 get int pin function. More... | |
API for configuring and manipulating Proximity 17 Click driver.
void proximity17_cfg_setup | ( | proximity17_cfg_t * | cfg | ) |
Proximity 17 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See proximity17_cfg_t object definition for detailed explanation. |
err_t proximity17_check_communication | ( | proximity17_t * | ctx | ) |
Proximity 17 check communication function.
This function checks the communication by reading and verifying the device ID on up to 10 tries.
[in] | ctx | : Click context object. See proximity17_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity17_default_cfg | ( | proximity17_t * | ctx | ) |
Proximity 17 default configuration function.
This function executes a default configuration of Proximity 17 click board.
[in] | ctx | : Click context object. See proximity17_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity17_generic_read | ( | proximity17_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len | ||
) |
Proximity 17 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 proximity17_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. See #err_t definition for detailed explanation. err_t proximity17_generic_write | ( | proximity17_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len | ||
) |
Proximity 17 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 proximity17_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. See #err_t definition for detailed explanation. uint8_t proximity17_get_int_pin | ( | proximity17_t * | ctx | ) |
Proximity 17 get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See proximity17_t object definition for detailed explanation. |
err_t proximity17_init | ( | proximity17_t * | ctx, |
proximity17_cfg_t * | cfg | ||
) |
Proximity 17 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See proximity17_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See proximity17_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity17_read_proximity | ( | proximity17_t * | ctx, |
uint16_t * | prox_data | ||
) |
Proximity 17 read proximity function.
This function reads the raw proximity data. The higher the value, the closer the detected object is.
[in] | ctx | : Click context object. See proximity17_t object definition for detailed explanation. |
[out] | prox_data | : Proximity data 14-bit (10-bit in case APC is disabled). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity17_read_register | ( | proximity17_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out | ||
) |
Proximity 17 read register function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See proximity17_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 proximity17_soft_reset | ( | proximity17_t * | ctx | ) |
Proximity 17 soft reset function.
This function executes the defice software reset command.
[in] | ctx | : Click context object. See proximity17_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity17_write_register | ( | proximity17_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in | ||
) |
Proximity 17 write register function.
This function writes a desired data to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See proximity17_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.