proximity18 2.1.0.0
|
API for configuring and manipulating Proximity 18 Click driver. More...
Topics | |
Proximity 18 Registers List | |
List of registers of Proximity 18 Click driver. | |
Proximity 18 Registers Settings | |
Settings for registers of Proximity 18 Click driver. | |
Proximity 18 MikroBUS Map | |
MikroBUS pin mapping of Proximity 18 Click driver. | |
Functions | |
void | proximity18_cfg_setup (proximity18_cfg_t *cfg) |
Proximity 18 configuration object setup function. | |
err_t | proximity18_init (proximity18_t *ctx, proximity18_cfg_t *cfg) |
Proximity 18 initialization function. | |
err_t | proximity18_default_cfg (proximity18_t *ctx) |
Proximity 18 default configuration function. | |
err_t | proximity18_write_register (proximity18_t *ctx, uint8_t reg, uint16_t data_in) |
Proximity 18 write register function. | |
err_t | proximity18_read_register (proximity18_t *ctx, uint8_t reg, uint16_t *data_out) |
Proximity 18 read register function. | |
err_t | proximity18_check_communication (proximity18_t *ctx) |
Proximity 18 check communication function. | |
uint8_t | proximity18_get_int_pin (proximity18_t *ctx) |
Proximity 18 get int pin function. | |
err_t | proximity18_start_measurement (proximity18_t *ctx) |
Proximity 18 start measurement function. | |
err_t | proximity18_wait_for_data_ready (proximity18_t *ctx) |
Proximity 18 wait for data ready function. | |
err_t | proximity18_read_proximity (proximity18_t *ctx, uint16_t *ps1_data, uint16_t *ps2_data, uint16_t *ps3_data) |
Proximity 18 read proximity function. | |
API for configuring and manipulating Proximity 18 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void proximity18_cfg_setup | ( | proximity18_cfg_t * | cfg | ) |
Proximity 18 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See proximity18_cfg_t object definition for detailed explanation. |
err_t proximity18_check_communication | ( | proximity18_t * | ctx | ) |
Proximity 18 check communication function.
This function checks the communication by reading and verifying the device ID.
[in] | ctx | : Click context object. See proximity18_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity18_default_cfg | ( | proximity18_t * | ctx | ) |
Proximity 18 default configuration function.
This function executes a default configuration of Proximity 18 click board.
[in] | ctx | : Click context object. See proximity18_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t proximity18_get_int_pin | ( | proximity18_t * | ctx | ) |
Proximity 18 get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See proximity18_t object definition for detailed explanation. |
err_t proximity18_init | ( | proximity18_t * | ctx, |
proximity18_cfg_t * | cfg ) |
Proximity 18 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See proximity18_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See proximity18_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity18_read_proximity | ( | proximity18_t * | ctx, |
uint16_t * | ps1_data, | ||
uint16_t * | ps2_data, | ||
uint16_t * | ps3_data ) |
Proximity 18 read proximity function.
This function reads the proximity data from all 3 sensors.
[in] | ctx | : Click context object. See proximity18_t object definition for detailed explanation. |
[out] | ps1_data | : PS1 data from IRED1 sensor. |
[out] | ps2_data | : PS2 data from IRED2 sensor. |
[out] | ps3_data | : PS3 data from IRED3 sensor. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity18_read_register | ( | proximity18_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out ) |
Proximity 18 read register function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See proximity18_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity18_start_measurement | ( | proximity18_t * | ctx | ) |
Proximity 18 start measurement function.
This function starts the measurement by setting the one time trigger bit in the PS_CONF3_MS register.
[in] | ctx | : Click context object. See proximity18_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity18_wait_for_data_ready | ( | proximity18_t * | ctx | ) |
Proximity 18 wait for data ready function.
This function waits for the MPX data ready interrupt flag.
[in] | ctx | : Click context object. See proximity18_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity18_write_register | ( | proximity18_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in ) |
Proximity 18 write register function.
This function writes a desired data to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See proximity18_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.