Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Skyward Boardcore
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
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
Giulia Facchi
Skyward Boardcore
Commits
3bacab8b
Commit
3bacab8b
authored
3 years ago
by
Matteo Pignataro
Browse files
Options
Downloads
Patches
Plain Diff
[SX1278] Added stm32f429 support
parent
3b26a893
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+1
-1
1 addition, 1 deletion
CMakeLists.txt
src/tests/drivers/sx1278/test-sx1278-serial.cpp
+14
-14
14 additions, 14 deletions
src/tests/drivers/sx1278/test-sx1278-serial.cpp
with
15 additions
and
15 deletions
CMakeLists.txt
+
1
−
1
View file @
3bacab8b
...
@@ -233,7 +233,7 @@ add_executable(test-sx1278-serial
...
@@ -233,7 +233,7 @@ add_executable(test-sx1278-serial
src/tests/drivers/sx1278/test-sx1278-serial.cpp
src/tests/drivers/sx1278/test-sx1278-serial.cpp
src/tests/drivers/sx1278/test-sx1278-core.cpp
src/tests/drivers/sx1278/test-sx1278-core.cpp
)
)
sbs_target
(
test-sx1278-serial stm32f4
07vg
_stm32f4discovery
)
sbs_target
(
test-sx1278-serial stm32f4
29zi
_stm32f4discovery
)
#-----------------------------------------------------------------------------#
#-----------------------------------------------------------------------------#
# Tests - Sensors #
# Tests - Sensors #
...
...
This diff is collapsed.
Click to expand it.
src/tests/drivers/sx1278/test-sx1278-serial.cpp
+
14
−
14
View file @
3bacab8b
...
@@ -31,17 +31,17 @@
...
@@ -31,17 +31,17 @@
using
namespace
Boardcore
;
using
namespace
Boardcore
;
using
namespace
miosix
;
using
namespace
miosix
;
SPIBus
bus
(
SPI
3
);
SPIBus
bus
(
SPI
4
);
GpioPin
sck
(
GPIO
C
_BASE
,
10
);
GpioPin
sck
(
GPIO
E
_BASE
,
2
);
GpioPin
miso
(
GPIO
C
_BASE
,
11
);
GpioPin
miso
(
GPIO
E
_BASE
,
5
);
GpioPin
mosi
(
GPIO
C
_BASE
,
12
);
GpioPin
mosi
(
GPIO
E
_BASE
,
6
);
GpioPin
cs
(
GPIO
A
_BASE
,
1
);
GpioPin
cs
(
GPIO
C
_BASE
,
1
);
GpioPin
dio
(
GPIO
C
_BASE
,
1
5
);
GpioPin
dio
(
GPIO
F
_BASE
,
1
0
);
SX1278
*
sx1278
=
nullptr
;
SX1278
*
sx1278
=
nullptr
;
void
__attribute__
((
used
))
EXTI1
5
_IRQHandlerImpl
()
void
__attribute__
((
used
))
EXTI1
0
_IRQHandlerImpl
()
{
{
if
(
sx1278
)
if
(
sx1278
)
sx1278
->
handleDioIRQ
();
sx1278
->
handleDioIRQ
();
...
@@ -54,16 +54,16 @@ void initBoard()
...
@@ -54,16 +54,16 @@ void initBoard()
miosix
::
FastInterruptDisableLock
dLock
;
miosix
::
FastInterruptDisableLock
dLock
;
// Enable SPI3
// Enable SPI3
RCC
->
APB
1
ENR
|=
RCC_APB
1
ENR_SPI
3
EN
;
RCC
->
APB
2
ENR
|=
RCC_APB
2
ENR_SPI
4
EN
;
// Enable SPI4 bus
RCC_SYNC
();
RCC_SYNC
();
// Setup SPI pins
// Setup SPI pins
sck
.
mode
(
miosix
::
Mode
::
ALTERNATE
);
sck
.
mode
(
miosix
::
Mode
::
ALTERNATE
);
sck
.
alternateFunction
(
6
);
sck
.
alternateFunction
(
5
);
miso
.
mode
(
miosix
::
Mode
::
ALTERNATE
);
miso
.
mode
(
miosix
::
Mode
::
ALTERNATE
);
miso
.
alternateFunction
(
6
);
miso
.
alternateFunction
(
5
);
mosi
.
mode
(
miosix
::
Mode
::
ALTERNATE
);
mosi
.
mode
(
miosix
::
Mode
::
ALTERNATE
);
mosi
.
alternateFunction
(
6
);
mosi
.
alternateFunction
(
5
);
cs
.
mode
(
miosix
::
Mode
::
OUTPUT
);
cs
.
mode
(
miosix
::
Mode
::
OUTPUT
);
dio
.
mode
(
miosix
::
Mode
::
INPUT
);
dio
.
mode
(
miosix
::
Mode
::
INPUT
);
...
@@ -119,14 +119,14 @@ int main()
...
@@ -119,14 +119,14 @@ int main()
return
-
1
;
return
-
1
;
}
}
printf
(
"
\n
[sx1278] Initialization complete!
\n
"
);
std
::
thread
recv
([]()
{
recvLoop
();
});
std
::
thread
recv
([]()
{
recvLoop
();
});
std
::
thread
send
([]()
{
sendLoop
();
});
std
::
thread
send
([]()
{
sendLoop
();
});
printf
(
"
\n
[sx1278] Initialization complete!
\n
"
);
// God please forgive me
// God please forgive me
// FIXME(davide.mor): ABSOLUTELY fix this
// FIXME(davide.mor): ABSOLUTELY fix this
miosix
::
Thread
::
sleep
(
1
0000
);
miosix
::
Thread
::
sleep
(
2
0000
);
miosix
::
reboot
();
miosix
::
reboot
();
return
0
;
return
0
;
...
...
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