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
7e809b4b
Commit
7e809b4b
authored
9 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
esp8266/modpybspi: Configure pins when initialising an SPI object.
parent
68e222af
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
esp8266/modpybspi.c
+6
-0
6 additions, 0 deletions
esp8266/modpybspi.c
with
6 additions
and
0 deletions
esp8266/modpybspi.c
+
6
−
0
View file @
7e809b4b
...
@@ -123,6 +123,12 @@ STATIC void pyb_spi_init_helper(pyb_spi_obj_t *self, size_t n_args, const mp_obj
...
@@ -123,6 +123,12 @@ STATIC void pyb_spi_init_helper(pyb_spi_obj_t *self, size_t n_args, const mp_obj
if
(
args
[
ARG_miso
].
u_obj
!=
MP_OBJ_NULL
)
{
if
(
args
[
ARG_miso
].
u_obj
!=
MP_OBJ_NULL
)
{
self
->
miso
=
mp_hal_get_pin_obj
(
args
[
ARG_miso
].
u_obj
);
self
->
miso
=
mp_hal_get_pin_obj
(
args
[
ARG_miso
].
u_obj
);
}
}
// configure pins
mp_hal_pin_write
(
self
->
sck
,
self
->
polarity
);
mp_hal_pin_output
(
self
->
sck
);
mp_hal_pin_output
(
self
->
mosi
);
mp_hal_pin_input
(
self
->
miso
);
}
}
STATIC
mp_obj_t
pyb_spi_make_new
(
const
mp_obj_type_t
*
type
,
size_t
n_args
,
size_t
n_kw
,
const
mp_obj_t
*
args
)
{
STATIC
mp_obj_t
pyb_spi_make_new
(
const
mp_obj_type_t
*
type
,
size_t
n_args
,
size_t
n_kw
,
const
mp_obj_t
*
args
)
{
...
...
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