hallcurrent6 2.0.0.0
|
This file contains API for Hall Current 6 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 | hallcurrent6_t |
Click ctx object definition. More... | |
struct | hallcurrent6_cfg_t |
Click configuration structure definition. More... | |
Macros | |
#define | HALLCURRENT6_MAP_MIKROBUS(cfg, mikrobus) |
#define | HALLCURRENT6_RETVAL uint8_t |
#define | HALLCURRENT6_OK 0x00 |
#define | HALLCURRENT6_INIT_ERROR 0xFF |
Functions | |
void | hallcurrent6_cfg_setup (hallcurrent6_cfg_t *cfg) |
Config Object Initialization function. | |
HALLCURRENT6_RETVAL | hallcurrent6_init (hallcurrent6_t *ctx, hallcurrent6_cfg_t *cfg) |
Initialization function. | |
void | hallcurrent6_generic_write (hallcurrent6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | hallcurrent6_generic_read (hallcurrent6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
uint16_t | hallcurrent6_read_data (hallcurrent6_t *ctx) |
Reads ADC current data. | |
float | hallcurrent6_get_current (hallcurrent6_t *ctx) |
Reads current data. | |
This file contains API for Hall Current 6 Click driver.
void hallcurrent6_cfg_setup | ( | hallcurrent6_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void hallcurrent6_generic_read | ( | hallcurrent6_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function reads data from the desired register.
void hallcurrent6_generic_write | ( | hallcurrent6_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function writes data to the desired register.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf. |
len | Number of the bytes to be read |
@description This function writes data from the desired register.
float hallcurrent6_get_current | ( | hallcurrent6_t * | ctx | ) |
Reads current data.
Current | data in [mA] |
ctx | Click object. |
@description Bipolar current sensor – nominal 400mV/A or 5A full scale
HALLCURRENT6_RETVAL hallcurrent6_init | ( | hallcurrent6_t * | ctx, |
hallcurrent6_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint16_t hallcurrent6_read_data | ( | hallcurrent6_t * | ctx | ) |
Reads ADC current data.
(12 | bits) adc value |
ctx | Click object. |
@description The value of 2065 is 0A