spi control on L3GD20(gyro) chip.

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general. This forum is NOT for support.
Post Reply
taisik_ham
Posts: 7
Joined: Fri Mar 01, 2013 11:58 pm

spi control on L3GD20(gyro) chip.

Post 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 --
Attachments
share.zip
main handling file to control
(42.56 KiB) Downloaded 641 times
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: spi control on L3GD20(gyro) chip.

Post by Giovanni »

Hi,

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

Giovanni
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: spi control on L3GD20(gyro) chip.

Post 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
taisik_ham
Posts: 7
Joined: Fri Mar 01, 2013 11:58 pm

Re: spi control on L3GD20(gyro) chip.

Post by taisik_ham »

I am sorry, the archive software was megazipper so, it seems to make problem.

I archived tar command again.
Attachments
share.tar
(440 KiB) Downloaded 572 times
taisik_ham
Posts: 7
Joined: Fri Mar 01, 2013 11:58 pm

Re: spi control on L3GD20(gyro) chip.

Post by taisik_ham »

I missed makefile, If it is beneficial, you can refer it.
Attachments
share1.tar
(940 KiB) Downloaded 587 times
taisik_ham
Posts: 7
Joined: Fri Mar 01, 2013 11:58 pm

Re: spi control on L3GD20(gyro) chip.

Post by taisik_ham »

https://github.com/timham

This is my git repository directory.

Thanks.

-- Tim Taisik Ham --
taisik_ham
Posts: 7
Joined: Fri Mar 01, 2013 11:58 pm

Re: spi control on L3GD20(gyro) chip.

Post 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.
taisik_ham
Posts: 7
Joined: Fri Mar 01, 2013 11:58 pm

Re: spi control on L3GD20(gyro) chip.

Post 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.
utzig
Posts: 359
Joined: Sat Jan 07, 2012 6:22 pm
Has thanked: 1 time
Been thanked: 20 times

Re: spi control on L3GD20(gyro) chip.

Post 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
Post Reply