irgesture3 2.1.0.0
|
API for configuring and manipulating IR Gesture 3 Click driver. More...
Topics | |
IR Gesture 3 Registers List | |
List of registers of IR Gesture 3 Click driver. | |
IR Gesture 3 Registers Settings | |
Settings for registers of IR Gesture 3 Click driver. | |
IR Gesture 3 MikroBUS Map | |
MikroBUS pin mapping of IR Gesture 3 Click driver. | |
Functions | |
void | irgesture3_cfg_setup (irgesture3_cfg_t *cfg) |
IR Gesture 3 configuration object setup function. | |
err_t | irgesture3_init (irgesture3_t *ctx, irgesture3_cfg_t *cfg) |
IR Gesture 3 initialization function. | |
err_t | irgesture3_default_cfg (irgesture3_t *ctx) |
IR Gesture 3 default configuration function. | |
err_t | irgesture3_write_register (irgesture3_t *ctx, uint8_t reg, uint16_t data_in) |
IR Gesture 3 write register function. | |
err_t | irgesture3_read_register (irgesture3_t *ctx, uint8_t reg, uint16_t *data_out) |
IR Gesture 3 read register function. | |
err_t | irgesture3_check_communication (irgesture3_t *ctx) |
IR Gesture 3 check communication function. | |
uint8_t | irgesture3_get_io0_pin (irgesture3_t *ctx) |
IR Gesture 3 get io0 function. | |
uint8_t | irgesture3_get_io1_pin (irgesture3_t *ctx) |
IR Gesture 3 get io1 function. | |
err_t | irgesture3_sw_reset (irgesture3_t *ctx) |
IR Gesture 3 sw reset function. | |
err_t | irgesture3_set_mode (irgesture3_t *ctx, uint8_t mode) |
IR Gesture 3 set mode function. | |
err_t | irgesture3_set_adc_fsample (irgesture3_t *ctx, uint16_t freq_hz) |
IR Gesture 3 set adc fsample function. | |
err_t | irgesture3_clear_status (irgesture3_t *ctx) |
IR Gesture 3 clear status function. | |
err_t | irgesture3_wait_data_ready (irgesture3_t *ctx) |
IR Gesture 3 wait data ready function. | |
err_t | irgesture3_get_pd_data (irgesture3_t *ctx, irgesture3_pd_data_t *pd_data) |
IR Gesture 3 get pd data function. | |
err_t | irgesture3_get_gesture (irgesture3_t *ctx, uint8_t *gesture) |
IR Gesture 3 get gesture function. | |
API for configuring and manipulating IR Gesture 3 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void irgesture3_cfg_setup | ( | irgesture3_cfg_t * | cfg | ) |
IR Gesture 3 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See irgesture3_cfg_t object definition for detailed explanation. |
err_t irgesture3_check_communication | ( | irgesture3_t * | ctx | ) |
IR Gesture 3 check communication function.
This function checks the communication by reading and verifying the device ID.
[in] | ctx | : Click context object. See irgesture3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t irgesture3_clear_status | ( | irgesture3_t * | ctx | ) |
IR Gesture 3 clear status function.
This function clears the STATUS register.
[in] | ctx | : Click context object. See irgesture3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t irgesture3_default_cfg | ( | irgesture3_t * | ctx | ) |
IR Gesture 3 default configuration function.
This function executes a default configuration of IR Gesture 3 click board.
[in] | ctx | : Click context object. See irgesture3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t irgesture3_get_gesture | ( | irgesture3_t * | ctx, |
uint8_t * | gesture ) |
IR Gesture 3 get gesture function.
This function waits up to IRGESTURE3_MAX_NUM_SAMPLES for an object to be detected and then calculates its gesture.
[in] | ctx | : Click context object. See irgesture3_t object definition for detailed explanation. |
[out] | gesture | : Calculated gesture of the detected object.
|
0
- Success, -1
- Error or no gesture detected. See #err_t definition for detailed explanation. uint8_t irgesture3_get_io0_pin | ( | irgesture3_t * | ctx | ) |
IR Gesture 3 get io0 function.
This function returns the GPIO0 pin logic state.
[in] | ctx | : Click context object. See irgesture3_t object definition for detailed explanation. |
uint8_t irgesture3_get_io1_pin | ( | irgesture3_t * | ctx | ) |
IR Gesture 3 get io1 function.
This function returns the GPIO1 pin logic state.
[in] | ctx | : Click context object. See irgesture3_t object definition for detailed explanation. |
err_t irgesture3_get_pd_data | ( | irgesture3_t * | ctx, |
irgesture3_pd_data_t * | pd_data ) |
IR Gesture 3 get pd data function.
This function waits for the data ready interrupt and then reads data from photodiodes XR, XL, YB, and YT that are connected to channels PD1 to PD4.
[in] | ctx | : Click context object. See irgesture3_t object definition for detailed explanation. |
[out] | pd_data | : Photodiodes data. See irgesture3_pd_data_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t irgesture3_init | ( | irgesture3_t * | ctx, |
irgesture3_cfg_t * | cfg ) |
IR Gesture 3 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See irgesture3_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See irgesture3_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t irgesture3_read_register | ( | irgesture3_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out ) |
IR Gesture 3 read register function.
This function reads data word from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See irgesture3_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 irgesture3_set_adc_fsample | ( | irgesture3_t * | ctx, |
uint16_t | freq_hz ) |
IR Gesture 3 set adc fsample function.
This function sets the sample frequency of the device.
[in] | ctx | : Click context object. See irgesture3_t object definition for detailed explanation. |
[in] | freq_hz | : Sample frequency in Hz (up to 2000 Hz). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t irgesture3_set_mode | ( | irgesture3_t * | ctx, |
uint8_t | mode ) |
IR Gesture 3 set mode function.
This function sets the device operating mode.
[in] | ctx | : Click context object. See irgesture3_t object definition for detailed explanation. |
[in] | mode | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t irgesture3_sw_reset | ( | irgesture3_t * | ctx | ) |
IR Gesture 3 sw reset function.
This function executes software reset of the device.
[in] | ctx | : Click context object. See irgesture3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t irgesture3_wait_data_ready | ( | irgesture3_t * | ctx | ) |
IR Gesture 3 wait data ready function.
This function waits for the data ready interrupt up to IRGESTURE3_TIMEOUT_MS milliseconds and then clears the STATUS registers.
[in] | ctx | : Click context object. See irgesture3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t irgesture3_write_register | ( | irgesture3_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in ) |
IR Gesture 3 write register function.
This function writes data word to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See irgesture3_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.