For Ubuntu 19.04 Led Instruction; File List; Building; Ec, I2C Definition On Vns Device - Avalue Technology VNS-10W01 Quick Reference Manual

Table of Contents

Advertisement

VNS-10W01

3.3 For Ubuntu 19.04 LED instruction

3.3.1 File list

No
Filename
1
VNS LED Control Quick Guide_v1.0.doc
2
VNS_LED-20181121.zip
3
vns_led

3.3.2 Building

1. Prepare a VNS device with Ubuntu(16.04above) and install complier package(Ex: gcc,
make, c-library).
2. Make a working folder in Ubuntu Ex: app.
3. Unzip VNS_LED.zip to working folder.
4. In working folder, enter "$ make" to complier and it would create execute file "vns_led".
5. Copy "vns_led" to VNS device and set to executable file.
6. Start to test/execute in root right.

3.3.3 EC, I2C Definition on VNS device

Bus Number (on VNS): 0x02
EC I2C Device Address (on VNS): 0x70
EC I2C Read Command: 0x80
EC I2C Write Command: 0x81
LED I2C Device Address (on EC): 0x01
LED Data Address (on LED Device): 0xbc

3.3.4 Operation (vns_led)

Syntax: vns_led <led_id>
Option:
led_id: 0=off, 1=red, 2=green
Sample:
vns_led 1
// light on the RED LED
vns_led 2
// light on the GREEN LED
vns_led 0
// turn off LED
3.3.5 APP & API Introduction (vns_led.c, i2c-dev.h, i2cbusses.h)

3.3.5.1 Open I2C driver

int open_i2c_dev(int i2cbus, char* filename, size_t size, int quiet);
Open i2c driver, and return file handle.
Parameter:
26 VNS-10W01 Quick Reference Guide
Description
Guideline document
Demo app source code
Demo app execution file

Advertisement

Table of Contents
loading

Table of Contents