pir 2.0.0.0
pir.h File Reference

This file contains API for PIR Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  pir_t
 Click ctx object definition. More...
 
struct  pir_cfg_t
 Click configuration structure definition. More...
 

Macros

#define PIR_MAP_MIKROBUS(cfg, mikrobus)
 
#define PIR_RETVAL   uint8_t
 
#define PIR_OK   0x00
 
#define PIR_INIT_ERROR   0xFF
 

Functions

void pir_cfg_setup (pir_cfg_t *cfg)
 Config Object Initialization function.
 
PIR_RETVAL pir_init (pir_t *ctx, pir_cfg_t *cfg)
 Initialization function.
 
void pir_generic_write (pir_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void pir_generic_read (pir_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint16_t pir_get_adc (pir_t *ctx)
 Reading 12bit ADC value.
 
uint16_t pir_reg_read (pir_t *ctx)
 Reading register.
 
float pir_get_mili_volt (pir_t *ctx, uint16_t ref_voltage)
 Reading ADC data in mili Volts.
 
float pir_scale_results (pir_t *ctx, uint16_t in_val, uint16_t out_min, uint16_t out_max)
 Scaling ADC results.
 

Detailed Description

This file contains API for PIR Click driver.