cancel
Showing results for 
Search instead for 
Did you mean: 

VD6283 for embedded linux

aab1
Associate

Hi,

 I have downloaded the STSW-IMG302_LNX which has this description "Linux driver for VD6283 6-channel ambient light sensor, with flicker extraction expansion application programming interface (API)", I want to compile this driver for my embedded linux for arm64 platform, I don't know how can I compile it as there are number of files and folders as shown below.

aab1_0-1741187662307.png

The read me doesn't help me either. Do I need to make a module out of it and load that in my embedded linux ? if so then how ? I tried following,

I used aarch64-linux-gcc compiler. What I did was I executed make all which produced the build folder with a number of .o files, then I created an .a archive file out of it using command ar r mylib.a build/*.o and now I am not sure if I am suppose to make a main.c file and use this library when compiling my main.c file. I didn't find any good documentation and README file for the procedure. Following is where my sensor is connected on my embedded linux.

 

 

# i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
# i2cget -y 1 0x20 0x00
0x70
#

 

 

Please advice me.

 

 

 

1 REPLY 1
tfr
ST Employee

Hi aab1,

I’d like to clarify some points about the STSW-IMG302_LNX package and explain how to compile and use it.

1. Overview of the Package

The package provides a userland driver (runs in user space), meaning it is not a kernel module. It includes an adaptation layer to integrate the driver with specific platforms.

2. Compilation

a) make Command Without a Target

When you run make without specifying a target, a brief help message is displayed. For example:

image.png

 

b) make all Command

When you run make all, all the examples provided in the package are compiled. The resulting binaries are placed in the build directory. For example:

image.png

The application are in green.

3. File Structure

The package is organized into the following directories:

  • vd6283_drv:
    Contains the platform-agnostic driver and a high-level library for additional processing, such as calculating lux or correlated color temperature (CCT).

  • utils:
    Includes an FFT library and utility functions to facilitate sensor usage.

  • rpi_platform:
    Provides the platform adaptation layer, specifically for Raspberry Pi. If you are using a different platform (e.g., ARM64), you may need to modify this layer to match your hardware.

  • example:
    Contains usage examples that demonstrate how to interact with the driver.

4. Steps to Use the Driver

  1. Compile the Examples
    Run make all to compile the examples. The binaries will be available in the build directory.

  2. Adapt the Platform Layer
    If you are not using a Raspberry Pi, modify the files in the rpi_platform directory to adapt the communication to your hardware.

  3. Test the Examples
    Deploy the compiled binaries to your embedded Linux platform and test them to verify the sensor functionality.

  4. Create Your Own Application
    Use the examples in the example directory as a reference to write your own application. You can link your application with the libraries provided in the package.

 

I hope this helps you get started. Let me know if you have any questions!