Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Software for White Rabbit PTP Core
Manage
Activity
Members
Labels
Plan
Issues
39
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
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
Projects
Software for White Rabbit PTP Core
Commits
cad7d202
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
Branches
Branches containing commit
Tags
Tags containing commit
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