Page 1 of 1

spi control on L3GD20(gyro) chip.

Posted: Thu Mar 21, 2013 11:33 am
by taisik_ham
Hi everybody,

I am going to share these files to control L3GD20D(gyro) chip. The main.c file includes two tasks, so if someone has stm32f3discovery platform,
you can see the led lamp turn on / turn off in terms of position.

Thanks.

-- taisik tim ham --

Re: spi control on L3GD20(gyro) chip.

Posted: Thu Mar 21, 2013 10:08 pm
by Giovanni
Hi,

I am unable to open the zip file for some reason, please try to replace it.

Giovanni

Re: spi control on L3GD20(gyro) chip.

Posted: Thu Mar 21, 2013 11:51 pm
by Tectu
Giovanni wrote:I am unable to open the zip file for some reason, please try to replace it.


Tectu agrees:

Code: Select all

[tectu@techome stuff]$ unzip -d share share.zip 
Archive:  share.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of share.zip or
        share.zip.zip, and cannot find share.zip.ZIP, period.


The .zip isn't a .zip.


~ Tectu

Re: spi control on L3GD20(gyro) chip.

Posted: Fri Mar 22, 2013 2:25 pm
by taisik_ham
I am sorry, the archive software was megazipper so, it seems to make problem.

I archived tar command again.

Re: spi control on L3GD20(gyro) chip.

Posted: Fri Mar 22, 2013 2:35 pm
by taisik_ham
I missed makefile, If it is beneficial, you can refer it.

Re: spi control on L3GD20(gyro) chip.

Posted: Fri Mar 22, 2013 2:38 pm
by taisik_ham
https://github.com/timham

This is my git repository directory.

Thanks.

-- Tim Taisik Ham --

Re: spi control on L3GD20(gyro) chip.

Posted: Fri Mar 22, 2013 8:46 pm
by taisik_ham
Hi, So I changed ChibiOS/os/hal/STM32/GPIOv2/pal_lld.c void _pal_lld_setgroupmode function changed by myself.

It is better to inspect throughly. it was reorganized based on ST source.

--- Tim Taisik Ham ---

I am wondering how to be tested. Because I cannot find out the usage anywhere.

Re: spi control on L3GD20(gyro) chip.

Posted: Fri Mar 22, 2013 8:52 pm
by taisik_ham
Hi, So I changed ChibiOS/os/hal/STM32/GPIOv2/pal_lld.c void _pal_lld_setgroupmode function changed by myself.

It is better to inspect throughly. it was reorganized based on ST source.

--- Tim Taisik Ham ---

I am wondering how to be tested. Because I cannot find out the usage anywhere.

Re: spi control on L3GD20(gyro) chip.

Posted: Mon Mar 25, 2013 1:39 pm
by utzig
Hi Tim,

You should really create a clean archive file before sending it for contribution!

The share1.tar files contains inside a backup/share.zip which is another tgz file, it also has a tar file name share.tar and the gyro.mak which should be a makefile is actually another tar... what a mess!

Regarding the code there's two things I would like to point:

1) You should not be using the stmlib files (even worse is adding them together with your project). ChibiOS/RT already has the SPI functionality you need in the HAL and you should be using it. This way your driver would work on every architecture that has SPI support.

2) You should not modify the low-level stm32 pal driver for the same reason pointed before. But apart from this, when contributing code to any open source project it's customary to use the Coding Guidelines of the project which exist to maintain a consistent codebase. Your changes to the PAL driver have mixed tabs/spaces and inconsistent code style. This should not happen when contributing code.

Best regards