proximity19
2.1.0.0
|
API for configuring and manipulating Proximity 19 Click driver. More...
Modules | |
Proximity 19 Registers List | |
List of registers of Proximity 19 Click driver. | |
Proximity 19 Registers Settings | |
Settings for registers of Proximity 19 Click driver. | |
Proximity 19 MikroBUS Map | |
MikroBUS pin mapping of Proximity 19 Click driver. | |
Functions | |
void | proximity19_cfg_setup (proximity19_cfg_t *cfg) |
Proximity 19 configuration object setup function. More... | |
err_t | proximity19_init (proximity19_t *ctx, proximity19_cfg_t *cfg) |
Proximity 19 initialization function. More... | |
err_t | proximity19_default_cfg (proximity19_t *ctx) |
Proximity 19 default configuration function. More... | |
err_t | proximity19_generic_write (proximity19_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Proximity 19 I2C writing function. More... | |
err_t | proximity19_generic_read (proximity19_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Proximity 19 I2C reading function. More... | |
err_t | proximity19_sw_reset (proximity19_t *ctx) |
Proximity 19 software reset function. More... | |
err_t | proximity19_get_part_id (proximity19_t *ctx, uint8_t *part_id) |
Proximity 19 get part ID function. More... | |
err_t | proximity19_set_ps_gain (proximity19_t *ctx, uint8_t ps_gain) |
Proximity 19 set PS gain function. More... | |
err_t | proximity19_set_pd_sel (proximity19_t *ctx, uint8_t pd_sel) |
Proximity 19 set PD photodiode function. More... | |
err_t | proximity19_set_period (proximity19_t *ctx, uint8_t period) |
Proximity 19 set period function. More... | |
err_t | proximity19_set_pulse_width (proximity19_t *ctx, uint8_t pulse_width) |
Proximity 19 set pulse width function. More... | |
err_t | proximity19_set_vcsel_current (proximity19_t *ctx, uint8_t vcsel_current) |
Proximity 19 set VCSEL current function. More... | |
err_t | proximity19_ps_enable (proximity19_t *ctx) |
Proximity 19 PS enable function. More... | |
err_t | proximity19_ps_disable (proximity19_t *ctx) |
Proximity 19 PS standby function. More... | |
err_t | proximity19_get_ps_data (proximity19_t *ctx, uint16_t *ps_data) |
Proximity 19 get PS data function. More... | |
err_t | proximity19_get_distance (proximity19_t *ctx, float *distance) |
Proximity 19 get distance function. More... | |
err_t | proximity19_set_ps_offset (proximity19_t *ctx, uint16_t ps_offset) |
Proximity 19 set PS offset function. More... | |
err_t | proximity19_int_cfg (proximity19_t *ctx, uint8_t int_cfg) |
Proximity 19 interrupt configuration function. More... | |
err_t | proximity19_set_ps_th (proximity19_t *ctx, uint16_t ps_th_high, uint16_t ps_th_low) |
Proximity 19 set PS threshold function. More... | |
err_t | proximity19_get_manufact_id (proximity19_t *ctx, uint8_t *manufact_id) |
Proximity 19 get manufacture ID function. More... | |
uint8_t | proximity19_get_int_pin (proximity19_t *ctx) |
Proximity 19 get interrupt function. More... | |
API for configuring and manipulating Proximity 19 Click driver.
void proximity19_cfg_setup | ( | proximity19_cfg_t * | cfg | ) |
Proximity 19 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See proximity19_cfg_t object definition for detailed explanation. |
err_t proximity19_default_cfg | ( | proximity19_t * | ctx | ) |
Proximity 19 default configuration function.
This function executes a default configuration of Proximity 19 click board.
[in] | ctx | : Click context object. See proximity19_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity19_generic_read | ( | proximity19_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
Proximity 19 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using the I2C serial interface.
[in] | ctx | : Click context object. See proximity19_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity19_generic_write | ( | proximity19_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
Proximity 19 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using the I2C serial interface.
[in] | ctx | : Click context object. See proximity19_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity19_get_distance | ( | proximity19_t * | ctx, |
float * | distance | ||
) |
Proximity 19 get distance function.
This function reads the distance measured by the sensor in millimeters by using the I2C serial interface.
[in] | ctx | : Click context object. See proximity19_t object definition for detailed explanation. |
[out] | proximity | : Object distance in millimeters [1mm-15mm]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t proximity19_get_int_pin | ( | proximity19_t * | ctx | ) |
Proximity 19 get interrupt function.
This function get states of the Interrupt ( INT ) pin of the RPR-0720, Reflective Type Photosensor Miniature Proximity Sensor on the Proximity 19 click board.
[in] | ctx | : Click context object. See proximity19_t object definition for detailed explanation. |
0
- Low pin state, 1
- High pin state. See #err_t definition for detailed explanation. err_t proximity19_get_manufact_id | ( | proximity19_t * | ctx, |
uint8_t * | manufact_id | ||
) |
Proximity 19 get manufacture ID function.
This function reads the manufacturer ID data by using the I2C serial interface.
[in] | ctx | : Click context object. See proximity19_t object definition for detailed explanation. |
[out] | manufact_id | : Manufacturer ID data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity19_get_part_id | ( | proximity19_t * | ctx, |
uint8_t * | part_id | ||
) |
Proximity 19 get part ID function.
This function reads the part ID data by using the I2C serial interface.
[in] | ctx | : Click context object. See proximity19_t object definition for detailed explanation. |
[out] | part_id | : Part ID. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity19_get_ps_data | ( | proximity19_t * | ctx, |
uint16_t * | ps_data | ||
) |
Proximity 19 get PS data function.
This function reads the proximity sensor's raw data by using the I2C serial interface.
[in] | ctx | : Click context object. See proximity19_t object definition for detailed explanation. |
[out] | ps_data | : PS raw data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity19_init | ( | proximity19_t * | ctx, |
proximity19_cfg_t * | cfg | ||
) |
Proximity 19 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See proximity19_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See proximity19_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity19_int_cfg | ( | proximity19_t * | ctx, |
uint8_t | int_cfg | ||
) |
Proximity 19 interrupt configuration function.
This function sets the desired configuration of the interrupt register by using the I2C serial interface.
[in] | ctx | : Click context object. See proximity19_t object definition for detailed explanation. |
[in] | ps_offset | : PS offset data [0x0000-0x03FF]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity19_ps_disable | ( | proximity19_t * | ctx | ) |
Proximity 19 PS standby function.
This function sets PS standby mode by using the I2C serial interface.
[in] | ctx | : Click context object. See proximity19_t object definition for detailed explanation. |
[in] | vcsel_current | : VCSEL current [0x00-0x02]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity19_ps_enable | ( | proximity19_t * | ctx | ) |
Proximity 19 PS enable function.
This function performs PS data enabled by using the I2C serial interface.
[in] | ctx | : Click context object. See proximity19_t object definition for detailed explanation. |
[in] | vcsel_current | : VCSEL current [0x00-0x02]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity19_set_pd_sel | ( | proximity19_t * | ctx, |
uint8_t | pd_sel | ||
) |
Proximity 19 set PD photodiode function.
This function sets the desired PD photodiode by using the I2C serial interface.
[in] | ctx | : Click context object. See proximity19_t object definition for detailed explanation. |
[in] | pd_sel | : PD photodiode [0x00-0x03]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity19_set_period | ( | proximity19_t * | ctx, |
uint8_t | period | ||
) |
Proximity 19 set period function.
This function sets the desired data measurement period value by using the I2C serial interface.
[in] | ctx | : Click context object. See proximity19_t object definition for detailed explanation. |
[in] | period | : Period [0x00-0x04]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity19_set_ps_gain | ( | proximity19_t * | ctx, |
uint8_t | ps_gain | ||
) |
Proximity 19 set PS gain function.
This function adjusts the gain of the sensor's sensitivity to light reception by using the I2C serial interface.
[in] | ctx | : Click context object. See proximity19_t object definition for detailed explanation. |
[in] | ps_gain | : PS gain selection [0x00-0x01]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity19_set_ps_offset | ( | proximity19_t * | ctx, |
uint16_t | ps_offset | ||
) |
Proximity 19 set PS offset function.
This function sets the desired PS offset value by using the I2C serial interface.
[in] | ctx | : Click context object. See proximity19_t object definition for detailed explanation. |
[in] | ps_offset | : PS offset data [0x0000-0x03FF]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity19_set_ps_th | ( | proximity19_t * | ctx, |
uint16_t | ps_th_high, | ||
uint16_t | ps_th_low | ||
) |
Proximity 19 set PS threshold function.
This function sets the desired high and low threshold data by using the I2C serial interface.
[in] | ctx | : Click context object. See proximity19_t object definition for detailed explanation. |
[in] | ps_th_high | : High threshold data [0x0000-0x0FFF]. |
[in] | ps_th_low | : Low threshold data [0x0000-0x0FFF]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity19_set_pulse_width | ( | proximity19_t * | ctx, |
uint8_t | pulse_width | ||
) |
Proximity 19 set pulse width function.
This function sets the desired sensor pulse width value by using the I2C serial interface.
[in] | ctx | : Click context object. See proximity19_t object definition for detailed explanation. |
[in] | pulse_width | : VCSEL pulse width [0x00-0x03]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity19_set_vcsel_current | ( | proximity19_t * | ctx, |
uint8_t | vcsel_current | ||
) |
Proximity 19 set VCSEL current function.
This function sets the desired VCSEL current value by using the I2C serial interface.
[in] | ctx | : Click context object. See proximity19_t object definition for detailed explanation. |
[in] | vcsel_current | : VCSEL current [0x00-0x02]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t proximity19_sw_reset | ( | proximity19_t * | ctx | ) |
Proximity 19 software reset function.
This function performs sensor software reset by using the I2C serial interface.
[in] | ctx | : Click context object. See proximity19_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.