This is an elementary question for I2C.

Asked 2 years ago, Updated 2 years ago, 53 views

I'm trying to write a program to change the LED on a device.

I2C address: 0x93

Read Data Format:
Send 0xA0'Read32Byte Array [byArray[32]]
byArray [0]'LED Mode [Mode 0'Mode 1'Mode 2'Mode 3'Mode 4]
byArray[1]'Red
byArray[2]'Green
byArray[3]'Blue
byArray[12]'LED' on/off

Write Data Format:
8Byte Data [byData[8]]
Default 'Switch' LED mode 'Red' Green 'Blue' Default' Default
Example: 0xA00x00x00xFF0x00x00x00x00x04 (=Mode0 Red)

1 stbyte header: 0xA0
2ndbyte: Switch (0x00=LED MODE, 0xFC=ON/OFF MODE)
3rdbyte: If 2nd byte = 0x00, select LED MODE [MODE0(0x00)'MODE1(0x01)'MODE2(0x02)'MODE3(0x03)'MODE4(0x04)]
Else if 2nd byte = 0xFC, select ON/OFF (0x01 ON/0x00 OFF)\
4th-6th:RGB value
7th-8th:reserved, keep 0x00 and 0x04

This is the only information I've been given, but can I write a program with this alone?
What I want to do is change the device LED (how it shines) in the C language in Windows.
If you can write a program with this, could you tell me the sample code?
The device is located on PCI Express.
I know how to use VisualStudio and how to use C/C++.

windows c i2c

2022-09-30 17:46

2 Answers

There is no way to access hardware devices directly from a typical Windows application.Usually, a "device driver" mediates.That's what Device Manager says.

If a Windows application accesses the device driver in the form of Read, Write, or ICTL, the device driver will issue commands to the hardware device.In this case, the application programmer doesn't need to know what I2C does because the device driver absorbs it inside, but he needs information on how to access the driver.

Or what is required now to write a device driver?If that is the case, the difficulty level will increase.I don't think I can explain it in this situation.I need information on how to generate I2C signals.

Let's try to get more detailed information first.It is also necessary to check whether the device driver or application is required to be created.I can't do anything with that explanation.


2022-09-30 17:46

It doesn't seem to work with a regular Intel PC and a regular Windows (Home/Pro).
Windows 10 IoT Core or Windows Enterprise is required.

Enabling User Mode Access to GPIO, I2C, and SPI

RhProxy available on Windows 10 IoT Core and Windows Enterprise The new driver exposes GpioClx and SpbCx resources to user mode.

In Windows 10 IoT Core, I2C
Using I2C on Windows 10 IoT Core

Well, maybe someone who can create a device driver with Windows Driver Kit can.
Here are some other useful information:

Intel Z370-SMBus on PCIe
Industrial PC Requirements to Access GPIO/I2C/SPI...-Annabooks
Windows 10 IoT Enterprise
PCI Express-PALTEK
PALTEK Board Solution


2022-09-30 17:46

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.