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
dos
flow3r firmware
Commits
2dc66484
Commit
2dc66484
authored
1 year ago
by
dx
Committed by
q3k
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
display: expose backlight as hardware.display_set_backlight()
parent
12f478a8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
components/badge23/display.c
+4
-0
4 additions, 0 deletions
components/badge23/display.c
components/badge23/include/badge23/display.h
+1
-0
1 addition, 0 deletions
components/badge23/include/badge23/display.h
usermodule/mp_hardware.c
+8
-0
8 additions, 0 deletions
usermodule/mp_hardware.c
with
13 additions
and
0 deletions
components/badge23/display.c
+
4
−
0
View file @
2dc66484
...
@@ -46,6 +46,10 @@ void display_fill(uint16_t col){
...
@@ -46,6 +46,10 @@ void display_fill(uint16_t col){
GC9A01_FillRect
(
0
,
0
,
240
,
240
,
col
);
GC9A01_FillRect
(
0
,
0
,
240
,
240
,
col
);
}
}
void
display_set_backlight
(
uint8_t
percent
)
{
GC9A01_SetBL
(
percent
);
}
void
display_init
()
{
void
display_init
()
{
GC9A01_Init
();
GC9A01_Init
();
GC9A01_Update
();
GC9A01_Update
();
...
...
This diff is collapsed.
Click to expand it.
components/badge23/include/badge23/display.h
+
1
−
0
View file @
2dc66484
...
@@ -10,5 +10,6 @@ void display_update();
...
@@ -10,5 +10,6 @@ void display_update();
void
display_draw_pixel
(
uint8_t
x
,
uint8_t
y
,
uint16_t
col
);
void
display_draw_pixel
(
uint8_t
x
,
uint8_t
y
,
uint16_t
col
);
uint16_t
display_get_pixel
(
uint8_t
x
,
uint8_t
y
);
uint16_t
display_get_pixel
(
uint8_t
x
,
uint8_t
y
);
void
display_fill
(
uint16_t
col
);
void
display_fill
(
uint16_t
col
);
void
display_set_backlight
(
uint8_t
percent
);
extern
volatile
Ctx
*
the_ctx
;
extern
volatile
Ctx
*
the_ctx
;
This diff is collapsed.
Click to expand it.
usermodule/mp_hardware.c
+
8
−
0
View file @
2dc66484
...
@@ -37,6 +37,13 @@ STATIC mp_obj_t mp_display_update(void) {
...
@@ -37,6 +37,13 @@ STATIC mp_obj_t mp_display_update(void) {
}
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_0
(
mp_display_update_obj
,
mp_display_update
);
STATIC
MP_DEFINE_CONST_FUN_OBJ_0
(
mp_display_update_obj
,
mp_display_update
);
STATIC
mp_obj_t
mp_display_set_backlight
(
mp_obj_t
percent_in
)
{
uint8_t
percent
=
mp_obj_get_int
(
percent_in
);
display_set_backlight
(
percent
);
return
mp_const_none
;
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_1
(
mp_display_set_backlight_obj
,
mp_display_set_backlight
);
STATIC
mp_obj_t
mp_get_captouch
(
size_t
n_args
,
const
mp_obj_t
*
args
)
{
STATIC
mp_obj_t
mp_get_captouch
(
size_t
n_args
,
const
mp_obj_t
*
args
)
{
uint16_t
captouch
=
read_captouch
();
uint16_t
captouch
=
read_captouch
();
uint16_t
pad
=
mp_obj_get_int
(
args
[
0
]);
uint16_t
pad
=
mp_obj_get_int
(
args
[
0
]);
...
@@ -230,6 +237,7 @@ STATIC const mp_rom_map_elem_t mp_module_hardware_globals_table[] = {
...
@@ -230,6 +237,7 @@ STATIC const mp_rom_map_elem_t mp_module_hardware_globals_table[] = {
{
MP_ROM_QSTR
(
MP_QSTR_set_led_hsv
),
MP_ROM_PTR
(
&
mp_set_led_hsv_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_set_led_hsv
),
MP_ROM_PTR
(
&
mp_set_led_hsv_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_update_leds
),
MP_ROM_PTR
(
&
mp_update_leds_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_update_leds
),
MP_ROM_PTR
(
&
mp_update_leds_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_display_update
),
MP_ROM_PTR
(
&
mp_display_update_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_display_update
),
MP_ROM_PTR
(
&
mp_display_update_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_display_set_backlight
),
MP_ROM_PTR
(
&
mp_display_set_backlight_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_version
),
MP_ROM_PTR
(
&
mp_version_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_version
),
MP_ROM_PTR
(
&
mp_version_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_get_ctx
),
MP_ROM_PTR
(
&
mp_get_ctx_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_get_ctx
),
MP_ROM_PTR
(
&
mp_get_ctx_obj
)
},
...
...
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