accurrent 2.0.0.0
accurrent.h File Reference

This file contains API for AC CURRENT Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"

Go to the source code of this file.

Data Structures

struct  accurrent_t
 Click ctx object definition. More...
 
struct  accurrent_cfg_t
 Click configuration structure definition. More...
 

Macros

#define ACCURRENT_MAP_MIKROBUS(cfg, mikrobus)
 
#define ACCURRENT_OK   0
 
#define ACCURRENT_ERROR   -1
 
#define ACCURRENT_ADC_ITERATIONS   10
 
#define ACCURRENT_ADC_RESOLUTION   0x0FFF
 
#define ACCURRENT_AC_TO_DC_V_SCALE   1.8f
 
#define ACCURRENT_SENSOR_RESOLUTION   30.0f
 
#define ACCURRENT_A_TO_MA_SCALE   1000.0f
 

Functions

void accurrent_cfg_setup (accurrent_cfg_t *cfg)
 Config Object Initialization function.
 
err_t accurrent_init (accurrent_t *ctx, accurrent_cfg_t *cfg)
 Initialization function.
 
void accurrent_generic_transfer (accurrent_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
float accurrent_get_a (accurrent_t *ctx)
 Gets current value of AC Current in A.
 
float accurrent_get_ma (accurrent_t *ctx)
 Gets current value of AC Current in mA.
 

Detailed Description

This file contains API for AC CURRENT Click driver.