42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_i2c_master.h"
65#define C2X20WAMP_MAP_MIKROBUS( cfg, mikrobus ) \
66 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
67 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
68 cfg.shdn = MIKROBUS( mikrobus, MIKROBUS_RST ); \
69 cfg.mute = MIKROBUS( mikrobus, MIKROBUS_CS ); \
70 cfg.addr1 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
71 cfg.addr2 = MIKROBUS( mikrobus, MIKROBUS_INT );
78#define C2X20WAMP_RETVAL int8_t
81#define C2X20WAMP_INIT_ERROR (-1)
88#define C2X20WAMP_I2C_ADDRESS 0x48
95#define C2X20WAMP_ADDRESS_1 0x01
96#define C2X20WAMP_ADDRESS_2 0x02
103#define C2X20WAMP_6_BIT_VALUE 0x3F
104#define C2X20WAMP_CMD_VOLUME_UP 0xC4
105#define C2X20WAMP_CMD_VOLUME_DOWN 0xC5
106#define C2X20WAMP_CMD_FILTERLESS_MODULATION 0x40
107#define C2X20WAMP_CMD_CLASSIC_PWM_MODULATION 0x41
114#define C2X20WAMP_6_BIT_VALUE 0x3F
318 // End click Driver group
#define C2X20WAMP_RETVAL
Definition c2x20wamp.h:78
void c2x20wamp_enable(c2x20wamp_t *ctx)
Enable the amplifier function.
void c2x20wamp_disable(c2x20wamp_t *ctx)
Disable the amplifier function.
C2X20WAMP_RETVAL c2x20wamp_init(c2x20wamp_t *ctx, c2x20wamp_cfg_t *cfg)
Initialization function.
void c2x20wamp_set_volume(c2x20wamp_t *ctx, uint8_t volume)
Set volume of the amplifier function.
void c2x20wamp_mode_mute(c2x20wamp_t *ctx)
Set Mute mode of the amplifier function.
void c2x20wamp_volume_up(c2x20wamp_t *ctx)
Increase the volume by one level function.
void c2x20wamp_filterless_modulation(c2x20wamp_t *ctx)
Set filterless output modulation function.
void c2x20wamp_generic_write(c2x20wamp_t *ctx, uint8_t data_buf)
Generic write function.
void c2x20wamp_volume_down(c2x20wamp_t *ctx)
Decrease the volume by one level function.
void c2x20wamp_mode_play(c2x20wamp_t *ctx)
Set Play mode of the amplifier function.
void c2x20wamp_cfg_setup(c2x20wamp_cfg_t *cfg)
Config Object Initialization function.
void c2x20wamp_classic_pwm_modulation(c2x20wamp_t *ctx)
Set classic PWM output modulation function.
Click configuration structure definition.
Definition c2x20wamp.h:153
uint32_t i2c_speed
Definition c2x20wamp.h:168
pin_name_t addr2
Definition c2x20wamp.h:164
pin_name_t addr1
Definition c2x20wamp.h:163
pin_name_t shdn
Definition c2x20wamp.h:161
pin_name_t scl
Definition c2x20wamp.h:156
pin_name_t sda
Definition c2x20wamp.h:157
pin_name_t mute
Definition c2x20wamp.h:162
uint8_t i2c_address
Definition c2x20wamp.h:169
Click ctx object definition.
Definition c2x20wamp.h:128
digital_out_t shdn
Definition c2x20wamp.h:131
digital_out_t mute
Definition c2x20wamp.h:132
i2c_master_t i2c
Definition c2x20wamp.h:141
digital_out_t addr2
Definition c2x20wamp.h:137
uint8_t slave_address
Definition c2x20wamp.h:145
digital_out_t addr1
Definition c2x20wamp.h:136