mcp16331inv 2.0.0.0

Functions

void mcp16331inv_cfg_setup (mcp16331inv_cfg_t *cfg)
 Config Object Initialization function.
 
MCP16331INV_RETVAL mcp16331inv_init (mcp16331inv_t *ctx, mcp16331inv_cfg_t *cfg)
 Initialization function.
 
void mcp16331inv_generic_transfer (mcp16331inv_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
void mcp16331inv_set_dac_vout (mcp16331inv_t *ctx, uint16_t dac_value, uint8_t gain_value, uint8_t mode)
 DAC output voltage set function.
 
void mcp16331inv_enable_vin (mcp16331inv_t *ctx, uint8_t state)
 VIN Pull Up enable function.
 

Detailed Description

Function Documentation

◆ mcp16331inv_cfg_setup()

void mcp16331inv_cfg_setup ( mcp16331inv_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ mcp16331inv_enable_vin()

void mcp16331inv_enable_vin ( mcp16331inv_t * ctx,
uint8_t state )

VIN Pull Up enable function.

Parameters
ctxClick object.
state1 - enable, 0 - disable

@description Function enables or disables internal VIN pull up.

◆ mcp16331inv_generic_transfer()

void mcp16331inv_generic_transfer ( mcp16331inv_t * ctx,
uint8_t * wr_buf,
uint16_t wr_len,
uint8_t * rd_buf,
uint16_t rd_len )

Generic transfer function.

Parameters
ctxClick object.
wr_bufWrite data buffer
wr_lenNumber of byte in write data buffer
rd_bufRead data buffer
rd_lenNumber of byte in read data buffer

@description Generic SPI transfer, for sending and receiving packages

◆ mcp16331inv_init()

MCP16331INV_RETVAL mcp16331inv_init ( mcp16331inv_t * ctx,
mcp16331inv_cfg_t * cfg )

Initialization function.

Parameters
mcp16331invClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ mcp16331inv_set_dac_vout()

void mcp16331inv_set_dac_vout ( mcp16331inv_t * ctx,
uint16_t dac_value,
uint8_t gain_value,
uint8_t mode )

DAC output voltage set function.

Parameters
ctxClick object.
DAC_value12-bit DAC input value
gain_value1 - 1x VREF, 0 - 2x VREF
mode1 - active mode, 0 - shutdown mode

@description Function determines DAC output voltage value in depending on the input DAC_value (0x0000 - 0x0FFF) and gain_value. Function also can put device on active or shutdown mode.