Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

VIA EPIA-M920 SPI and GPI, GPO

Need help with peripherals or devices?
Post Reply
Message
Author
espenbo
Posts: 4
Joined: 2017-04-26 19:46
Has thanked: 2 times

VIA EPIA-M920 SPI and GPI, GPO

#1 Post by espenbo »

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

https://cdn.viaembedded.com/products/do ... 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

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: VIA EPIA-M920 SPI and GPI, GPO

#2 Post by debiman »

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.

espenbo
Posts: 4
Joined: 2017-04-26 19:46
Has thanked: 2 times

Re: VIA EPIA-M920 SPI and GPI, GPO

#3 Post by espenbo »

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_Pe ... erface_Bus

example from rasberry pi.
https://www.raspberrypi.org/documentati ... /README.md
https://learn.sparkfun.com/tutorials/ra ... c-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

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: VIA EPIA-M920 SPI and GPI, GPO

#4 Post by pylkko »

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.

Post Reply