|
pir3 2.2.0
|
API for configuring and manipulating PIR 3 Click driver. More...
Topics | |
| PIR 3 Registers Settings | |
| Settings for registers of PIR 3 Click driver. | |
| PIR 3 MikroBUS Map | |
| MikroBUS pin mapping of PIR 3 Click driver. | |
Functions | |
| void | pir3_cfg_setup (pir3_cfg_t *cfg) |
| PIR 3 configuration object setup function. | |
| err_t | pir3_init (pir3_t *ctx, pir3_cfg_t *cfg) |
| PIR 3 initialization function. | |
| err_t | pir3_default_cfg (pir3_t *ctx) |
| PIR 3 default configuration function. | |
| err_t | pir3_write_config (pir3_t *ctx) |
| PIR 3 write config function. | |
| err_t | pir3_read_peak_hold (pir3_t *ctx, int16_t *peak_hold) |
| PIR 3 read peak hold function. | |
| void | pir3_enable_device (pir3_t *ctx) |
| PIR 3 enable device function. | |
| void | pir3_disable_device (pir3_t *ctx) |
| PIR 3 disable device function. | |
| void | pir3_set_detection_level (pir3_t *ctx, uint8_t detlvl) |
| PIR 3 set detection level function. | |
| void | pir3_set_trigger_out (pir3_t *ctx, uint8_t trigom) |
| PIR 3 set trigger out function. | |
| void | pir3_set_filter_step (pir3_t *ctx, uint8_t fstep) |
| PIR 3 set filter step function. | |
| void | pir3_set_filter_type (pir3_t *ctx, uint8_t filsel) |
| PIR 3 set filter type function. | |
API for configuring and manipulating PIR 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 pir3_cfg_setup | ( | pir3_cfg_t * | cfg | ) |
PIR 3 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See pir3_cfg_t object definition for detailed explanation. |
| err_t pir3_default_cfg | ( | pir3_t * | ctx | ) |
PIR 3 default configuration function.
This function executes a default configuration of PIR 3 Click board.
| [in] | ctx | : Click context object. See pir3_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void pir3_disable_device | ( | pir3_t * | ctx | ) |
PIR 3 disable device function.
This function disables the device by setting the OFF pin to low logic state.
| [in] | ctx | : Click context object. See pir3_t object definition for detailed explanation. |
| void pir3_enable_device | ( | pir3_t * | ctx | ) |
PIR 3 enable device function.
This function enables the device by setting the ON pin to high logic state.
| [in] | ctx | : Click context object. See pir3_t object definition for detailed explanation. |
| err_t pir3_init | ( | pir3_t * | ctx, |
| pir3_cfg_t * | cfg ) |
PIR 3 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See pir3_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See pir3_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t pir3_read_peak_hold | ( | pir3_t * | ctx, |
| int16_t * | peak_hold ) |
PIR 3 read peak hold function.
This function reads a 12-bit signed peak hold data by using I2C serial interface.
| [in] | ctx | : Click context object. See pir3_t object definition for detailed explanation. |
| [out] | peak_hold | : 12-bit signed peak hold data. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void pir3_set_detection_level | ( | pir3_t * | ctx, |
| uint8_t | detlvl ) |
PIR 3 set detection level function.
This function sets the detection threshold level in the ctx->config structure.
| [in] | ctx | : Click context object. See pir3_t object definition for detailed explanation. |
| [in] | detlvl | : Detection threshold level. |
| void pir3_set_filter_step | ( | pir3_t * | ctx, |
| uint8_t | fstep ) |
PIR 3 set filter step function.
This function sets the digital band-pass filter step selection in the ctx->config structure.
| [in] | ctx | : Click context object. See pir3_t object definition for detailed explanation. |
| [in] | fstep | : Filter step selection: 1-step 1, 3-step 2, 0-step 3. |
| void pir3_set_filter_type | ( | pir3_t * | ctx, |
| uint8_t | filsel ) |
PIR 3 set filter type function.
This function sets the digital band-pass filter type selection in the ctx->config structure.
| [in] | ctx | : Click context object. See pir3_t object definition for detailed explanation. |
| [in] | filsel | : Filter type selection: 7-A, 0-B, 1-C, 2-D, 3-digital. |
| void pir3_set_trigger_out | ( | pir3_t * | ctx, |
| uint8_t | trigom ) |
PIR 3 set trigger out function.
This function sets the trigger output mode in the ctx->config structure.
| [in] | ctx | : Click context object. See pir3_t object definition for detailed explanation. |
| [in] | trigom | : Trigger output mode: 0-disabled, 1-enabled. |
| err_t pir3_write_config | ( | pir3_t * | ctx | ) |
PIR 3 write config function.
This function writes a config structure to the sensor by using I2C serial interface.
| [in] | ctx | : Click context object. See pir3_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation.