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
External 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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
q3k
firmware
Commits
8e714cce
Commit
8e714cce
authored
5 years ago
by
q3k
Browse files
Options
Downloads
Plain Diff
Merge branch 'q3k/fb2' into q3k/cube
parents
c1f4afa8
89b33f52
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
epicardium/epicardium.h
+40
-1
40 additions, 1 deletion
epicardium/epicardium.h
epicardium/modules/display.c
+2
-2
2 additions, 2 deletions
epicardium/modules/display.c
with
42 additions
and
3 deletions
epicardium/epicardium.h
+
40
−
1
View file @
8e714cce
...
...
@@ -266,6 +266,37 @@ enum disp_fillstyle {
FILLSTYLE_FILLED
=
1
};
/** Width of display in pixels */
#define DISP_WIDTH 160
/** Height of display in pixels */
#define DISP_HEIGHT 80
/** Raw framebuffer */
struct
disp_framebuffer
{
/**
* The frambuffer stores pixels as RGB565, but byte swapped.
* That is, for every (x, y) coordinate, there are two uint8_ts
* storing 16 bits of pixel data.
*
* **Example: fill framebuffer with red**:
*
* .. code-block:: cpp
*
* struct disp_framebuffer *fb = epic_disp_framebuffer();
* uint16_t red = 0b1111100000000000;
* for (int y = 0; y < DISP_HEIGHT; y++) {
* for (int x = 0; x < DISP_WIDTH; x++) {
* fb->fb[y][x][0] = red & 0xFF;
* fb->fb[y][x][1] = red >> 8;
* }
* }
* epic_disp_update();
*
*/
uint8_t
fb
[
DISP_HEIGHT
][
DISP_WIDTH
][
2
];
};
/**
* Locks the display.
*
...
...
@@ -289,7 +320,6 @@ API(API_DISP_CLOSE, int epic_disp_close());
* to be shown on the display
*/
API
(
API_DISP_UPDATE
,
int
epic_disp_update
());
/**
* Returns the back framebuffer (the display buffer that's currently inactive
* that will be shown after the next call to ``epic_disp_update``.
...
...
@@ -417,6 +447,15 @@ API(API_DISP_CIRC,
uint16_t
pixelsize
)
);
/**
* Returns the back framebuffer (the display buffer that's currently inactive
* that will be shown after the next call to ``epic_disp_update``.
*
* :returns: pointer to a framebuffer
*/
API
(
API_DISP_FRAMEBUFFER
,
struct
disp_framebuffer
*
epic_disp_framebuffer
());
/**
* Start continuous readout of the light sensor. Will read light level
* at preconfigured interval and make it available via `epic_light_sensor_get()`.
...
...
This diff is collapsed.
Click to expand it.
epicardium/modules/display.c
+
2
−
2
View file @
8e714cce
...
...
@@ -125,9 +125,9 @@ int epic_disp_update()
}
}
uint16_t
*
epic_disp_framebuffer
()
struct
disp_framebuffer
*
epic_disp_framebuffer
()
{
return
(
uint16_t
*
)
LCD_Framebuffer
();
return
(
struct
disp_framebuffer
*
)
LCD_Framebuffer
();
}
int
epic_disp_open
()
...
...
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