Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
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
Container registry
Model registry
Operate
Environments
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TilCreator
firmware
Commits
7d6c0624
Commit
7d6c0624
authored
5 years ago
by
TilCreator
Browse files
Options
Downloads
Patches
Plain Diff
Add documentation stuff
parent
c5acfa67
No related branches found
No related tags found
No related merge requests found
Pipeline
#3697
passed
5 years ago
Stage: build
Stage: deploy
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
epicardium/epicardium.h
+6
-1
6 additions, 1 deletion
epicardium/epicardium.h
pycardium/modules/py/display.py
+30
-1
30 additions, 1 deletion
pycardium/modules/py/display.py
pycardium/modules/sys_display.c
+1
-0
1 addition, 0 deletions
pycardium/modules/sys_display.c
with
37 additions
and
2 deletions
epicardium/epicardium.h
+
6
−
1
View file @
7d6c0624
...
@@ -1304,8 +1304,13 @@ API(API_DISP_PIXEL,
...
@@ -1304,8 +1304,13 @@ API(API_DISP_PIXEL,
);
);
/**
/**
* Draws pixels on the display
*
* :param data: Image data as byte string: int8 x, int8 y, int16 rgb585, ...
* :param data_length: Amount of pixels in data
* :param offset_x: Offset in x direction of the pixels
* :param offset_y: Offset in y direction of the pixels
*/
*/
API
(
API_DISP_PIXELS
,
API
(
API_DISP_PIXELS
,
int
epic_disp_pixels
(
const
uint8_t
*
data
,
size_t
data_length
,
uint8_t
offset_x
,
uint8_t
offset_y
)
int
epic_disp_pixels
(
const
uint8_t
*
data
,
size_t
data_length
,
uint8_t
offset_x
,
uint8_t
offset_y
)
);
);
...
...
This diff is collapsed.
Click to expand it.
pycardium/modules/py/display.py
+
30
−
1
View file @
7d6c0624
...
@@ -10,6 +10,12 @@ FONT24 = 4
...
@@ -10,6 +10,12 @@ FONT24 = 4
def
get_pixels_size
(
data
):
def
get_pixels_size
(
data
):
"""
Returns (min_x, min_y, max_x, max_y, width, height) from and pixels data byte string
:param data: Image data as byte string: int8 x, int8 y, int16 rgb585, ...
"""
min_x
=
max_x
=
data
[
0
]
min_x
=
max_x
=
data
[
0
]
min_y
=
max_y
=
data
[
1
]
min_y
=
max_y
=
data
[
1
]
...
@@ -136,7 +142,30 @@ class Display:
...
@@ -136,7 +142,30 @@ class Display:
"""
"""
Draws pixels on the display
Draws pixels on the display
:param data: Image data as byte string: int8 x, int8 y, int16 rgb585
:param data: Image data as byte string: int8 x, int8 y, int16 rgb585, ...
:param offset_x: Offset in x direction of the pixels
:param offset_y: Offset in y direction of the pixels
**Example:**
.. code-block:: python
data = b
'
\x00\x00\xF8\x00
'
# |--| x-position: 0
# |--| yposition: 0
# |------| color (rgb565): red
data += b
'
\x05\x00\x07\xE0
'
# |--| x-position: 1
# |--| yposition: 0
# |------| color (rgb565): green
data += b
'
\x02\x0f\x00\x1F
'
# |--| x-position: 2
# |--| yposition: 15
# |------| color (rgb565): blue
with display.open() as d:
d.clear()
d.pixels(data, offset_x=20, offset_y=10)
d.update()
"""
"""
sys_display
.
pixels
(
data
,
offset_x
,
offset_y
)
sys_display
.
pixels
(
data
,
offset_x
,
offset_y
)
...
...
This diff is collapsed.
Click to expand it.
pycardium/modules/sys_display.c
+
1
−
0
View file @
7d6c0624
...
@@ -94,6 +94,7 @@ static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(
...
@@ -94,6 +94,7 @@ static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(
display_pixel_obj
,
3
,
3
,
mp_display_pixel
display_pixel_obj
,
3
,
3
,
mp_display_pixel
);
);
/* draw pixels on the display */
static
mp_obj_t
mp_display_pixels
(
size_t
n_args
,
const
mp_obj_t
*
args
)
static
mp_obj_t
mp_display_pixels
(
size_t
n_args
,
const
mp_obj_t
*
args
)
{
{
uint8_t
offset_x
=
mp_obj_get_int
(
args
[
1
]);
uint8_t
offset_x
=
mp_obj_get_int
(
args
[
1
]);
...
...
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