Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wrpc-sw
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor 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
This is an archived project. Repository and other project resources are read-only.
hdl-core-lib
wr-cores
wrpc-sw
Commits
cad7d202
There was an error fetching the commit references. Please try again later.
Commit
cad7d202
authored
12 years ago
by
Grzegorz Daniluk
Browse files
Options
Downloads
Patches
Plain Diff
i2c: add function for probing if given device is connected to the bus
parent
a0dd57c4
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dev/i2c.c
+10
-0
10 additions, 0 deletions
dev/i2c.c
include/i2c.h
+1
-0
1 addition, 0 deletions
include/i2c.h
with
11 additions
and
0 deletions
dev/i2c.c
+
10
−
0
View file @
cad7d202
...
...
@@ -98,6 +98,16 @@ void mi2c_init(uint8_t i2cif)
M_SDA_OUT
(
i2cif
,
1
);
}
uint8_t
mi2c_devprobe
(
uint8_t
i2cif
,
uint8_t
i2c_addr
)
{
uint8_t
ret
;
mi2c_start
(
i2cif
);
ret
=
!
mi2c_put_byte
(
i2cif
,
i2c_addr
<<
1
);
mi2c_stop
(
i2cif
);
return
ret
;
}
//void mi2c_scan(uint8_t i2cif)
//{
// int i;
...
...
This diff is collapsed.
Click to expand it.
include/i2c.h
+
1
−
0
View file @
cad7d202
...
...
@@ -2,6 +2,7 @@
#define __I2C_H
uint8_t
mi2c_devprobe
(
uint8_t
i2cif
,
uint8_t
i2c_addr
);
void
mi2c_init
(
uint8_t
i2cif
);
void
mi2c_start
(
uint8_t
i2cif
);
void
mi2c_repeat_start
(
uint8_t
i2cif
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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