Go to the documentation of this file.
28 #ifndef HEADPHONEAMP2_H
29 #define HEADPHONEAMP2_H
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 HEADPHONEAMP2_VOL_MUTE 0x00
74 #define HEADPHONEAMP2_VOL_LVL_1 0x01
75 #define HEADPHONEAMP2_VOL_LVL_2 0x02
76 #define HEADPHONEAMP2_VOL_LVL_3 0x03
77 #define HEADPHONEAMP2_VOL_LVL_4 0x04
78 #define HEADPHONEAMP2_VOL_LVL_5 0x05
79 #define HEADPHONEAMP2_VOL_LVL_6 0x06
80 #define HEADPHONEAMP2_VOL_LVL_7 0x07
81 #define HEADPHONEAMP2_VOL_LVL_8 0x08
82 #define HEADPHONEAMP2_VOL_LVL_9 0x09
83 #define HEADPHONEAMP2_VOL_LVL_10 0x0A
84 #define HEADPHONEAMP2_VOL_LVL_11 0x0B
85 #define HEADPHONEAMP2_VOL_LVL_12 0x0C
86 #define HEADPHONEAMP2_VOL_LVL_13 0x0D
87 #define HEADPHONEAMP2_VOL_LVL_14 0x0E
88 #define HEADPHONEAMP2_VOL_LVL_MAX 0x0F
95 #define HEADPHONEAMP2_DEVICE_ADDRESS 0x4C
113 #define HEADPHONEAMP2_MAP_MIKROBUS( cfg, mikrobus ) \
114 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
115 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
116 cfg.shd = MIKROBUS( mikrobus, MIKROBUS_PWM )
291 #endif // HEADPHONEAMP2_H
@ HEADPHONEAMP2_ERROR
Definition: headphoneamp2.h:185
err_t headphoneamp2_default_cfg(headphoneamp2_t *ctx)
Headphone AMP 2 default configuration function.
pin_name_t shd
Definition: headphoneamp2.h:147
void headphoneamp2_disable(headphoneamp2_t *ctx)
Headphone AMP 2 disable the device function.
@ HEADPHONEAMP2_CMD_DISABLE
Definition: headphoneamp2.h:160
digital_out_t shd
Definition: headphoneamp2.h:128
uint32_t i2c_speed
Definition: headphoneamp2.h:149
uint8_t i2c_address
Definition: headphoneamp2.h:150
headphoneamp2_cmd_ctrl_value_t bass_max
Definition: headphoneamp2.h:172
Headphone AMP 2 Click command object.
Definition: headphoneamp2.h:170
Headphone AMP 2 Click configuration object.
Definition: headphoneamp2.h:143
void headphoneamp2_enable(headphoneamp2_t *ctx)
Headphone AMP 2 enable the device function.
headphoneamp2_return_value_t
Headphone AMP 2 Click return value data.
Definition: headphoneamp2.h:183
void headphoneamp2_cfg_setup(headphoneamp2_cfg_t *cfg)
Headphone AMP 2 configuration object setup function.
err_t headphoneamp2_init(headphoneamp2_t *ctx, headphoneamp2_cfg_t *cfg)
Headphone AMP 2 initialization function.
headphoneamp2_cmd_ctrl_value_t
Headphone AMP 2 Click command mode control value data.
Definition: headphoneamp2.h:159
err_t headphoneamp2_write_data(headphoneamp2_t *ctx, uint8_t data_in)
Headphone AMP 2 I2C writing function.
uint8_t slave_address
Definition: headphoneamp2.h:134
err_t headphoneamp2_set_command(headphoneamp2_t *ctx, headphoneamp2_cmd_t cmd_ctrl)
Headphone AMP 2 set the command function.
@ HEADPHONEAMP2_OK
Definition: headphoneamp2.h:184
headphoneamp2_cmd_ctrl_value_t gain_max
Definition: headphoneamp2.h:173
pin_name_t scl
Definition: headphoneamp2.h:144
@ HEADPHONEAMP2_CMD_ENABLE
Definition: headphoneamp2.h:161
uint8_t volume
Definition: headphoneamp2.h:174
headphoneamp2_cmd_ctrl_value_t wakes_up
Definition: headphoneamp2.h:171
i2c_master_t i2c
Definition: headphoneamp2.h:131
pin_name_t sda
Definition: headphoneamp2.h:145
Headphone AMP 2 Click context object.
Definition: headphoneamp2.h:126