Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
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
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
6e91ab58
Commit
6e91ab58
authored
7 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
stm32/spi: Further updates to use newer versions of HAL names.
parent
3eb0694b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ports/stm32/spi.c
+25
-25
25 additions, 25 deletions
ports/stm32/spi.c
with
25 additions
and
25 deletions
ports/stm32/spi.c
+
25
−
25
View file @
6e91ab58
...
...
@@ -257,7 +257,7 @@ void spi_init(const spi_t *self, bool enable_nss_pin) {
#endif
pins
[
3
]
=
&
MICROPY_HW_SPI1_MOSI
;
// enable the SPI clock
__SPI1_CLK_ENABLE
();
__
HAL_RCC_
SPI1_CLK_ENABLE
();
#endif
#if defined(MICROPY_HW_SPI2_SCK)
}
else
if
(
spi
->
Instance
==
SPI2
)
{
...
...
@@ -270,7 +270,7 @@ void spi_init(const spi_t *self, bool enable_nss_pin) {
#endif
pins
[
3
]
=
&
MICROPY_HW_SPI2_MOSI
;
// enable the SPI clock
__SPI2_CLK_ENABLE
();
__
HAL_RCC_
SPI2_CLK_ENABLE
();
#endif
#if defined(MICROPY_HW_SPI3_SCK)
}
else
if
(
spi
->
Instance
==
SPI3
)
{
...
...
@@ -283,7 +283,7 @@ void spi_init(const spi_t *self, bool enable_nss_pin) {
#endif
pins
[
3
]
=
&
MICROPY_HW_SPI3_MOSI
;
// enable the SPI clock
__SPI3_CLK_ENABLE
();
__
HAL_RCC_
SPI3_CLK_ENABLE
();
#endif
#if defined(MICROPY_HW_SPI4_SCK)
}
else
if
(
spi
->
Instance
==
SPI4
)
{
...
...
@@ -296,7 +296,7 @@ void spi_init(const spi_t *self, bool enable_nss_pin) {
#endif
pins
[
3
]
=
&
MICROPY_HW_SPI4_MOSI
;
// enable the SPI clock
__SPI4_CLK_ENABLE
();
__
HAL_RCC_
SPI4_CLK_ENABLE
();
#endif
#if defined(MICROPY_HW_SPI5_SCK)
}
else
if
(
spi
->
Instance
==
SPI5
)
{
...
...
@@ -309,7 +309,7 @@ void spi_init(const spi_t *self, bool enable_nss_pin) {
#endif
pins
[
3
]
=
&
MICROPY_HW_SPI5_MOSI
;
// enable the SPI clock
__SPI5_CLK_ENABLE
();
__
HAL_RCC_
SPI5_CLK_ENABLE
();
#endif
#if defined(MICROPY_HW_SPI6_SCK)
}
else
if
(
spi
->
Instance
==
SPI6
)
{
...
...
@@ -322,7 +322,7 @@ void spi_init(const spi_t *self, bool enable_nss_pin) {
#endif
pins
[
3
]
=
&
MICROPY_HW_SPI6_MOSI
;
// enable the SPI clock
__SPI6_CLK_ENABLE
();
__
HAL_RCC_
SPI6_CLK_ENABLE
();
#endif
}
else
{
// SPI does not exist for this board (shouldn't get here, should be checked by caller)
...
...
@@ -361,39 +361,39 @@ void spi_deinit(const spi_t *spi_obj) {
if
(
0
)
{
#if defined(MICROPY_HW_SPI1_SCK)
}
else
if
(
spi
->
Instance
==
SPI1
)
{
__SPI1_FORCE_RESET
();
__SPI1_RELEASE_RESET
();
__SPI1_CLK_DISABLE
();
__
HAL_RCC_
SPI1_FORCE_RESET
();
__
HAL_RCC_
SPI1_RELEASE_RESET
();
__
HAL_RCC_
SPI1_CLK_DISABLE
();
#endif
#if defined(MICROPY_HW_SPI2_SCK)
}
else
if
(
spi
->
Instance
==
SPI2
)
{
__SPI2_FORCE_RESET
();
__SPI2_RELEASE_RESET
();
__SPI2_CLK_DISABLE
();
__
HAL_RCC_
SPI2_FORCE_RESET
();
__
HAL_RCC_
SPI2_RELEASE_RESET
();
__
HAL_RCC_
SPI2_CLK_DISABLE
();
#endif
#if defined(MICROPY_HW_SPI3_SCK)
}
else
if
(
spi
->
Instance
==
SPI3
)
{
__SPI3_FORCE_RESET
();
__SPI3_RELEASE_RESET
();
__SPI3_CLK_DISABLE
();
__
HAL_RCC_
SPI3_FORCE_RESET
();
__
HAL_RCC_
SPI3_RELEASE_RESET
();
__
HAL_RCC_
SPI3_CLK_DISABLE
();
#endif
#if defined(MICROPY_HW_SPI4_SCK)
}
else
if
(
spi
->
Instance
==
SPI4
)
{
__SPI4_FORCE_RESET
();
__SPI4_RELEASE_RESET
();
__SPI4_CLK_DISABLE
();
__
HAL_RCC_
SPI4_FORCE_RESET
();
__
HAL_RCC_
SPI4_RELEASE_RESET
();
__
HAL_RCC_
SPI4_CLK_DISABLE
();
#endif
#if defined(MICROPY_HW_SPI5_SCK)
}
else
if
(
spi
->
Instance
==
SPI5
)
{
__SPI5_FORCE_RESET
();
__SPI5_RELEASE_RESET
();
__SPI5_CLK_DISABLE
();
__
HAL_RCC_
SPI5_FORCE_RESET
();
__
HAL_RCC_
SPI5_RELEASE_RESET
();
__
HAL_RCC_
SPI5_CLK_DISABLE
();
#endif
#if defined(MICROPY_HW_SPI6_SCK)
}
else
if
(
spi
->
Instance
==
SPI6
)
{
__SPI6_FORCE_RESET
();
__SPI6_RELEASE_RESET
();
__SPI6_CLK_DISABLE
();
__
HAL_RCC_
SPI6_FORCE_RESET
();
__
HAL_RCC_
SPI6_RELEASE_RESET
();
__
HAL_RCC_
SPI6_CLK_DISABLE
();
#endif
}
}
...
...
@@ -915,7 +915,7 @@ mp_obj_t machine_hard_spi_make_new(const mp_obj_type_t *type, size_t n_args, siz
// these parameters are not currently configurable
init
->
Direction
=
SPI_DIRECTION_2LINES
;
init
->
NSS
=
SPI_NSS_SOFT
;
init
->
TIMode
=
SPI_TIMODE_DISABLE
D
;
init
->
TIMode
=
SPI_TIMODE_DISABLE
;
init
->
CRCCalculation
=
SPI_CRCCALCULATION_DISABLE
;
init
->
CRCPolynomial
=
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