Skip to content

drivers/nrf24l01+ : added low-level functions for nrf24l01+ transceiver #1704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 26, 2014

Conversation

PeterKietzmann
Copy link
Member

This PR contains multiple low-level functions for the nrf24l01+ driver. Maybe some of them seem useless here but these are interesting when it comes to bind the driver to the general network driver interface, which will be part of another PR soon. Furthermore there are some functions on which I'm not sure if they are necessary. Feel free to discuss :-) !

Depends on #1584 (merged)

@PeterKietzmann PeterKietzmann added State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet Type: new feature The issue requests / The PR implemements a new feature for RIOT labels Sep 24, 2014
include ../Makefile.tests_common

# Change this to 0 show compiler invocation lines by default:
QUIET ?= 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

@haukepetersen
Copy link
Contributor

Looking great! Will test soon.


puts("Init Transceiver\n");

nrf24l01p_init(&NRF24L01P_0, SPI_0, GPIO_8, GPIO_7, GPIO_6);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might make sense to define these externally in the Makefile.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I think the Makefile is maybe not the right place because this seems so unfelxible. Correct me if I'm wrong? A comprise could be the definition of e.g. SPI_PORT, CS_PIN, CE_PIN, IRQ_PIN on top of the script, what do you think?

@LudwigKnuepfer LudwigKnuepfer self-assigned this Sep 25, 2014
char buf_return[num_bytes];
int ret;

vtimer_init();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that you un-disabled auto_init this is unnecessary at best.

@LudwigKnuepfer LudwigKnuepfer added the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Sep 29, 2014
@PeterKietzmann
Copy link
Member Author

I addressed your comments @LudwigOrtmann

@LudwigKnuepfer
Copy link
Member

Travis says:

$ ./dist/tools/licenses/check.sh master
file has an unknown license header: 'tests/nrf24l01_test_lowlevel/main.c'
The command "./dist/tools/licenses/check.sh master" exited with 1.

/* nrf24l01p_t *dev = (nrf24l01p_t*)f;
dev->state = 0;//INT;
*/
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing newline according to git

@LudwigKnuepfer
Copy link
Member

You still need to either use auto_init OR initialize vtimer (possibly more, didn't look).

return 0;
}


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stray blank lines

@haukepetersen
Copy link
Contributor

Could you rebase (now that the SPI driver is merged)? Thx!

@PeterKietzmann PeterKietzmann removed the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Sep 30, 2014
* @ingroup drivers
* @{
*
* @file nrf24l01p.h
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the file name, doxygen is better off without it.

@LudwigKnuepfer LudwigKnuepfer added the Area: drivers Area: Device drivers label Oct 31, 2014
@PeterKietzmann
Copy link
Member Author

I deleted a blocking while loop and added a delay for the "on-air" transmission after the transmit command. This managed the hanging state on the arduino-due. Also it turned out, that SPI_0 and SPI_1 do not behave exactly similar to each other, regarding timings. Therfore I increased the delays DELAY_CS_TOGGLE_TICKS and DELAY_AFTER_FUNC_TICKS just by one tick and it worked.

@PeterKietzmann
Copy link
Member Author

rebased and already squashed

@haukepetersen
Copy link
Contributor

RIOT/drivers/Makefile.include:27: *** missing `endif'. Stop.

Da ist dir in der viert letzten Zeile ein endif verloren gegangen...

@PeterKietzmann
Copy link
Member Author

Uuuuups, I corrected this

@haukepetersen
Copy link
Contributor

No problem. Using and a stm32f4discovery and a stm32f0discovery the test application still crashes. I am not sure, but I suspect the SPI driver for the F0. I will run another test using two stm32f4discoverys once I am back in the office...

@PeterKietzmann
Copy link
Member Author

I once had this setup and it worked. However, I'll also try this in this forenoon.

@PeterKietzmann
Copy link
Member Author

If you look at 0e8bcff I increased a delay value for this code line so the driver also runs on the stm32f0. On the stm32f4 the driver works fine without this change. However, I think we can live with 10 us longer delay and merge this PR but we should be aware that this has nothing to do with #1956 or similar.

@haukepetersen
Copy link
Contributor

Now it works perfectly, very cool! ACK when squashed.

@PeterKietzmann
Copy link
Member Author

Squashed

@haukepetersen
Copy link
Contributor

and go

haukepetersen added a commit that referenced this pull request Nov 26, 2014
drivers/nrf24l01+ : added low-level functions for nrf24l01+ transceiver
@haukepetersen haukepetersen merged commit dfabe77 into RIOT-OS:master Nov 26, 2014
@OlegHahm
Copy link
Member

Hooray!

@OlegHahm OlegHahm removed the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Nov 26, 2014
@BytesGalore
Copy link
Member

Congrats!

@LudwigKnuepfer
Copy link
Member

:)

jnohlgard pushed a commit to jnohlgard/RIOT that referenced this pull request Jan 19, 2015
The delays were introduced in an attempt to fix "inexplicable timing
errors", although the errors were in the SPI bus driver rather than the
nrf24l01p driver.

See also:
 - RIOT-OS#1704
 - RIOT-OS#2315

Signed-off-by: Joakim Gebart <[email protected]>
jnohlgard pushed a commit to jnohlgard/RIOT that referenced this pull request Jan 19, 2015
The delays were introduced in an attempt to fix "inexplicable timing
errors", although the errors were in the SPI bus driver rather than the
nrf24l01p driver.

See also:
 - RIOT-OS#1704
 - RIOT-OS#2315

Signed-off-by: Joakim Gebart <[email protected]>
@PeterKietzmann PeterKietzmann deleted the add_nrf24l01p_lowlevel branch March 26, 2015 08:46
@LudwigKnuepfer
Copy link
Member

This PR contains multiple low-level functions for the nrf24l01+ driver. Maybe some of them seem useless here but these are interesting when it comes to bind the driver to the general network driver interface, which will be part of another PR soon.

@PeterKietzmann It's been a while - any news?

@PeterKietzmann
Copy link
Member Author

Unfortunately not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants