profet15a 2.0.0.0
PROFET 15A Click Driver

API for configuring and manipulating PROFET 15A Click driver. More...

Topics

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

Functions

void profet15a_cfg_setup (profet15a_cfg_t *cfg)
 PROFET 15A configuration object setup function.
 
err_t profet15a_init (profet15a_t *ctx, profet15a_cfg_t *cfg)
 PROFET 15A initialization function.
 
err_t profet15a_read_an_pin_value (profet15a_t *ctx, uint16_t *data_out)
 PROFET 15A read AN pin value function.
 
err_t profet15a_read_an_pin_voltage (profet15a_t *ctx, float *data_out)
 PROFET 15A read AN pin voltage level function.
 
err_t profet15a_set_mode (profet15a_t *ctx, uint8_t mode)
 PROFET 15A set mode.
 

Detailed Description

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

◆ profet15a_cfg_setup()

void profet15a_cfg_setup ( profet15a_cfg_t * cfg)

PROFET 15A configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ profet15a_init()

err_t profet15a_init ( profet15a_t * ctx,
profet15a_cfg_t * cfg )

PROFET 15A initialization function.

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

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

◆ profet15a_read_an_pin_value()

err_t profet15a_read_an_pin_value ( profet15a_t * ctx,
uint16_t * data_out )

PROFET 15A read AN pin value function.

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

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

◆ profet15a_read_an_pin_voltage()

err_t profet15a_read_an_pin_voltage ( profet15a_t * ctx,
float * data_out )

PROFET 15A 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 profet15a_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).

◆ profet15a_set_mode()

err_t profet15a_set_mode ( profet15a_t * ctx,
uint8_t mode )

PROFET 15A set mode.

This function sets DEN and IN pins state to set device in selected mode.

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