Go to the documentation of this file.
28 #ifndef HEADPHONEAMP2_H
29 #define HEADPHONEAMP2_H
35 #include "mikrosdk_version.h"
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
47 #include "drv_i2c_master.h"
69 #define HEADPHONEAMP2_VOL_MUTE 0x00
70 #define HEADPHONEAMP2_VOL_LVL_1 0x01
71 #define HEADPHONEAMP2_VOL_LVL_2 0x02
72 #define HEADPHONEAMP2_VOL_LVL_3 0x03
73 #define HEADPHONEAMP2_VOL_LVL_4 0x04
74 #define HEADPHONEAMP2_VOL_LVL_5 0x05
75 #define HEADPHONEAMP2_VOL_LVL_6 0x06
76 #define HEADPHONEAMP2_VOL_LVL_7 0x07
77 #define HEADPHONEAMP2_VOL_LVL_8 0x08
78 #define HEADPHONEAMP2_VOL_LVL_9 0x09
79 #define HEADPHONEAMP2_VOL_LVL_10 0x0A
80 #define HEADPHONEAMP2_VOL_LVL_11 0x0B
81 #define HEADPHONEAMP2_VOL_LVL_12 0x0C
82 #define HEADPHONEAMP2_VOL_LVL_13 0x0D
83 #define HEADPHONEAMP2_VOL_LVL_14 0x0E
84 #define HEADPHONEAMP2_VOL_LVL_MAX 0x0F
91 #define HEADPHONEAMP2_DEVICE_ADDRESS 0x4C
109 #define HEADPHONEAMP2_MAP_MIKROBUS( cfg, mikrobus ) \
110 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
111 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
112 cfg.shd = MIKROBUS( mikrobus, MIKROBUS_PWM )
287 #endif // HEADPHONEAMP2_H
@ HEADPHONEAMP2_ERROR
Definition: headphoneamp2.h:181
err_t headphoneamp2_default_cfg(headphoneamp2_t *ctx)
Headphone AMP 2 default configuration function.
pin_name_t shd
Definition: headphoneamp2.h:143
void headphoneamp2_disable(headphoneamp2_t *ctx)
Headphone AMP 2 disable the device function.
@ HEADPHONEAMP2_CMD_DISABLE
Definition: headphoneamp2.h:156
digital_out_t shd
Definition: headphoneamp2.h:124
uint32_t i2c_speed
Definition: headphoneamp2.h:145
uint8_t i2c_address
Definition: headphoneamp2.h:146
headphoneamp2_cmd_ctrl_value_t bass_max
Definition: headphoneamp2.h:168
Headphone AMP 2 Click command object.
Definition: headphoneamp2.h:166
Headphone AMP 2 Click configuration object.
Definition: headphoneamp2.h:139
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:179
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:155
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:130
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:180
headphoneamp2_cmd_ctrl_value_t gain_max
Definition: headphoneamp2.h:169
pin_name_t scl
Definition: headphoneamp2.h:140
@ HEADPHONEAMP2_CMD_ENABLE
Definition: headphoneamp2.h:157
uint8_t volume
Definition: headphoneamp2.h:170
headphoneamp2_cmd_ctrl_value_t wakes_up
Definition: headphoneamp2.h:167
i2c_master_t i2c
Definition: headphoneamp2.h:127
pin_name_t sda
Definition: headphoneamp2.h:141
Headphone AMP 2 Click context object.
Definition: headphoneamp2.h:122