VIA EPIA-M920 SPI and GPI, GPO

Getting your soundcard to work, using Debian on non-i386 hardware, etc

VIA EPIA-M920 SPI and GPI, GPO

Postby espenbo » 2017-04-26 20:03

Hello.
I'm trying to get SPI and GPI, GPO to work on a VIA EPIA-M920.

https://cdn.viaembedded.com/products/docs/epia-m920/user_manual/UM_EPIA-M920_v206_161117.pdf
http://www.viatech.com/en/boards/mini-itx/epia-m920/

I found some information in the kernel driver database, but I can't find any prebuild modul. CONFIG_GPIO_VX855: VIA VX855/VX875 GPIO.

Must I build a new kernel or is there a way to just build thise module? Does anybody have some linkes or ideas on what to search on. I don't find much on VIA mainboards :(

On the raspberry pi I find a lot of info but it don't seem to work on the via board:(

Thanks
Espen
espenbo
 
Posts: 2
Joined: 2017-04-26 19:46

Re: VIA EPIA-M920 SPI and GPI, GPO

Postby debiman » 2017-04-27 05:42

espenbo wrote:I'm trying to get SPI and GPI, GPO to work on a VIA EPIA-M920.

i'm sorry, we're all very stupid here and you must really explain what all this is.
User avatar
debiman
 
Posts: 1545
Joined: 2013-03-12 07:18

Re: VIA EPIA-M920 SPI and GPI, GPO

Postby espenbo » 2017-04-27 17:18

I will try to exsplain better.

SPI = Serial Peripheral Interface Bus
SPI is a synchronous serial communication interface specification used for short distance communication, primarily in embedded systems.
Can be used to controll small LCD screens, inputs and outputs.
source https://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus

example from rasberry pi.
https://www.raspberrypi.org/documentation/hardware/raspberrypi/spi/README.md
https://learn.sparkfun.com/tutorials/raspberry-pi-spi-and-i2c-tutorial

Digital I/O Pin
Like on the Rasberry PI the VIA EPIA-M920 has digital input and digital output pins.

On the Rasberry Pi I can run 'sudo raspi-config' then go true the meny and start the modules for SPI, I2C and digital inputs and outputs. But on the VIA EPIA-M920 it's not made a easy modul loader program :(
I have tride to send a mail til VIA and ask how to do thise and wiche modules I must use, but I'm still hoping for an replay...
So I was hoping sombody here could help me:)

I found one kernel modul that I think looks promesing. It's the CONFIG_GPIO_VX855: VIA VX855/VX875 GPIO. But It's not compiled as a module in the kernel.
Must I make a new kernel or can I compile only that module? Do you have a nice howto on how to do it :)


Why do i want to do this?
I like to program real inputs / outputs and tempsensors. I going to send som twitter news and cpu usage to the LCD screen, input switches to turn on and off audio. Mabye a nice LED ligth I controll from the digital output.

Espen
espenbo
 
Posts: 2
Joined: 2017-04-26 19:46

Re: VIA EPIA-M920 SPI and GPI, GPO

Postby pylkko » 2017-04-28 06:05

You are failing to be informative. Referring people to Wikipedia articles about different data transfer and bus protocols does not help to understand what your problem is. Please start by providing the output of
Code: Select all
uname -a

and
Code: Select all
lsb_release -a

and
Code: Select all
lsmod

On the mini itx computer.
Then describe the problem in detail. Which part of the chain is not workiing for you? Are you not seeing devices and they not getting addresses? DEscribe the devices, is your LCD using a control board or not? and so on.

Can you see, for example, /sys/class/gpio/export?

Maybe you can even just try to send a signal and use a led or other device to detect it, use something like:
Code: Select all
int theF;
char buf[MAX_BUF];
int gpioNo = XX;

theF = open("/sys/class/gpio/export", O_WRONLY);

sprintf(buf, "%d", gpioNo);

write(theF, buf, strlen(buf));

close(theF);
//Make GPIO an output
sprintf(buf, "/sys/class/gpio/gpio%d/direction", gpioNo);

theF = open(buf, O_WRONLY);

write(theF, "out", 3);

close(theF);

sprintf(buf, "/sys/class/gpio/gpio%d/value", gpioNo);

theF = open(buf, O_WRONLY);

// Set GPIO status to high
write(theF, "1", 1);
close(theF);



or manually from a terminal, change number
Code: Select all
echo out > /sys/class/gpio/gpio21/direction
Code: Select all
echo 1 > /sys/class/gpio/gpio21/value



I didn't even check if that will compile, but the idea is to reserve the pin number, make the pin an output and set it high, and if you have a device that will "do something" with a hight vs a low, the you should notice it. I'm presuming that you know which GPIO's are usable and which are reserved.

I don't know about VIA, but if the config is not in the compiled kernel and you need it, then you have to recompile the kernel. However, if via support a module that can be loaded, then you might be able to just downlaod and load the module on the fly.
User avatar
pylkko
 
Posts: 1180
Joined: 2014-11-06 19:02


Return to Hardware

Who is online

Users browsing this forum: eoandeb and 5 guests

fashionable