proximity5 2.0.0.0
|
Functions | |
void | proximity5_cfg_setup (proximity5_cfg_t *cfg) |
Config Object Initialization function. | |
PROXIMITY5_RETVAL | proximity5_init (proximity5_t *ctx, proximity5_cfg_t *cfg) |
Initialization function. | |
void | proximity5_default_cfg (proximity5_t *ctx) |
Click Default Configuration function. | |
void | proximity5_generic_write (proximity5_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | proximity5_generic_read (proximity5_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
uint16_t | proximity5_read_reg (proximity5_t *ctx, uint8_t addr) |
16bit read function. | |
uint16_t | proximity5_get_id (proximity5_t *ctx) |
16bit read function. | |
void | proximity5_get_values (proximity5_t *ctx, uint16_t *prox_val) |
Proximity value get function. | |
void proximity5_cfg_setup | ( | proximity5_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void proximity5_default_cfg | ( | proximity5_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for Proximity5 click.
void proximity5_generic_read | ( | proximity5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function reads data from the desired register.
void proximity5_generic_write | ( | proximity5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function writes data to the desired register.
uint16_t proximity5_get_id | ( | proximity5_t * | ctx | ) |
16bit read function.
ctx | Click object. |
addr | Register address. |
@description Read the ID from the ID register of the sensor.
void proximity5_get_values | ( | proximity5_t * | ctx, |
uint16_t * | prox_val ) |
Proximity value get function.
ctx | Click object. |
prox_val | Proximity data buffer. |
@description Starts the conversion and waits for the interrupt to finish. After the interrupt finishes the proximity data from the proximity registers is returned to a 3 member uint16_t array.
PROXIMITY5_RETVAL proximity5_init | ( | proximity5_t * | ctx, |
proximity5_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint16_t proximity5_read_reg | ( | proximity5_t * | ctx, |
uint8_t | addr ) |
16bit read function.
ctx | Click object. |
addr | Register address. |
@description Generic function for reading both high and low register value and returns those combined values to a 16bit variable.