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
663c22a6
Commit
663c22a6
authored
5 years ago
by
q3k
Browse files
Options
Downloads
Patches
Plain Diff
code style
parent
5f851420
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#1553
passed
5 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
epicardium/modules/display.c
+1
-1
1 addition, 1 deletion
epicardium/modules/display.c
lib/gfx/GUI_DEV/DEV_Config.c
+72
-65
72 additions, 65 deletions
lib/gfx/GUI_DEV/DEV_Config.c
lib/gfx/LCD/LCD_Driver.c
+11
-10
11 additions, 10 deletions
lib/gfx/LCD/LCD_Driver.c
with
84 additions
and
76 deletions
epicardium/modules/display.c
+
1
−
1
View file @
663c22a6
...
...
@@ -127,7 +127,7 @@ int epic_disp_update()
struct
disp_framebuffer
*
epic_disp_framebuffer
()
{
return
(
struct
disp_framebuffer
*
)
LCD_Framebuffer
();
return
(
struct
disp_framebuffer
*
)
LCD_Framebuffer
();
}
int
epic_disp_open
()
...
...
This diff is collapsed.
Click to expand it.
lib/gfx/GUI_DEV/DEV_Config.c
+
72
−
65
View file @
663c22a6
/*****************************************************************************
* | File : DEV_Config.c
* | Author : Waveshare team
* | Function : Hardware underlying interface
* | Info :
* Used to shield the underlying layers of each master
* and enhance portability
*----------------
* | This version: V1.0
* | Date : 2018-11-22
* | Info :
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#include
"DEV_Config.h"
#include
"spi.h"
#define SPI SPI2
//const gpio_cfg_t DEV_CS_PIN = {PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE};
//const gpio_cfg_t DEV_BL_PIN = {PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE};
static
spi_req_t
req
=
{.
rx_data
=
NULL
,
.
bits
=
8
,
.
width
=
SPI17Y_WIDTH_1
,
.
ssel
=
0
,
.
deass
=
1
,
.
ssel_pol
=
SPI17Y_POL_LOW
,
.
tx_num
=
0
,
.
rx_num
=
0
};
/********************************************************************************/
void
lcd_write_async
(
uint8_t
*
data
,
int
size
,
lcd_write_cb_t
wr_callback
)
{
req
.
tx_data
=
data
;
req
.
len
=
size
;
req
.
callback
=
wr_callback
;
SPI_MasterTransAsync
(
SPI
,
&
req
);
}
void
lcd_write
(
uint8_t
*
data
,
int
size
)
{
req
.
tx_data
=
data
;
req
.
len
=
size
;
SPI_MasterTrans
(
SPI
,
&
req
);
}
void
lcd_irq_init
(
void
)
{
NVIC_EnableIRQ
(
SPI2_IRQn
);
}
void
SPI2_IRQHandler
(
void
)
{
SPI_Handler
(
SPI
);
}
/*****************************************************************************
* | File : DEV_Config.c
* | Author : Waveshare team
* | Function : Hardware underlying interface
* | Info :
* Used to shield the underlying layers of each master
* and enhance portability
*----------------
* | This version: V1.0
* | Date : 2018-11-22
* | Info :
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#include
"DEV_Config.h"
#include
"spi.h"
#define SPI SPI2
//const gpio_cfg_t DEV_CS_PIN = {PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE};
//const gpio_cfg_t DEV_BL_PIN = {PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE};
static
spi_req_t
req
=
{
.
rx_data
=
NULL
,
.
bits
=
8
,
.
width
=
SPI17Y_WIDTH_1
,
.
ssel
=
0
,
.
deass
=
1
,
.
ssel_pol
=
SPI17Y_POL_LOW
,
.
tx_num
=
0
,
.
rx_num
=
0
};
/********************************************************************************/
void
lcd_write_async
(
uint8_t
*
data
,
int
size
,
lcd_write_cb_t
wr_callback
)
{
req
.
tx_data
=
data
;
req
.
len
=
size
;
req
.
callback
=
wr_callback
;
SPI_MasterTransAsync
(
SPI
,
&
req
);
}
void
lcd_write
(
uint8_t
*
data
,
int
size
)
{
req
.
tx_data
=
data
;
req
.
len
=
size
;
SPI_MasterTrans
(
SPI
,
&
req
);
}
void
lcd_irq_init
(
void
)
{
NVIC_EnableIRQ
(
SPI2_IRQn
);
}
void
SPI2_IRQHandler
(
void
)
{
SPI_Handler
(
SPI
);
}
This diff is collapsed.
Click to expand it.
lib/gfx/LCD/LCD_Driver.c
+
11
−
10
View file @
663c22a6
...
...
@@ -37,12 +37,12 @@ static uint8_t update_in_progress;
static
inline
frame_t
*
frame
(
void
)
{
return
&
frames
[
active_frame
];
return
&
frames
[
active_frame
];
}
static
void
update_cb
(
void
*
spi_req
,
int
error_code
)
{
update_in_progress
=
0
;
update_in_progress
=
0
;
}
/*******************************************************************************
...
...
@@ -322,20 +322,21 @@ static void LCD_Set(uint8_t *data, int len)
{
LCD_SetCursor
(
0
,
0
,
160
-
1
,
80
-
1
);
DEV_Digital_Write
(
DEV_DC_PIN
,
1
);
update_in_progress
=
1
;
lcd_write_async
(
data
,
len
,
update_cb
);
update_in_progress
=
1
;
lcd_write_async
(
data
,
len
,
update_cb
);
}
int
LCD_Update
(
void
)
{
if
(
update_in_progress
)
return
1
;
if
(
update_in_progress
)
return
1
;
LCD_Set
(
frame
()
->
raw
,
FRAME_SIZE
);
active_frame
=
!
active_frame
;
return
0
;
LCD_Set
(
frame
()
->
raw
,
FRAME_SIZE
);
active_frame
=
!
active_frame
;
return
0
;
}
frame_t
*
LCD_Framebuffer
(
void
)
{
frame_t
*
LCD_Framebuffer
(
void
)
{
return
frame
();
}
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