[riot-devel] RIOT and Peripherals

Peter Kietzmann peter.kietzmann at haw-hamburg.de
Fri Oct 7 15:49:12 CEST 2016


Hi,

if you are on a samr21-xpro the pwm.c driver implementation can be found
here:

https://github.com/RIOT-OS/RIOT/blob/master/cpu/samd21/periph/pwm.c .

The pin configurations on an Atmel samr21-xpro board are defined here:

https://github.com/RIOT-OS/RIOT/blob/master/boards/samr21-xpro/include/periph_conf.h#L146
.

As Laurent already said, an example lies here:

https://github.com/RIOT-OS/RIOT/tree/master/tests/periph_pwm .

I didn't really understand the question about the "variable dev" but
probably the example will explain everything.

There is no *need* to open a separate thread for the PIR but probably
you want to. Did you already have a look at the PIR example under "tests":

https://github.com/RIOT-OS/RIOT/tree/master/tests/driver_pir ?

Best
Peter


Am 07.10.2016 um 12:58 schrieb Ilias Seitanidis:
> Hi,
> Thanks Peter, The idea is if the pir detects something, then the speaker
> will produce a sound, for example for 2 minutes, then a udp message will be
> sent. I have some questions(as a newbie :) ) :
> - I didn't find the pwm.c file, maybe someone erased it during a clean up
> operation?
> -Is there any example of using the pwm lib? (mostly on the sequence of the
> function call)
> - There is a variable dev that points to the speaker device(as mentioned
> this lib was used with virtual devices), is there a specific integer for
> one device or it doesn't matter?  (
> void pwm_set(pwm_t dev, uint8_t channel, uint16_t value);
> )
> 
> -For the pir Library is it mandatory to register as a thread(?), it will be
> my main thread.
> 
> I've seen the project of Mr.  Nhat Pham, but the main idea is to use the
> RIOT OS as it is.
> Thank you in advance!
> 
> Best regards,
> Ilias
> 
> 
> 
> _______________________________________________
> devel mailing list
> devel at riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel
> 

-- 
Peter Kietzmann

Hamburg University of Applied Sciences
Dept. Informatik, Internet Technologies Group
Berliner Tor 7, 20099 Hamburg, Germany
Fon: +49-40-42875-8426
Web: http://www.haw-hamburg.de/inet


More information about the devel mailing list