Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
osie
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
osie
Commits
2d6699e8
Commit
2d6699e8
authored
Apr 09, 2024
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Plain Diff
Fixup mod io
See merge request
!40
parents
4e53f19d
0a02dd20
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
255 deletions
+59
-255
coupler/mod_io_i2c.h
coupler/mod_io_i2c.h
+6
-4
coupler/mod_io_opc_ua.h
coupler/mod_io_opc_ua.h
+53
-251
No files found.
coupler/mod_io_i2c.h
View file @
2d6699e8
// global relay state
// global relay state
- XXX: use a list rather than individual variables
uint8_t
I2C_0_RELAYS_STATE
=
0
;
// state of 4 relays at I2C slave 0
uint8_t
I2C_1_RELAYS_STATE
=
0
;
// state of 4 relays at I2C slave 1
...
...
@@ -8,8 +8,11 @@ static char *DEFAULT_I2C_0_ADDR = "0x58";
// the list of attached I2C slaves
const
int
DEFAULT_I2C_SLAVE_ADDR
=
0x58
;
// XXX:code assumes only 8 I2C slaves but it can be up to 127
int
I2C_SLAVE_ADDR_LIST
[]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
// the current architecture of LIME2 supports up to 127 MOD-IO I2C slaves
int
I2C_SLAVE_ADDR_LIST
[
127
]
=
{
0
};
// the number of physical relays
int
DEFAULT_RELAY_COUNT
=
4
;
// the block device at host machine
static
char
*
DEFAULT_I2C_BLOCK_DEVICE_NAME
=
"/dev/i2c-1"
;
...
...
@@ -173,7 +176,6 @@ static int getAnalogInputStateAIN(int i2c_addr, int **analog_input, uint8_t read
}
// step 3: write command over I2c
//__u8 read_reg = 0x30; /* Device register to access */
char
read_buf
[
10
];
read_buf
[
0
]
=
read_reg
;
if
(
write
(
file
,
read_buf
,
1
)
!=
1
)
...
...
coupler/mod_io_opc_ua.h
View file @
2d6699e8
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment