|
proximity22 2.2.0
|
API for configuring and manipulating Proximity 22 Click driver. More...
Topics | |
| Proximity 22 Registers List | |
| List of registers of Proximity 22 Click driver. | |
| Proximity 22 Registers Settings | |
| Settings for registers of Proximity 22 Click driver. | |
| Proximity 22 MikroBUS Map | |
| MikroBUS pin mapping of Proximity 22 Click driver. | |
Functions | |
| void | proximity22_cfg_setup (proximity22_cfg_t *cfg) |
| Proximity 22 configuration object setup function. | |
| err_t | proximity22_init (proximity22_t *ctx, proximity22_cfg_t *cfg) |
| Proximity 22 initialization function. | |
| err_t | proximity22_default_cfg (proximity22_t *ctx) |
| Proximity 22 default configuration function. | |
| err_t | proximity22_write_regs (proximity22_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
| Proximity 22 write registers function. | |
| err_t | proximity22_read_regs (proximity22_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
| Proximity 22 read registers function. | |
| err_t | proximity22_write_reg (proximity22_t *ctx, uint8_t reg, uint8_t data_in) |
| Proximity 22 write register function. | |
| err_t | proximity22_read_reg (proximity22_t *ctx, uint8_t reg, uint8_t *data_out) |
| Proximity 22 read register function. | |
| void | proximity22_set_rst_pin (proximity22_t *ctx, uint8_t state) |
| Proximity 22 set RST pin function. | |
| uint8_t | proximity22_get_int_pin (proximity22_t *ctx) |
| Proximity 22 get INT pin function. | |
| void | proximity22_reset_device (proximity22_t *ctx) |
| Proximity 22 reset device function. | |
| err_t | proximity22_check_comm (proximity22_t *ctx) |
| Proximity 22 check communication function. | |
| err_t | proximity22_soft_reset (proximity22_t *ctx) |
| Proximity 22 software reset function. | |
| err_t | proximity22_clear_fifo (proximity22_t *ctx) |
| Proximity 22 clear FIFO function. | |
| err_t | proximity22_read_prox (proximity22_t *ctx, uint16_t *prox) |
| Proximity 22 read proximity function. | |
| err_t | proximity22_read_temp (proximity22_t *ctx, float *temp) |
| Proximity 22 read temperature function. | |
| err_t | proximity22_read_als (proximity22_t *ctx, proximity22_als_t *als) |
| Proximity 22 read ALS data function. | |
| err_t | proximity22_read_data (proximity22_t *ctx, proximity22_data_t *data_out) |
| Proximity 22 read sensor data function. | |
API for configuring and manipulating Proximity 22 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void proximity22_cfg_setup | ( | proximity22_cfg_t * | cfg | ) |
Proximity 22 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See proximity22_cfg_t object definition for detailed explanation. |
| err_t proximity22_check_comm | ( | proximity22_t * | ctx | ) |
Proximity 22 check communication function.
This function checks device ID to verify communication.
| [in] | ctx | : Click context object. See proximity22_t object definition for detailed explanation. |
0 - Success (correct device ID), -1 - Error. | err_t proximity22_clear_fifo | ( | proximity22_t * | ctx | ) |
Proximity 22 clear FIFO function.
This function clears the FIFO buffer.
| [in] | ctx | : Click context object. See proximity22_t object definition for detailed explanation. |
0 - Success, -1 - Error. | err_t proximity22_default_cfg | ( | proximity22_t * | ctx | ) |
Proximity 22 default configuration function.
This function executes a default configuration of Proximity 22 Click board.
| [in] | ctx | : Click context object. See proximity22_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | uint8_t proximity22_get_int_pin | ( | proximity22_t * | ctx | ) |
Proximity 22 get INT pin function.
This function returns the logic state of the INT pin.
| [in] | ctx | : Click context object. See proximity22_t object definition for detailed explanation. |
| err_t proximity22_init | ( | proximity22_t * | ctx, |
| proximity22_cfg_t * | cfg ) |
Proximity 22 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See proximity22_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See proximity22_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t proximity22_read_als | ( | proximity22_t * | ctx, |
| proximity22_als_t * | als ) |
Proximity 22 read ALS data function.
This function reads ambient light sensor (ALS) data from FIFO.
| [in] | ctx | : Click context object. See proximity22_t object definition for detailed explanation. |
| [out] | als | : Pointer to proximity22_als_t structure for storing ALS data. |
0 - Success, -1 - Error. | err_t proximity22_read_data | ( | proximity22_t * | ctx, |
| proximity22_data_t * | data_out ) |
Proximity 22 read sensor data function.
This function reads proximity, temperature, and ALS data if available.
| [in] | ctx | : Click context object. See proximity22_t object definition for detailed explanation. |
| [out] | data_out | : Pointer to proximity22_data_t structure to store sensor data. |
0 - Success, -1 - Error. | err_t proximity22_read_prox | ( | proximity22_t * | ctx, |
| uint16_t * | prox ) |
Proximity 22 read proximity function.
This function reads proximity measurement data.
| [in] | ctx | : Click context object. See proximity22_t object definition for detailed explanation. |
| [out] | prox | : Pointer to memory where proximity data will be stored. |
0 - Success, -1 - Error. | err_t proximity22_read_reg | ( | proximity22_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out ) |
Proximity 22 read register function.
This function reads a single byte from the selected register.
| [in] | ctx | : Click context object. See proximity22_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [out] | data_out | : Pointer to memory where read data will be stored. |
0 - Success, -1 - Error. | err_t proximity22_read_regs | ( | proximity22_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out, | ||
| uint8_t | len ) |
Proximity 22 read registers function.
This function reads a sequence of bytes starting from the selected register.
| [in] | ctx | : Click context object. See proximity22_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [out] | data_out | : Pointer to the memory where read data will be stored. |
| [in] | len | : Number of bytes to read. |
0 - Success, -1 - Error. | err_t proximity22_read_temp | ( | proximity22_t * | ctx, |
| float * | temp ) |
Proximity 22 read temperature function.
This function reads and converts internal temperature data.
| [in] | ctx | : Click context object. See proximity22_t object definition for detailed explanation. |
| [out] | temp | : Pointer to memory where temperature value (degC) will be stored. |
0 - Success, -1 - Error. | void proximity22_reset_device | ( | proximity22_t * | ctx | ) |
Proximity 22 reset device function.
This function performs a hardware reset by toggling the RST pin.
| [in] | ctx | : Click context object. See proximity22_t object definition for detailed explanation. |
| void proximity22_set_rst_pin | ( | proximity22_t * | ctx, |
| uint8_t | state ) |
Proximity 22 set RST pin function.
This function sets the logic state of the RST pin.
| [in] | ctx | : Click context object. See proximity22_t object definition for detailed explanation. |
| [in] | state | : Logic state (0 or 1). |
| err_t proximity22_soft_reset | ( | proximity22_t * | ctx | ) |
Proximity 22 software reset function.
This function performs a software reset by writing to the RESET register.
| [in] | ctx | : Click context object. See proximity22_t object definition for detailed explanation. |
0 - Success, -1 - Error. | err_t proximity22_write_reg | ( | proximity22_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t | data_in ) |
Proximity 22 write register function.
This function writes a single byte to the selected register.
| [in] | ctx | : Click context object. See proximity22_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [in] | data_in | : Data byte to write. |
0 - Success, -1 - Error. | err_t proximity22_write_regs | ( | proximity22_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_in, | ||
| uint8_t | len ) |
Proximity 22 write registers function.
This function writes a sequence of bytes starting from the selected register.
| [in] | ctx | : Click context object. See proximity22_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [in] | data_in | : Pointer to the data to be written. |
| [in] | len | : Number of bytes to write. |
0 - Success, -1 - Error.