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
Emilio Corigliano
Skyward Boardcore
Commits
f9523ce6
Commit
f9523ce6
authored
2 years ago
by
EmilioCorigliano
Committed by
Alberto Nidasio
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[I2C] Updated scl/sda pin modes to embed pull-up in f7 driver
parent
894f7125
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/shared/drivers/i2c/I2CDriver-f7.cpp
+4
-4
4 additions, 4 deletions
src/shared/drivers/i2c/I2CDriver-f7.cpp
with
4 additions
and
4 deletions
src/shared/drivers/i2c/I2CDriver-f7.cpp
+
4
−
4
View file @
f9523ce6
...
@@ -356,8 +356,8 @@ I2CDriver::I2CDriver(I2C_TypeDef *i2c, miosix::GpioPin scl, miosix::GpioPin sda)
...
@@ -356,8 +356,8 @@ I2CDriver::I2CDriver(I2C_TypeDef *i2c, miosix::GpioPin scl, miosix::GpioPin sda)
// logical values.
// logical values.
scl
.
alternateFunction
(
I2CConsts
::
I2C_PIN_ALTERNATE_FUNCTION
);
scl
.
alternateFunction
(
I2CConsts
::
I2C_PIN_ALTERNATE_FUNCTION
);
sda
.
alternateFunction
(
I2CConsts
::
I2C_PIN_ALTERNATE_FUNCTION
);
sda
.
alternateFunction
(
I2CConsts
::
I2C_PIN_ALTERNATE_FUNCTION
);
scl
.
mode
(
miosix
::
Mode
::
ALTERNATE_OD
);
scl
.
mode
(
miosix
::
Mode
::
ALTERNATE_OD
_PULL_UP
);
sda
.
mode
(
miosix
::
Mode
::
ALTERNATE_OD
);
sda
.
mode
(
miosix
::
Mode
::
ALTERNATE_OD
_PULL_UP
);
}
}
// Checking that this particular I2C port hasn't been already instantiated
// Checking that this particular I2C port hasn't been already instantiated
...
@@ -642,7 +642,7 @@ void I2CDriver::flushBus()
...
@@ -642,7 +642,7 @@ void I2CDriver::flushBus()
// Recovery from the locked state due to a stuck Slave.
// Recovery from the locked state due to a stuck Slave.
// We bit-bang 16 clocks on the scl line in order to restore pending
// We bit-bang 16 clocks on the scl line in order to restore pending
// packets of the slaves.
// packets of the slaves.
scl
.
mode
(
miosix
::
Mode
::
OPEN_DRAIN
);
scl
.
mode
(
miosix
::
Mode
::
OPEN_DRAIN
_PULL_UP
);
}
}
for
(
size_t
c
=
0
;
c
<
I2CConsts
::
N_SCL_BITBANG
;
c
++
)
for
(
size_t
c
=
0
;
c
<
I2CConsts
::
N_SCL_BITBANG
;
c
++
)
...
@@ -657,7 +657,7 @@ void I2CDriver::flushBus()
...
@@ -657,7 +657,7 @@ void I2CDriver::flushBus()
miosix
::
FastInterruptDisableLock
dLock
;
miosix
::
FastInterruptDisableLock
dLock
;
// We set again the scl pin to the correct Alternate function
// We set again the scl pin to the correct Alternate function
scl
.
mode
(
miosix
::
Mode
::
ALTERNATE_OD
);
scl
.
mode
(
miosix
::
Mode
::
ALTERNATE_OD
_PULL_UP
);
scl
.
alternateFunction
(
I2CConsts
::
I2C_PIN_ALTERNATE_FUNCTION
);
scl
.
alternateFunction
(
I2CConsts
::
I2C_PIN_ALTERNATE_FUNCTION
);
}
}
...
...
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