Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
marlin-anet-a8
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
48a581ba
Commit
48a581ba
authored
6 years ago
by
Scott Lahteine
Browse files
Options
Downloads
Patches
Plain Diff
Tweak some HAL Due code
parent
f7d96c5b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_st7920_sw_spi.cpp
+5
-17
5 additions, 17 deletions
Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_st7920_sw_spi.cpp
with
5 additions
and
17 deletions
Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_st7920_sw_spi.cpp
+
5
−
17
View file @
48a581ba
...
@@ -71,8 +71,7 @@ void u8g_SetPIOutput_DUE(u8g_t *u8g, uint8_t pin_index) {
...
@@ -71,8 +71,7 @@ void u8g_SetPIOutput_DUE(u8g_t *u8g, uint8_t pin_index) {
void
u8g_SetPILevel_DUE
(
u8g_t
*
u8g
,
uint8_t
pin_index
,
uint8_t
level
)
{
void
u8g_SetPILevel_DUE
(
u8g_t
*
u8g
,
uint8_t
pin_index
,
uint8_t
level
)
{
volatile
Pio
*
port
=
g_APinDescription
[
u8g
->
pin_list
[
pin_index
]].
pPort
;
volatile
Pio
*
port
=
g_APinDescription
[
u8g
->
pin_list
[
pin_index
]].
pPort
;
uint32_t
mask
=
g_APinDescription
[
u8g
->
pin_list
[
pin_index
]].
ulPin
;
uint32_t
mask
=
g_APinDescription
[
u8g
->
pin_list
[
pin_index
]].
ulPin
;
if
(
level
)
port
->
PIO_SODR
=
mask
;
if
(
level
)
port
->
PIO_SODR
=
mask
;
else
port
->
PIO_CODR
=
mask
;
else
port
->
PIO_CODR
=
mask
;
}
}
Pio
*
SCK_pPio
,
*
MOSI_pPio
;
Pio
*
SCK_pPio
,
*
MOSI_pPio
;
...
@@ -95,26 +94,15 @@ static void spiSend_sw_DUE(uint8_t val) { // 800KHz
...
@@ -95,26 +94,15 @@ static void spiSend_sw_DUE(uint8_t val) { // 800KHz
static
uint8_t
rs_last_state
=
255
;
static
uint8_t
rs_last_state
=
255
;
static
void
u8g_com_DUE_st7920_write_byte_sw_spi
(
uint8_t
rs
,
uint8_t
val
)
{
static
void
u8g_com_DUE_st7920_write_byte_sw_spi
(
uint8_t
rs
,
uint8_t
val
)
{
uint8_t
i
;
if
(
rs
!=
rs_last_state
)
{
// time to send a command/data byte
if
(
rs
!=
rs_last_state
)
{
// time to send a command/data byte
rs_last_state
=
rs
;
rs_last_state
=
rs
;
spiSend_sw_DUE
(
rs
?
0x0FA
:
0x0F8
);
// Command or Data
if
(
rs
==
0
)
/* command */
spiSend_sw_DUE
(
0x0F8
);
else
/* data */
spiSend_sw_DUE
(
0x0FA
);
DELAY_US
(
40
);
// give the controller some time to process the data: 20 is bad, 30 is OK, 40 is safe
DELAY_US
(
40
);
// give the controller some time to process the data: 20 is bad, 30 is OK, 40 is safe
}
}
spiSend_sw_DUE
(
val
&
0x0F0
);
spiSend_sw_DUE
(
val
&
0x0F0
);
spiSend_sw_DUE
(
val
<<
4
);
spiSend_sw_DUE
(
val
<<
4
);
}
}
uint8_t
u8g_com_HAL_DUE_ST7920_sw_spi_fn
(
u8g_t
*
u8g
,
uint8_t
msg
,
uint8_t
arg_val
,
void
*
arg_ptr
)
{
uint8_t
u8g_com_HAL_DUE_ST7920_sw_spi_fn
(
u8g_t
*
u8g
,
uint8_t
msg
,
uint8_t
arg_val
,
void
*
arg_ptr
)
{
switch
(
msg
)
{
switch
(
msg
)
{
case
U8G_COM_MSG_INIT
:
case
U8G_COM_MSG_INIT
:
...
...
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