thunderemu 2.1.0.0
Thunder EMU Click Driver

API for configuring and manipulating Thunder EMU Click driver. More...

Topics

 Thunder EMU Registers Settings
 Settings for registers of Thunder EMU Click driver.
 
 Thunder EMU MikroBUS Map
 MikroBUS pin mapping of Thunder EMU Click driver.
 

Functions

void thunderemu_cfg_setup (thunderemu_cfg_t *cfg)
 Thunder EMU configuration object setup function.
 
err_t thunderemu_init (thunderemu_t *ctx, thunderemu_cfg_t *cfg)
 Thunder EMU initialization function.
 
err_t thunderemu_default_cfg (thunderemu_t *ctx)
 Thunder EMU default configuration function.
 
err_t thunderemu_set_dac_output (thunderemu_t *ctx, uint8_t mode, uint16_t dac_data)
 Thunder EMU set dac output function.
 
err_t thunderemu_generate_thunder (thunderemu_t *ctx, uint8_t mode)
 Thunder EMU generate thunder function.
 
void thunderemu_led_enable (thunderemu_t *ctx)
 Thunder EMU led enable function.
 
void thunderemu_led_disable (thunderemu_t *ctx)
 Thunder EMU led disable function.
 
uint8_t thunderemu_get_close_pin (thunderemu_t *ctx)
 Thunder EMU get close pin function.
 
uint8_t thunderemu_get_mid_pin (thunderemu_t *ctx)
 Thunder EMU get mid pin function.
 
uint8_t thunderemu_get_far_pin (thunderemu_t *ctx)
 Thunder EMU get far pin function.
 

Detailed Description

API for configuring and manipulating Thunder EMU 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

◆ thunderemu_cfg_setup()

void thunderemu_cfg_setup ( thunderemu_cfg_t * cfg)

Thunder EMU configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ thunderemu_default_cfg()

err_t thunderemu_default_cfg ( thunderemu_t * ctx)

Thunder EMU default configuration function.

This function executes a default configuration of Thunder EMU click board.

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

◆ thunderemu_generate_thunder()

err_t thunderemu_generate_thunder ( thunderemu_t * ctx,
uint8_t mode )

Thunder EMU generate thunder function.

This function generates close, mid or far range thunder signal by setting the predefined DAC output profile at the specific timing.

Parameters
[in]ctx: Click context object. See thunderemu_t object definition for detailed explanation.
[in]mode:
  • 0 - Close range thunder signal,
  • 1 - Mid range thunder signal,
  • 2 - Far range thunder signal.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
DAC profile is calibrated for ranges of up to 15cm between inductors.

◆ thunderemu_get_close_pin()

uint8_t thunderemu_get_close_pin ( thunderemu_t * ctx)

Thunder EMU get close pin function.

This function returns the CLOSE pin logic state.

Parameters
[in]ctx: Click context object. See thunderemu_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ thunderemu_get_far_pin()

uint8_t thunderemu_get_far_pin ( thunderemu_t * ctx)

Thunder EMU get far pin function.

This function returns the FAR pin logic state.

Parameters
[in]ctx: Click context object. See thunderemu_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ thunderemu_get_mid_pin()

uint8_t thunderemu_get_mid_pin ( thunderemu_t * ctx)

Thunder EMU get mid pin function.

This function returns the MID pin logic state.

Parameters
[in]ctx: Click context object. See thunderemu_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ thunderemu_init()

err_t thunderemu_init ( thunderemu_t * ctx,
thunderemu_cfg_t * cfg )

Thunder EMU initialization function.

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

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

◆ thunderemu_led_disable()

void thunderemu_led_disable ( thunderemu_t * ctx)

Thunder EMU led disable function.

This function disables the thunder LED indicator.

Parameters
[in]ctx: Click context object. See thunderemu_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ thunderemu_led_enable()

void thunderemu_led_enable ( thunderemu_t * ctx)

Thunder EMU led enable function.

This function enables the thunder LED indicator.

Parameters
[in]ctx: Click context object. See thunderemu_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ thunderemu_set_dac_output()

err_t thunderemu_set_dac_output ( thunderemu_t * ctx,
uint8_t mode,
uint16_t dac_data )

Thunder EMU set dac output function.

This function sets the DAC output data and mode by using I2C serial interface.

Parameters
[in]ctx: Click context object. See thunderemu_t object definition for detailed explanation.
[in]mode: DAC operating mode, refer to THUNDEREMU_DAC_MODE_x macros definition for more details.
[in]dac_data: DAC 12-bit raw data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.