39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
73#define AUDIOAMP8_REG_PWR_MODE_CTRL 0x00
74#define AUDIOAMP8_REG_THSH_PWR_MODE_PM12 0x01
75#define AUDIOAMP8_REG_THSH_PWR_MODE_PM21 0x02
76#define AUDIOAMP8_REG_THSH_PWR_MODE_PM23 0x03
77#define AUDIOAMP8_REG_THSH_PWR_MODE_PM32 0x04
78#define AUDIOAMP8_REG_SOFT_CLP_OVC_PROT_LAT 0x0A
79#define AUDIOAMP8_REG_SEL_PWR_MODE_PROFILE 0x1D
80#define AUDIOAMP8_REG_PWR_MODE_PROFILE_CFG 0x1E
81#define AUDIOAMP8_REG_OVC_PROT_LAT_CLR 0x20
82#define AUDIOAMP8_REG_AUDIO_IN_MODE 0x25
83#define AUDIOAMP8_REG_DC_PROTECTION 0x26
84#define AUDIOAMP8_REG_AUDIO_IN_MODE_OVERWRITE 0x27
85#define AUDIOAMP8_REG_ERROR_HANDLER_CLEAR 0x2D
87#define AUDIOAMP8_REG_MON_CH_0_FREQ_PWR_MODE 0x60
88#define AUDIOAMP8_REG_MON_CH_0 0x61
89#define AUDIOAMP8_REG_MON_CH_0_MODUL_INDEX 0x62
90#define AUDIOAMP8_REG_MON_CH_1_FREQ_PWR_MODE 0x64
91#define AUDIOAMP8_REG_MON_CH_1 0x65
92#define AUDIOAMP8_REG_MON_CH_1_MODUL_INDEX 0x66
93#define AUDIOAMP8_REG_ERROR_ACCUMULATED 0x6D
94#define AUDIOAMP8_REG_MONITOR_MSEL 0x75
95#define AUDIOAMP8_REG_ERROR 0x7C
113#define AUDIOAMP8_SET_MON_CH_0 0x00
114#define AUDIOAMP8_SET_MON_CH_1 0x01
115#define AUDIOAMP8_SET_AUTO_PWR_MODE 0x00
116#define AUDIOAMP8_SET_MANUAL_PWR_MODE 0x01
117#define AUDIOAMP8_SET_MTHR_1TO2_DEFAULT 0x3C
118#define AUDIOAMP8_SET_MTHR_2TO1_DEFAULT 0x32
119#define AUDIOAMP8_SET_MTHR_2TO3_DEFAULT 0x5A
120#define AUDIOAMP8_SET_MTHR_3TO2_DEFAULT 0x50
121#define AUDIOAMP8_SET_DISABLE 0x00
122#define AUDIOAMP8_SET_ENABLE 0x01
130#define AUDIOAMP8_SET_DEV_ADDR_0 0x20
131#define AUDIOAMP8_SET_DEV_ADDR_1 0x21
132#define AUDIOAMP8_SET_DEV_ADDR_2 0x22
133#define AUDIOAMP8_SET_DEV_ADDR_3 0x23
151#define AUDIOAMP8_MAP_MIKROBUS( cfg, mikrobus ) \
152 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
153 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
154 cfg.en = MIKROBUS( mikrobus, MIKROBUS_CS ); \
155 cfg.mut = MIKROBUS( mikrobus, MIKROBUS_RST ); \
156 cfg.ms0 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
157 cfg.ms1 = MIKROBUS( mikrobus, MIKROBUS_INT )
audioamp8_return_value_t
AudioAmp 8 Click return value data.
Definition audioamp8.h:269
@ AUDIOAMP8_ERROR
Definition audioamp8.h:271
@ AUDIOAMP8_OK
Definition audioamp8.h:270
audioamp8_audio_in_mode_ext_value_t
AudioAmp 8 Click audio input mode value data.
Definition audioamp8.h:330
@ AUDIOAMP8_AUDIO_IN_MODE_EXT_ENABLE
Definition audioamp8.h:332
@ AUDIOAMP8_AUDIO_IN_MODE_EXT_DISABLE
Definition audioamp8.h:331
audioamp8_pm_man_sh_value_t
AudioAmp 8 Click profile assign scheme value data.
Definition audioamp8.h:306
@ AUDIOAMP8_SCHEME_B
Definition audioamp8.h:308
@ AUDIOAMP8_SCHEME_D
Definition audioamp8.h:310
@ AUDIOAMP8_SCHEME_A
Definition audioamp8.h:307
@ AUDIOAMP8_SCHEME_C
Definition audioamp8.h:309
audioamp8_manual_pm_value_t
AudioAmp 8 Click manual selected power mode value data.
Definition audioamp8.h:280
@ AUDIOAMP8_PM_MAN_2
Definition audioamp8.h:282
@ AUDIOAMP8_PM_MAN_1
Definition audioamp8.h:281
@ AUDIOAMP8_PM_MAN_3
Definition audioamp8.h:283
audioamp8_audio_in_mode_value_t
AudioAmp 8 Click audio input mode value data.
Definition audioamp8.h:319
@ AUDIOAMP8_AUDIO_IN_MODE_0_26dB
Definition audioamp8.h:321
@ AUDIOAMP8_AUDIO_IN_MODE_0_20dB
Definition audioamp8.h:320
audioamp8_pm_profile_value_t
AudioAmp 8 Click select power mode profile value data.
Definition audioamp8.h:292
@ AUDIOAMP8_PM_PROFILE_4
Definition audioamp8.h:297
@ AUDIOAMP8_PM_PROFILE_0
Definition audioamp8.h:293
@ AUDIOAMP8_PM_PROFILE_3
Definition audioamp8.h:296
@ AUDIOAMP8_PM_PROFILE_2
Definition audioamp8.h:295
@ AUDIOAMP8_PM_PROFILE_1
Definition audioamp8.h:294
err_t audioamp8_get_cfg_pmode(audioamp8_t *ctx, audioamp8_pwr_mon_cfg_t *pwr_mode)
AudioAmp 8 get power mode configuration function.
err_t audioamp8_set_enable(audioamp8_t *ctx, uint8_t dev_en)
AudioAmp 8 enable function.
err_t audioamp8_set_audio_imode_ow(audioamp8_t *ctx, uint8_t audio_in_mode_ext)
AudioAmp 8 set audio IN mode overwrite function.
err_t audioamp8_default_cfg(audioamp8_t *ctx)
AudioAmp 8 default configuration function.
err_t audioamp8_clr_err_handler(audioamp8_t *ctx)
AudioAmp 8 error handler clear function.
err_t audioamp8_shut_down(audioamp8_t *ctx)
AudioAmp 8 shut-down procedure function.
err_t audioamp8_get_cfg_pmode_p(audioamp8_t *ctx, audioamp8_pwr_mod_profile_cfg_t *pm_profile)
AudioAmp 8 get power mode configuration function.
err_t audioamp8_set_soft_copl(audioamp8_t *ctx, uint8_t lf_clamp_en, uint8_t ocp_latch_en)
AudioAmp 8 set soft-clipping and overcurrent protection latching function.
err_t audioamp8_generic_read(audioamp8_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
AudioAmp 8 I2C reading function.
void audioamp8_cfg_setup(audioamp8_cfg_t *cfg)
AudioAmp 8 configuration object setup function.
err_t audioamp8_set_dc_protection(audioamp8_t *ctx, uint8_t eh_dcshdn)
AudioAmp 8 set DC protection function.
err_t audioamp8_generic_write(audioamp8_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
AudioAmp 8 I2C writing function.
err_t audioamp8_start_up(audioamp8_t *ctx)
AudioAmp 8 start-up procedure function.
err_t audioamp8_channel_monitoring(audioamp8_t *ctx, uint8_t mon_ch, audioamp8_monitor_channel_t *ch_mon)
AudioAmp 8 monitors the status of the channel's function.
err_t audioamp8_set_cfg_pmode(audioamp8_t *ctx, audioamp8_pwr_mon_cfg_t pwr_mode)
AudioAmp 8 set power mode configuration function.
err_t audioamp8_set_cfg_pmode_p(audioamp8_t *ctx, audioamp8_pwr_mod_profile_cfg_t pm_profile)
AudioAmp 8 set power mode profile configuration function.
err_t audioamp8_init(audioamp8_t *ctx, audioamp8_cfg_t *cfg)
AudioAmp 8 initialization function.
err_t audioamp8_btl_cfg(audioamp8_t *ctx)
AudioAmp 8 BTL configuration function.
err_t audioamp8_clr_opl(audioamp8_t *ctx)
AudioAmp 8 over-current protection latch clear function.
err_t audioamp8_set_mute(audioamp8_t *ctx, uint8_t en_mute)
AudioAmp 8 mute function.
err_t audioamp8_set_audio_imode(audioamp8_t *ctx, uint8_t audio_in_mode)
AudioAmp 8 set audio IN mode function.
err_t audioamp8_monitor_msel(audioamp8_t *ctx, uint8_t *msel)
AudioAmp 8 monitor msel function.
err_t audioamp8_err_status(audioamp8_t *ctx, audioamp8_error_status_t *error_status)
AudioAmp 8 get error status function.
AudioAmp 8 Click configuration object.
Definition audioamp8.h:187
pin_name_t ms0
Definition audioamp8.h:193
pin_name_t mut
Definition audioamp8.h:192
uint32_t i2c_speed
Definition audioamp8.h:196
pin_name_t ms1
Definition audioamp8.h:194
pin_name_t scl
Definition audioamp8.h:188
pin_name_t en
Definition audioamp8.h:191
pin_name_t sda
Definition audioamp8.h:189
uint8_t i2c_address
Definition audioamp8.h:197
AudioAmp 8 Click monitor channel object.
Definition audioamp8.h:252
uint8_t fly_cap_ov_vtg
Definition audioamp8.h:253
uint8_t imped_prot
Definition audioamp8.h:259
uint8_t dc_prot
Definition audioamp8.h:260
uint8_t pvdd_un_vtg_prot
Definition audioamp8.h:256
uint8_t ov_temp_err
Definition audioamp8.h:258
uint8_t ov_temp_wrg
Definition audioamp8.h:257
uint8_t pll_err
Definition audioamp8.h:255
uint8_t ov_curr_prot
Definition audioamp8.h:254
AudioAmp 8 Click monitor channel object.
Definition audioamp8.h:234
uint8_t cfly2_mon
Definition audioamp8.h:240
uint8_t freq_mode
Definition audioamp8.h:235
uint8_t vdd_mon
Definition audioamp8.h:238
uint8_t modul_index_mon
Definition audioamp8.h:243
uint8_t cfly1_mon
Definition audioamp8.h:241
uint8_t ovc_prot
Definition audioamp8.h:242
uint8_t pwr_mode
Definition audioamp8.h:236
uint8_t pvdd_mon
Definition audioamp8.h:239
uint8_t mute_mon
Definition audioamp8.h:237
AudioAmp 8 Click power mode profile configuration object.
Definition audioamp8.h:221
uint8_t pm2_man_sh
Definition audioamp8.h:224
uint8_t pm_profile
Definition audioamp8.h:222
uint8_t pm3_man_sh
Definition audioamp8.h:223
uint8_t pm1_man_sh
Definition audioamp8.h:225
AudioAmp 8 Click power mode configuration object.
Definition audioamp8.h:206
uint8_t mthr_2to3
Definition audioamp8.h:211
uint8_t manual_pm
Definition audioamp8.h:207
uint8_t mthr_3to2
Definition audioamp8.h:212
uint8_t mthr_1to2
Definition audioamp8.h:209
uint8_t mthr_2to1
Definition audioamp8.h:210
uint8_t pm_man
Definition audioamp8.h:208
AudioAmp 8 Click context object.
Definition audioamp8.h:167
digital_out_t ms1
Definition audioamp8.h:172
i2c_master_t i2c
Definition audioamp8.h:175
digital_out_t ms0
Definition audioamp8.h:171
digital_out_t en
Definition audioamp8.h:169
uint8_t slave_address
Definition audioamp8.h:178
digital_out_t mut
Definition audioamp8.h:170