audioamp9 2.1.0.0
audioamp9.h
Go to the documentation of this file.
1/****************************************************************************
2** Copyright (C) 2020 MikroElektronika d.o.o.
3** Contact: https://www.mikroe.com/contact
4**
5** Permission is hereby granted, free of charge, to any person obtaining a copy
6** of this software and associated documentation files (the "Software"), to deal
7** in the Software without restriction, including without limitation the rights
8** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9** copies of the Software, and to permit persons to whom the Software is
10** furnished to do so, subject to the following conditions:
11** The above copyright notice and this permission notice shall be
12** included in all copies or substantial portions of the Software.
13**
14** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
16** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
19** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20** USE OR OTHER DEALINGS IN THE SOFTWARE.
21****************************************************************************/
22
28#ifndef AUDIOAMP9_H
29#define AUDIOAMP9_H
30
31#ifdef __cplusplus
32extern "C"{
33#endif
34
35#include "drv_digital_out.h"
36#include "drv_digital_in.h"
37
48#define AUDIOAMP9_GAIN_LEVEL1 0x01
49#define AUDIOAMP9_GAIN_LEVEL2 0x02
50#define AUDIOAMP9_GAIN_LEVEL3 0x03
51#define AUDIOAMP9_GAIN_LEVEL4 0x04
52 // audioamp9_set
54
69#define AUDIOAMP9_MAP_MIKROBUS( cfg, mikrobus ) \
70 cfg.mut = MIKROBUS( mikrobus, MIKROBUS_AN ); \
71 cfg.shd = MIKROBUS( mikrobus, MIKROBUS_RST ); \
72 cfg.g0 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
73 cfg.g1 = MIKROBUS( mikrobus, MIKROBUS_INT )
74 // audioamp9_map // audioamp9
77
82typedef struct
83{
84 digital_out_t mut;
85 digital_out_t shd;
86 digital_out_t g0;
87 digital_out_t g1;
90
95typedef struct
96{
97 pin_name_t mut;
98 pin_name_t shd;
99 pin_name_t g0;
100 pin_name_t g1;
103
108typedef enum
109{
111 AUDIOAMP9_ERROR = -1
112
114
131
146
158
169
180
191
202
213
224
235
246
259err_t audioamp9_set_gain_level ( audioamp9_t *ctx, uint8_t gain_level );
260
261#ifdef __cplusplus
262}
263#endif
264#endif // AUDIOAMP9_H
265 // audioamp9
267
268// ------------------------------------------------------------------------ END
audioamp9_return_value_t
AudioAmp 9 Click return value data.
Definition: audioamp9.h:109
@ AUDIOAMP9_ERROR
Definition: audioamp9.h:111
@ AUDIOAMP9_OK
Definition: audioamp9.h:110
void audioamp9_shutdown_off(audioamp9_t *ctx)
AudioAmp 9 shutdown off function.
void audioamp9_set_gain2(audioamp9_t *ctx)
AudioAmp 9 set gain level 2 function.
void audioamp9_set_gain1(audioamp9_t *ctx)
AudioAmp 9 set gain level 1 function.
void audioamp9_set_gain4(audioamp9_t *ctx)
AudioAmp 9 set gain level 4 function.
err_t audioamp9_set_gain_level(audioamp9_t *ctx, uint8_t gain_level)
AudioAmp 9 set gain function.
void audioamp9_cfg_setup(audioamp9_cfg_t *cfg)
AudioAmp 9 configuration object setup function.
void audioamp9_shutdown_on(audioamp9_t *ctx)
AudioAmp 9 shutdown on function.
void audioamp9_mute_on(audioamp9_t *ctx)
AudioAmp 9 mute on function.
void audioamp9_default_cfg(audioamp9_t *ctx)
AudioAmp 9 default configuration function.
void audioamp9_set_gain3(audioamp9_t *ctx)
AudioAmp 9 set gain level 3 function.
err_t audioamp9_init(audioamp9_t *ctx, audioamp9_cfg_t *cfg)
AudioAmp 9 initialization function.
void audioamp9_mute_off(audioamp9_t *ctx)
AudioAmp 9 mute off function.
AudioAmp 9 Click configuration object.
Definition: audioamp9.h:96
pin_name_t mut
Definition: audioamp9.h:97
pin_name_t g0
Definition: audioamp9.h:99
pin_name_t shd
Definition: audioamp9.h:98
pin_name_t g1
Definition: audioamp9.h:100
AudioAmp 9 Click context object.
Definition: audioamp9.h:83
digital_out_t g1
Definition: audioamp9.h:87
digital_out_t mut
Definition: audioamp9.h:84
digital_out_t shd
Definition: audioamp9.h:85
digital_out_t g0
Definition: audioamp9.h:86