Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
companion-software
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
CATS
companion-software
Commits
569015f4
Commit
569015f4
authored
11 months ago
by
Stephen D
Browse files
Options
Downloads
Patches
Plain Diff
it works!
parent
406be08f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/keyboard.rs
+0
-2
0 additions, 2 deletions
src/keyboard.rs
src/main.rs
+12
-9
12 additions, 9 deletions
src/main.rs
with
12 additions
and
11 deletions
src/keyboard.rs
+
0
−
2
View file @
569015f4
...
...
@@ -176,8 +176,6 @@ impl<
is_shift_pressed
(
state
),
);
rprint!
(
"{}"
,
keycode
);
}
else
{
rprint!
(
"
\n
({}, {})"
,
x
,
y
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main.rs
+
12
−
9
View file @
569015f4
...
...
@@ -28,7 +28,7 @@ mod app {
text
::{
Baseline
,
Text
},
Drawable
,
};
use
embedded_hal
::
PwmPin
;
use
embedded_hal
::
{
digital
::
v2
::
OutputPin
,
PwmPin
}
;
use
fugit
::
RateExtU32
;
use
hal
::{
gpio
::{
...
...
@@ -36,12 +36,12 @@ mod app {
Gpio0
,
Gpio1
,
Gpio12
,
Gpio13
,
Gpio14
,
Gpio15
,
Gpio16
,
Gpio18
,
Gpio2
,
Gpio23
,
Gpio24
,
Gpio3
,
Gpio4
,
Gpio6
,
Gpio7
,
Gpio8
,
},
FunctionI2C
,
FunctionSio
,
FunctionSpi
,
Pin
,
PullDown
,
PullNone
,
PullUp
,
SioInput
,
SioOutput
,
FunctionI2C
,
FunctionSio
,
FunctionSpi
,
Pin
,
PinState
,
PullDown
,
PullNone
,
PullUp
,
SioInput
,
SioOutput
,
},
pac
::{
I2C1
,
SPI1
},
pwm
::{
self
,
Channel
,
FreeRunning
,
Pwm4
,
Pwm5
,
Slice
},
spi
,
reset
,
spi
,
timer
::{
monotonic
::
Monotonic
,
Timer
},
Clock
,
I2C
,
};
...
...
@@ -49,7 +49,6 @@ mod app {
use
mipidsi
::{
models
::
ST7789
,
Builder
};
use
rp2040_hal
::{
self
as
hal
,
timer
::
Alarm0
};
use
rtic_monotonics
::
rp2040
::
*
;
use
rtt_target
::
rprintln
;
const
XTAL_FREQ_HZ
:
u32
=
12_000_000u32
;
...
...
@@ -171,6 +170,8 @@ mod app {
// let mut vibrator = pins.gpio9.into_push_pull_output();
let
mut
delay
=
Delay
::
new
(
ctx
.core.SYST
,
clocks
.system_clock
.freq
()
.to_Hz
());
// Display backlight
let
mut
pwm
=
pwm_slices
.pwm5
;
pwm
.set_ph_correct
();
...
...
@@ -180,7 +181,9 @@ mod app {
display_bl
.set_inverted
();
let
tp_reset
=
pins
.gpio3
.into_push_pull_output
();
let
disp_reset
=
pins
.gpio4
.into_push_pull_output
();
let
mut
disp_reset
=
pins
.gpio4
.into_push_pull_output_in_state
(
PinState
::
Low
);
delay
.delay_us
(
10
);
disp_reset
.set_high
()
.unwrap
();
// Touchpad
let
sda_pin
:
Pin
<
_
,
FunctionI2C
,
PullUp
>
=
pins
.gpio18
.reconfigure
();
...
...
@@ -226,16 +229,15 @@ mod app {
let
spi
=
spi
.init
(
&
mut
pac
.RESETS
,
clocks
.peripheral_clock
.freq
(),
8
.MHz
(),
60
.MHz
(),
embedded_hal
::
spi
::
MODE_0
,
);
let
spi_cs
=
SPIInterface
::
new
(
spi
,
display_dc
,
display_cs
);
let
mut
delay
=
Delay
::
new
(
ctx
.core.SYST
,
clocks
.system_clock
.freq
()
.to_Hz
());
let
display
=
Builder
::
st7789
(
spi_cs
)
.with_display_size
(
320
,
240
)
.init
(
&
mut
delay
,
Some
(
disp_reset
)
)
.init
(
&
mut
delay
,
None
)
.unwrap
();
display_update
::
spawn
()
.unwrap
();
...
...
@@ -310,6 +312,7 @@ mod app {
*
r
%=
255
;
*
g
%=
255
;
*
b
%=
255
;
display
.clear
(
Rgb565
::
new
(
*
r
,
*
g
,
*
b
))
.unwrap
();
// Draw a smiley face with white eyes and a red mouth
...
...
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