www.8devices.com
View unanswered posts | View active topics It is currently 22 Sep 2017, 09:57



Reply to topic  [ 26 posts ]  Go to page Previous  1, 2, 3
 Working with SPI, GPIO and I2C 
Author Message
User avatar

Joined: 16 Dec 2011, 14:44
Posts: 105
Location: The Netherlands
Just a little bump. I still have some unanswered questions regarding Carambola and peripherals:

1. Is there a way to find out which driver is using which pin? I'd like to use the SPI pins as GPIO.

2. When can we expect to see the source for mmio? I'd rather see messy code than no code at all :)

3. When will the WIki pages on registers, I2C, SPI, GPIO and I2S be updated?

On a more general level: when can we expect more info on using Carambola to drive peripherals? I'm specifically looking for more basic building blocks: not programs that perform a certain function but things like C libraries or other ways to access Carambola's pins from C, Lua or other languages. This is really what Carambola needs in order to become an even greater success. Look at the Arduino: its popularity is mainly due to the available documentation and example code.

_________________
Nut & Bolt | @nut_n_bolt | Carambola posts on the Nut & Bolt blog


24 Feb 2012, 12:24
Profile
8devices
8devices

Joined: 03 Feb 2012, 19:14
Posts: 5
David wrote:
2. When can we expect to see the source for mmio? I'd rather see messy code than no code at all


MMIO sources are here: https://github.com/8devices/mmio


29 Feb 2012, 13:42
Profile
User avatar

Joined: 16 Dec 2011, 14:44
Posts: 105
Location: The Netherlands
Thanks for sharing. That doesn't look messy at all!

_________________
Nut & Bolt | @nut_n_bolt | Carambola posts on the Nut & Bolt blog


01 Mar 2012, 09:38
Profile

Joined: 04 Feb 2014, 12:56
Posts: 7
Hi, there is an easier way without register fiddling.

just edit your "target/linux/ramips/files/arch/mips/ralink/rt305x/mach-carambola.c"

here is my diff:

Code:
17c17
< #include <linux/spi/spi.h>
---
> // #include <linux/spi/spi.h>
107,114c107,114
< static struct spi_board_info carambola_spi_info[] = {
<    {
<       .bus_num   = 0,
<       .chip_select   = 0,
<       .max_speed_hz   = 0,
<       .modalias   = "spidev",
<    }
< };
---
> // static struct spi_board_info carambola_spi_info[] = {
> //   {
> //      .bus_num   = 0,
> //      .chip_select   = 0,
> //      .max_speed_hz   = 0,
> //      .modalias   = "spidev",
> //   }
> // };
119c119
<           RT305X_GPIO_MODE_I2C);
---
>           RT305X_GPIO_MODE_I2C | RT305X_GPIO_MODE_GPIO);
128c128
<    rt305x_register_spi(carambola_spi_info, ARRAY_SIZE(carambola_spi_info));
---
> //   rt305x_register_spi(carambola_spi_info, ARRAY_SIZE(carambola_spi_info));


I had to "make clean" and rebuild my image.
Now export 1-6 works without problems.


14 Apr 2014, 22:11
Profile

Joined: 04 Feb 2014, 12:56
Posts: 7
Ps: i forgot to mention you have to set "io 0x10000060 0x1f" if you had set "io 0x10000060 0x01" for uart before.


15 Apr 2014, 12:51
Profile

Joined: 27 Feb 2017, 08:38
Posts: 2
As I mentioned before, some I/O pins are shared with other functions. If function is set to GPIO, gpioctl can control them, else function should be switched.


27 Feb 2017, 09:13
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 26 posts ]  Go to page Previous  1, 2, 3

Who is online

Users browsing this forum: Google [Bot]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Protected by Anti-Spam ACP Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.