thunderemu 2.1.0.0
|
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. | |
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.
void thunderemu_cfg_setup | ( | thunderemu_cfg_t * | cfg | ) |
Thunder EMU configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See thunderemu_cfg_t object definition for detailed explanation. |
err_t thunderemu_default_cfg | ( | thunderemu_t * | ctx | ) |
Thunder EMU default configuration function.
This function executes a default configuration of Thunder EMU click board.
[in] | ctx | : Click context object. See thunderemu_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See thunderemu_t object definition for detailed explanation. |
[in] | mode | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t thunderemu_get_close_pin | ( | thunderemu_t * | ctx | ) |
Thunder EMU get close pin function.
This function returns the CLOSE pin logic state.
[in] | ctx | : Click context object. See thunderemu_t object definition for detailed explanation. |
uint8_t thunderemu_get_far_pin | ( | thunderemu_t * | ctx | ) |
Thunder EMU get far pin function.
This function returns the FAR pin logic state.
[in] | ctx | : Click context object. See thunderemu_t object definition for detailed explanation. |
uint8_t thunderemu_get_mid_pin | ( | thunderemu_t * | ctx | ) |
Thunder EMU get mid pin function.
This function returns the MID pin logic state.
[in] | ctx | : Click context object. See thunderemu_t object definition for detailed explanation. |
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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void thunderemu_led_disable | ( | thunderemu_t * | ctx | ) |
Thunder EMU led disable function.
This function disables the thunder LED indicator.
[in] | ctx | : Click context object. See thunderemu_t object definition for detailed explanation. |
void thunderemu_led_enable | ( | thunderemu_t * | ctx | ) |
Thunder EMU led enable function.
This function enables the thunder LED indicator.
[in] | ctx | : Click context object. See thunderemu_t object definition for detailed explanation. |
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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.