Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
toerb
flow3r firmware
Commits
3c97f9ec
Commit
3c97f9ec
authored
1 year ago
by
dx
Browse files
Options
Downloads
Patches
Plain Diff
audio: add violence (audio_codec_i2c_write)
parent
a5e59148
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
components/badge23/audio.c
+4
-0
4 additions, 0 deletions
components/badge23/audio.c
components/badge23/include/badge23/audio.h
+2
-0
2 additions, 0 deletions
components/badge23/include/badge23/audio.h
usermodule/mp_audio.c
+11
-0
11 additions, 0 deletions
usermodule/mp_audio.c
with
17 additions
and
0 deletions
components/badge23/audio.c
+
4
−
0
View file @
3c97f9ec
...
@@ -100,6 +100,10 @@ static esp_err_t max98091_i2c_write_readback(const uint8_t reg, const uint8_t da
...
@@ -100,6 +100,10 @@ static esp_err_t max98091_i2c_write_readback(const uint8_t reg, const uint8_t da
return
ret
;
return
ret
;
}
}
void
audio_codec_i2c_write
(
const
uint8_t
reg
,
const
uint8_t
data
)
{
max98091_i2c_write_readback
(
reg
,
data
);
}
void
audio_headphones_line_in_set_hardware_thru
(
bool
enable
){
void
audio_headphones_line_in_set_hardware_thru
(
bool
enable
){
max98091_i2c_write_readback
(
0x2B
,
(
1
<<
5
)
|
(
1
<<
4
));
// Enable Headphone Mixer
max98091_i2c_write_readback
(
0x2B
,
(
1
<<
5
)
|
(
1
<<
4
));
// Enable Headphone Mixer
uint8_t
trust_issue
=
enable
?
1
:
0
;
uint8_t
trust_issue
=
enable
?
1
:
0
;
...
...
This diff is collapsed.
Click to expand it.
components/badge23/include/badge23/audio.h
+
2
−
0
View file @
3c97f9ec
...
@@ -163,6 +163,8 @@ float audio_input_thru_get_volume_dB();
...
@@ -163,6 +163,8 @@ float audio_input_thru_get_volume_dB();
void
audio_input_thru_set_mute
(
bool
mute
);
void
audio_input_thru_set_mute
(
bool
mute
);
bool
audio_input_thru_get_mute
();
bool
audio_input_thru_get_mute
();
/* For when you need to add violence */
void
audio_codec_i2c_write
(
const
uint8_t
reg
,
const
uint8_t
data
);
/*
/*
HEADPHONE PORT POLICY
HEADPHONE PORT POLICY
...
...
This diff is collapsed.
Click to expand it.
usermodule/mp_audio.c
+
11
−
0
View file @
3c97f9ec
...
@@ -250,6 +250,15 @@ STATIC mp_obj_t mp_input_thru_get_mute() {
...
@@ -250,6 +250,15 @@ STATIC mp_obj_t mp_input_thru_get_mute() {
STATIC
MP_DEFINE_CONST_FUN_OBJ_0
(
mp_input_thru_get_mute_obj
,
mp_input_thru_get_mute
);
STATIC
MP_DEFINE_CONST_FUN_OBJ_0
(
mp_input_thru_get_mute_obj
,
mp_input_thru_get_mute
);
STATIC
mp_obj_t
mp_codec_i2c_write
(
mp_obj_t
reg_in
,
mp_obj_t
data_in
)
{
uint8_t
reg
=
mp_obj_get_int
(
reg_in
);
uint8_t
data
=
mp_obj_get_int
(
data_in
);
audio_codec_i2c_write
(
reg
,
data
);
return
mp_const_none
;
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_2
(
mp_codec_i2c_write_obj
,
mp_codec_i2c_write
);
STATIC
const
mp_rom_map_elem_t
mp_module_audio_globals_table
[]
=
{
STATIC
const
mp_rom_map_elem_t
mp_module_audio_globals_table
[]
=
{
{
MP_ROM_QSTR
(
MP_QSTR___name__
),
MP_ROM_QSTR
(
MP_QSTR_audio
)
},
{
MP_ROM_QSTR
(
MP_QSTR___name__
),
MP_ROM_QSTR
(
MP_QSTR_audio
)
},
...
@@ -306,6 +315,8 @@ STATIC const mp_rom_map_elem_t mp_module_audio_globals_table[] = {
...
@@ -306,6 +315,8 @@ STATIC const mp_rom_map_elem_t mp_module_audio_globals_table[] = {
{
MP_ROM_QSTR
(
MP_QSTR_input_thru_set_mute
),
MP_ROM_PTR
(
&
mp_input_thru_set_mute_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_input_thru_set_mute
),
MP_ROM_PTR
(
&
mp_input_thru_set_mute_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_input_thru_get_mute
),
MP_ROM_PTR
(
&
mp_input_thru_get_mute_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_input_thru_get_mute
),
MP_ROM_PTR
(
&
mp_input_thru_get_mute_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_codec_i2c_write
),
MP_ROM_PTR
(
&
mp_codec_i2c_write_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_INPUT_SOURCE_NONE
),
MP_ROM_INT
(
AUDIO_INPUT_SOURCE_NONE
)
},
{
MP_ROM_QSTR
(
MP_QSTR_INPUT_SOURCE_NONE
),
MP_ROM_INT
(
AUDIO_INPUT_SOURCE_NONE
)
},
{
MP_ROM_QSTR
(
MP_QSTR_INPUT_SOURCE_LINE_IN
),
MP_ROM_INT
(
AUDIO_INPUT_SOURCE_LINE_IN
)
},
{
MP_ROM_QSTR
(
MP_QSTR_INPUT_SOURCE_LINE_IN
),
MP_ROM_INT
(
AUDIO_INPUT_SOURCE_LINE_IN
)
},
{
MP_ROM_QSTR
(
MP_QSTR_INPUT_SOURCE_HEADSET_MIC
),
MP_ROM_INT
(
AUDIO_INPUT_SOURCE_HEADSET_MIC
)
},
{
MP_ROM_QSTR
(
MP_QSTR_INPUT_SOURCE_HEADSET_MIC
),
MP_ROM_INT
(
AUDIO_INPUT_SOURCE_HEADSET_MIC
)
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment