• Content Count

  • Joined

  • Last visited

About Ribster

  • Rank

Profile Information

  • Gender
  • Location
  • Interests

Recent Profile Visitors

1130 profile views
  1. msev, just try it. Get the pinning out from the orange pi zero and try what works. If you cannot get things to work, you can always provide stuff you tried with examples and then you can be helped in a specific way.
  2. Since it is python on the A20, you can search the web for examples. They do exist. Even in the official python docs. It's not that hard. You can always make a push request for that A20 python repo to add your examples once you figured it out. https://pypi.python.org/pypi/pyA20
  3. So i'm stupid as fuck... Why did i not add the main function.... Got it working! For future reference: test.c file: #include <stdlib.h> #include <stdio.h> #include <time.h> #include "gpio_lib.h" int main(){ int ret; ret = sunxi_gpio_init(); ret = sunxi_gpio_set_cfgpin(SUNXI_GPA(17), SUNXI_GPIO_OUTPUT); while(1) { sunxi_gpio_output(SUNXI_GPA(17), 1); usleep(100000); sunxi_gpio_output(SUNXI_GPA(17), 0); usleep(100000); sunxi_gpio_output(SUNXI_GPA(17), 1); usleep(100000); sunxi_gpio_output(SUNXI_GPA(17), 0); usleep(600000); } } the
  4. Okay great, this is very valuable. I understand the spidev as it gets mounted and you can just use it like a file system. I guess if i want to make a kernel module, i can just address them by bus 0 and bus 1 and use the spi kernel api to move further. Am i right that i need to delete the spidev@0 { compatible = "spidev"; reg = <0x0>; spi-max-frequency = <1000000>; }; part for using it with my own kernel module ? Else it gets mounted to the spidev ? Edit: Too fast. I will need to remove this piece
  5. Yes, i've got the python blinky sketch working. Changed the mapping.h for the correct io and was up and running. i've tried a simple c file, but i've got some errors. Once i get this up and running, i can port it to my kernel module... my test.c #include <stdlib.h> #include <stdio.h> #include "gpio_lib.h" sunxi_gpio_init(); sunxi_gpio_set_cfgpin(SUNXI_GPA(17), SUNXI_GPIO_OUTPUT); while(1) { sunxi_gpio_output(SUNXI_GPA(17), 1); sleep(1); sunxi_gpio_output(SUNXI_GPA(17), 0); sleep(1); } and the shell output root@OPI-3:~/git/orangepi_PC_gpio_pyH3/pyA20/
  6. Update: I found out that the pyA20 library has some interfacing stuff that can be used. Investigating this to get it build in c with gcc so i can make some leds blink. https://github.com/duxingkei33/orangepi_PC_gpio_pyH3
  7. Hey Martin, In a related question, i'm trying to get the GPIO / SPI working with pi zero. I'm used to A13, so have experience with fex. The objective is to move to mainline tho, but it's pretty hard to find good info what steps to take etc. So my question is: for mainline zero GPIO / SPI access in kernel space(preferably) or user space, where can i find good guides / tutorials ? Thanks in advance!
  8. Hey everybody. I'm quite new to allwinner, my first experience was with the A13 (sun4i) from olimex. I wrote a kernel driver for the sunxi kernel, which uses the spi and some GPIO. It talks to an SPI RF chip and works just fine. I want to port my kernel driver for the Orange Pi Zero, but have some issues. My main question is: how do i access the fex file, how do i manipulate the gpio and spi ? In the sun4i there are helper functions in the arch/arm/mach-sun4i/sys_config.c file. #define PIN_DIR(handler,dir) gpio_set_one_pin_io_status(handler, dir, NULL) #define PIN_SET(handler,val