Rust package to have full control over GPIO and all the hardware?

OS: Ubuntu Server 20.04
SBC: Rock Pi 4B+

I am making some sort of VR headsets with Rock Pi 4B+, I am having trouble with my LCD which is in this post but I am not for that here. I wanted to code the program with Rust because it is a good start with a simple low-level programming language in my opinion. obviously being a VR headset I need several controls over the hardware like Bluetooth for BLE which is for the indoor position system, GPIO for the sensors, buttons, etc, and control WiFi connection such as choosing a network.

I know it’s weird: I am using a server OS for an application that going to show high-resolution pictures, that is because I honestly don’t know what to go with. I don’t want to use Debian Desktop because I want my program to be the only thing showing things and to be honest I also don’t think Ubuntu Server is suitable for this application.

  • it is fine to use server for HD data transmission. thats what PS does with FreeBSD
  • do you have knowledge of rust ? it is far from simple…
    • if yes, then please follow the os lib documentation.
    • if no, consider using bash script that rust process will run.

I already had a basic knowledge of Rust and made a simple program with Raylib to make a 3D viewer. I will check that out

hm… it doesn’t really have much of features so I might as well just make the program execute the bash script in order to do stuff, GPIOs are still a problem though

the library is basic lib to run Linux/UNIX commands to configure things - all the menu, config and so on you’ll have to do alone. As mentioned in other chat, gaining minimum shell knowledge with suggested links it a must in your case.
regarding gpio - check this out

so after a few trials and errors and finding a solution, I found reading files and executing bash easiest for me. I had control over the programmable GPIOs as I like to call them but now I need to establish I2C communication with MPU9250. according to the Rock Pi GPIO documentation there are 3 I2C pins which is I2C7, I2C6 and I2C2. now apart from I2C 7 and 6, the 2 is weird. it is blue-colored and has CLK instead of SCL. there are no such mentions about the I2C2 so I am just going to ignore it because the MPU9250 uses SDA and SCL. now, how do I actually make the pin act as an I2C? (I wanted to use pin 3 and 5 which is GPIO 71 and 72) or when I export the pin it already starts as I2C?

can you clarify ?
why CLK is weird ?

well I have never really been a lot into these I2C communications so I am only familiar with SDA and SCL, never heard about CLK but well its weird for me but not for people who are knowledgeable into it