42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_i2c_master.h"
66#define EVC_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
75#define EVC_RETVAL uint8_t
78#define EVC_INIT_ERROR 0xFF
85#define EVC_SET_VOLUME_1dB 0x11
86#define EVC_SET_VOLUME_10dB 0x01
87#define EVC_SET_VOLUME_20dB 0x02
88#define EVC_SET_VOLUME_2dB 0x12
89#define EVC_SET_VOLUME_30dB 0x03
90#define EVC_SET_VOLUME_3dB 0x13
91#define EVC_SET_VOLUME_40dB 0x04
92#define EVC_SET_VOLUME_4dB 0x14
93#define EVC_SET_VOLUME_50dB 0x05
94#define EVC_SET_VOLUME_5dB 0x15
95#define EVC_SET_VOLUME_60dB 0x06
96#define EVC_SET_VOLUME_6dB 0x16
97#define EVC_SET_VOLUME_70dB 0x07
98#define EVC_SET_VOLUME_7dB 0x17
99#define EVC_SET_VOLUME_0dB 0x00
100#define EVC_SET_VOLUME_8dB 0x18
101#define EVC_SET_VOLUME_9dB 0x19
108#define EVC_CHANNEL_1 0x80
109#define EVC_CHANNEL_2 0x40
110#define EVC_CHANNEL_3 0x00
111#define EVC_CHANNEL_4 0x20
112#define EVC_CHANNEL_5 0x60
113#define EVC_CHANNEL_6 0xA0
114#define EVC_ALL_CHANNEL 0xC0
121#define EVC_ALL_CHANNEL_MUTE 0xF9
122#define EVC_ALL_CHANNEL_UNMUTE 0xF8
129#define EVC_CLEAR_ALL 0xC0
136#define EVC_DEVICE_SLAVE_ADDRESS_01 0x42
137#define EVC_DEVICE_SLAVE_ADDRESS_00 0x40
138#define EVC_DEVICE_SLAVE_ADDRESS_10 0x44
139#define EVC_DEVICE_SLAVE_ADDRESS_11 0x46
#define EVC_RETVAL
Definition evc.h:75
void evc_set_volume_full(evc_t *ctx, uint8_t channel, int8_t volume)
Set volume for the channel.
void evc_cfg_setup(evc_cfg_t *cfg)
Config Object Initialization function.
EVC_RETVAL evc_init(evc_t *ctx, evc_cfg_t *cfg)
Initialization function.
void evc_generic_write(evc_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
void evc_generic_read(evc_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
void evc_default_cfg(evc_t *ctx)
Click Default Configuration function.
void evc_clear(evc_t *ctx)
Clear register.
void evc_mute(evc_t *ctx, uint8_t mute)
Mute and Unmute.
void evc_set_volume_part(evc_t *ctx, uint8_t channel, uint8_t volume1, uint8_t volume2)
Set volume for the channel.
void mute(evc_t *ctx)
Definition main.c:84
Click configuration structure definition.
Definition evc.h:173
int8_t cfg_volume
Definition evc.h:185
uint8_t cfg_channel
Definition evc.h:186
uint32_t i2c_speed
Definition evc.h:181
pin_name_t scl
Definition evc.h:176
uint8_t play_cfg_flag
Definition evc.h:184
pin_name_t sda
Definition evc.h:177
uint8_t mute_cfg_flag
Definition evc.h:183
uint8_t test_cfg_flag
Definition evc.h:187
uint8_t i2c_address
Definition evc.h:182
Click ctx object definition.
Definition evc.h:153
int8_t volume
Definition evc.h:163
uint8_t test_flag
Definition evc.h:165
uint8_t channel
Definition evc.h:164
i2c_master_t i2c
Definition evc.h:156
uint8_t mute_flag
Definition evc.h:161
uint8_t slave_address
Definition evc.h:160
uint8_t play_flag
Definition evc.h:162