profet23a 2.0.0.0
PROFET 2 3A Click Driver

API for configuring and manipulating PROFET 2 3A Click driver. More...

Topics

 PROFET 2 3A Registers Settings
 Settings for registers of PROFET 2 3A Click driver.
 
 PROFET 2 3A MikroBUS Map
 MikroBUS pin mapping of PROFET 2 3A Click driver.
 

Functions

void profet23a_cfg_setup (profet23a_cfg_t *cfg)
 PROFET 2 3A configuration object setup function.
 
err_t profet23a_init (profet23a_t *ctx, profet23a_cfg_t *cfg)
 PROFET 2 3A initialization function.
 
err_t profet23a_default_cfg (profet23a_t *ctx)
 PROFET 2 3A default configuration function.
 
err_t profet23a_read_an_pin_value (profet23a_t *ctx, uint16_t *data_out)
 Read AN pin value function.
 
err_t profet23a_read_an_pin_voltage (profet23a_t *ctx, float *data_out)
 Read AN pin voltage level function.
 
void profet23a_set_dsl (profet23a_t *ctx, uint8_t state)
 Set diagnostic select pin state.
 
void profet23a_set_den (profet23a_t *ctx, uint8_t state)
 Set diagnostic enable pin state.
 
void profet23a_set_in1 (profet23a_t *ctx, uint8_t state)
 Set channel 1 enable pin state.
 
void profet23a_set_in0 (profet23a_t *ctx, uint8_t state)
 Set channel 0 enable pin state.
 
err_t profet23a_set_mode (profet23a_t *ctx, profet23a_channel_t channel, uint8_t mode)
 Set mode device mode for specific channel channel.
 

Detailed Description

API for configuring and manipulating PROFET 2 3A 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

◆ profet23a_cfg_setup()

void profet23a_cfg_setup ( profet23a_cfg_t * cfg)

PROFET 2 3A configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ profet23a_default_cfg()

err_t profet23a_default_cfg ( profet23a_t * ctx)

PROFET 2 3A default configuration function.

This function executes a default configuration of PROFET 2 3A click board.

Parameters
[in]ctx: Click context object. See profet23a_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.

◆ profet23a_init()

err_t profet23a_init ( profet23a_t * ctx,
profet23a_cfg_t * cfg )

PROFET 2 3A initialization function.

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

Parameters
[out]ctx: Click context object. See profet23a_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See profet23a_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ profet23a_read_an_pin_value()

err_t profet23a_read_an_pin_value ( profet23a_t * ctx,
uint16_t * data_out )

Read AN pin value function.

This function reads results of AD conversion of the AN pin.

Parameters
[in]ctx: Click context object. See profet23a_t object definition for detailed explanation.
[out]data_out: Output ADC result.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ profet23a_read_an_pin_voltage()

err_t profet23a_read_an_pin_voltage ( profet23a_t * ctx,
float * data_out )

Read AN pin voltage level function.

This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.

Parameters
[in]ctx: Click context object. See profet23a_t object definition for detailed explanation.
[out]data_out: Output voltage level of the analog pin [V].
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered configuration of the ADC (resolution, reference voltage).

◆ profet23a_set_den()

void profet23a_set_den ( profet23a_t * ctx,
uint8_t state )

Set diagnostic enable pin state.

This function set den pin state.

Parameters
[in]ctx: Click context object. See profet23a_t object definition for detailed explanation.
[in]state: Pin state.
Returns
Nothing

◆ profet23a_set_dsl()

void profet23a_set_dsl ( profet23a_t * ctx,
uint8_t state )

Set diagnostic select pin state.

This function set dsl pin state.

Parameters
[in]ctx: Click context object. See profet23a_t object definition for detailed explanation.
[in]state: Pin state.
Returns
Nothing

◆ profet23a_set_in0()

void profet23a_set_in0 ( profet23a_t * ctx,
uint8_t state )

Set channel 0 enable pin state.

This function set in0 pin state.

Parameters
[in]ctx: Click context object. See profet23a_t object definition for detailed explanation.
[in]state: Pin state.
Returns
Nothing

◆ profet23a_set_in1()

void profet23a_set_in1 ( profet23a_t * ctx,
uint8_t state )

Set channel 1 enable pin state.

This function set in1 pin state.

Parameters
[in]ctx: Click context object. See profet23a_t object definition for detailed explanation.
[in]state: Pin state.
Returns
Nothing

◆ profet23a_set_mode()

err_t profet23a_set_mode ( profet23a_t * ctx,
profet23a_channel_t channel,
uint8_t mode )

Set mode device mode for specific channel channel.

This function sets DEN, DSL INx pins state to set device in selected mode for selected channel.

Parameters
[in]ctx: Click context object. See profet23a_t object definition for detailed explanation.
[in]channel: Channel to set.
[in]mode: Mode to set.
Returns
  • 0 - Success,
  • -1 - Error,
  • -2 - Error Channel.
See #err_t definition for detailed explanation.