proximity20
2.1.0.0
|
API for configuring and manipulating Proximity 20 Click driver. More...
Modules | |
Proximity 20 Registers List | |
List of registers of Proximity 20 Click driver. | |
Proximity 20 Registers Settings | |
Settings for registers of Proximity 20 Click driver. | |
Proximity 20 MikroBUS Map | |
MikroBUS pin mapping of Proximity 20 Click driver. | |
Functions | |
void | proximity20_cfg_setup (proximity20_cfg_t *cfg) |
Proximity 20 configuration object setup function. More... | |
err_t | proximity20_init (proximity20_t *ctx, proximity20_cfg_t *cfg) |
Proximity 20 initialization function. More... | |
err_t | proximity20_default_cfg (proximity20_t *ctx) |
Proximity 20 default configuration function. More... | |
err_t | proximity20_write_register (proximity20_t *ctx, uint8_t reg, uint16_t data_in) |
Proximity 20 write register function. More... | |
err_t | proximity20_read_register (proximity20_t *ctx, uint8_t reg, uint16_t *data_out) |
Proximity 20 read register function. More... | |
err_t | proximity20_set_device_address (proximity20_t *ctx, uint8_t dev_addr) |
Proximity 20 set device address function. More... | |
err_t | proximity20_check_communication (proximity20_t *ctx) |
Proximity 20 check communication function. More... | |
err_t | proximity20_read_proximity (proximity20_t *ctx, uint16_t *ps_data_u2, uint16_t *ps_data_u3) |
Proximity 20 read proximity function. More... | |
void | proximity20_enable_device (proximity20_t *ctx) |
Proximity 20 enable device function. More... | |
void | proximity20_disable_device (proximity20_t *ctx) |
Proximity 20 disable device function. More... | |
uint8_t | proximity20_get_int_pin (proximity20_t *ctx) |
Proximity 20 get int pin function. More... | |
API for configuring and manipulating Proximity 20 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void proximity20_cfg_setup | ( | proximity20_cfg_t * | cfg | ) |
Proximity 20 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See proximity20_cfg_t object definition for detailed explanation. |
err_t proximity20_check_communication | ( | proximity20_t * | ctx | ) |
Proximity 20 check communication function.
This function checks the communication by reading and verifying the device ID of U2 and U3 sensors.
[in] | ctx | : Click context object. See proximity20_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity20_default_cfg | ( | proximity20_t * | ctx | ) |
Proximity 20 default configuration function.
This function executes a default configuration of Proximity 20 click board.
[in] | ctx | : Click context object. See proximity20_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void proximity20_disable_device | ( | proximity20_t * | ctx | ) |
Proximity 20 disable device function.
This function disables the device by setting the EN pin to low logic state.
[in] | ctx | : Click context object. See proximity20_t object definition for detailed explanation. |
void proximity20_enable_device | ( | proximity20_t * | ctx | ) |
Proximity 20 enable device function.
This function enables the device by setting the EN pin to high logic state.
[in] | ctx | : Click context object. See proximity20_t object definition for detailed explanation. |
uint8_t proximity20_get_int_pin | ( | proximity20_t * | ctx | ) |
Proximity 20 get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See proximity20_t object definition for detailed explanation. |
err_t proximity20_init | ( | proximity20_t * | ctx, |
proximity20_cfg_t * | cfg | ||
) |
Proximity 20 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See proximity20_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See proximity20_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity20_read_proximity | ( | proximity20_t * | ctx, |
uint16_t * | ps_data_u2, | ||
uint16_t * | ps_data_u3 | ||
) |
Proximity 20 read proximity function.
This function reads the proximity data from U2 and U3 sensors.
[in] | ctx | : Click context object. See proximity20_t object definition for detailed explanation. |
[out] | ps_data_u2 | : PS data from U2 sensor. |
[out] | ps_data_u3 | : PS data from U3 sensor. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity20_read_register | ( | proximity20_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out | ||
) |
Proximity 20 read register function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See proximity20_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 proximity20_set_device_address | ( | proximity20_t * | ctx, |
uint8_t | dev_addr | ||
) |
Proximity 20 set device address function.
This function sets the device slave address.
[in] | ctx | : Click context object. See proximity20_t object definition for detailed explanation. |
[in] | dev_addr | : 0x51 - U2 sensor, 0x60 - U3 sensor. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity20_write_register | ( | proximity20_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in | ||
) |
Proximity 20 write register function.
This function writes a desired data to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See proximity20_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.