pir3 2.2.0
Loading...
Searching...
No Matches
PIR 3 Click Driver

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.

Detailed Description

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.

Function Documentation

◆ pir3_cfg_setup()

void pir3_cfg_setup ( pir3_cfg_t * cfg)

PIR 3 configuration object setup function.

This function initializes Click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See pir3_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ pir3_default_cfg()

err_t pir3_default_cfg ( pir3_t * ctx)

PIR 3 default configuration function.

This function executes a default configuration of PIR 3 Click board.

Parameters
[in]ctx: Click context object. See pir3_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ pir3_disable_device()

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.

Parameters
[in]ctx: Click context object. See pir3_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ pir3_enable_device()

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.

Parameters
[in]ctx: Click context object. See pir3_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ pir3_init()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ pir3_read_peak_hold()

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.

Parameters
[in]ctx: Click context object. See pir3_t object definition for detailed explanation.
[out]peak_hold: 12-bit signed peak hold data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ pir3_set_detection_level()

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.

Parameters
[in]ctx: Click context object. See pir3_t object definition for detailed explanation.
[in]detlvl: Detection threshold level.
Returns
None.
Note
The config changes are applied using the pir3_write_config function.

◆ pir3_set_filter_step()

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.

Parameters
[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.
Returns
None.
Note
The config changes are applied using the pir3_write_config function.

◆ pir3_set_filter_type()

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.

Parameters
[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.
Returns
None.
Note
The config changes are applied using the pir3_write_config function.

◆ pir3_set_trigger_out()

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.

Parameters
[in]ctx: Click context object. See pir3_t object definition for detailed explanation.
[in]trigom: Trigger output mode: 0-disabled, 1-enabled.
Returns
None.
Note
The config changes are applied using the pir3_write_config function.

◆ pir3_write_config()

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.

Parameters
[in]ctx: Click context object. See pir3_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.