Re: [riot-devel] RIOT and Peripherals

2016-12-21 Thread Peter Kietzmann
Hi Ilias,

I don't know details about the PWM clock generation on this
microcontroller *but* "TCC_CLOCK_PRESCALER_DIV1" means "no division of
the source clock". That will be the case when (compare [1]):

CLOCK_CORECLOCK / (freq * res) = 1 .

Calling the function like this: get_prescaler(1, ), returns 0
(same value as TCC_CTRLA_PRESCALER_DIV1_Val) resulting in no prescaler
selection here [2]. That's why I assume the feature you want should be
already there, or am I mistaken?

In case you convince me of the contrary :-), there's nothing against
improving the peripheral driver implementation.

Best regards
Peter


[1] https://github.com/RIOT-OS/RIOT/blob/master/cpu/samd21/periph/pwm.c#L101
[2] https://github.com/RIOT-OS/RIOT/blob/master/cpu/samd21/periph/pwm.c#L137


Am 12.12.2016 um 14:41 schrieb Ilias Seitanidis:
> Dear all,
> 
> I would like a small explanation of the value
> "TCC_CTRLA_PRESCALER_DIV*_VAL" in line 84 in [1], is it possible to add the
> equivelant value of the "TC_CLOCK_PRESCALER_DIV1"(as found from the atmel
> studio).
> 
> Thank you in advance!
> 
> Best regards,
> 
> Ilias
> 
> [1] https://github.com/RIOT-OS/RIOT/blob/master/cpu/samd21/periph/pwm.c .
> 
> 
> 
> ___
> devel mailing list
> devel@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
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] RIOT and Peripherals

2016-10-07 Thread Peter Kietzmann
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@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
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] RIOT and Peripherals

2016-10-07 Thread Laurent Navet
Hi
> - I didn't find the pwm.c file, maybe someone erased it during a clean up
> operation?
pwm need to be implemented for each supported platform,
here is the sam3 one for example :
https://github.com/RIOT-OS/RIOT/blob/master/cpu/sam3/periph/pwm.c

> -Is there any example of using the pwm lib? (mostly on the sequence of the
> function call)

maybe here :
https://github.com/RIOT-OS/RIOT/blob/master/tests/periph_pwm/main.c

Hope this helps,
Laurent

-- 
« On ne résout pas un problème avec les modes de pensée qui l’ont engendré. »
« You cannot solve current problems with current thinking. Current
problems are the result of current thinking »
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] RIOT and Peripherals

2016-10-04 Thread Peter Kietzmann
Hi Ilias,

what exactly are you looking for? You can find all supported sensors
(and actuators) here:

https://github.com/RIOT-OS/RIOT/tree/master/drivers .

Concerning the speaker you might be interested in the PWM API?

https://github.com/RIOT-OS/RIOT/blob/master/drivers/include/periph/pwm.h

Best regards
Peter

Am 30.09.2016 um 15:06 schrieb Ilias Seitanidis:
> Hello Rioters,
> I am using a samr21 and I want to connect some peripheral devices
> (one motion sensor, its connected to the pin_17 and if there is motion I
> will get an 1 as input, and a speaker, I will create a frequence with the
> osciloscope and then send it to the speaker). Is there any library which
> takes care of these staff?? Any example or any help overall will be
> appreciated. Thank you in advance!
> 
> Your Faithfully,
> Ilias seitanidis
> 
> 
> 
> ___
> devel mailing list
> devel@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
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


[riot-devel] RIOT and Peripherals

2016-09-30 Thread Ilias Seitanidis
Hello Rioters,
I am using a samr21 and I want to connect some peripheral devices
(one motion sensor, its connected to the pin_17 and if there is motion I
will get an 1 as input, and a speaker, I will create a frequence with the
osciloscope and then send it to the speaker). Is there any library which
takes care of these staff?? Any example or any help overall will be
appreciated. Thank you in advance!

Your Faithfully,
Ilias seitanidis
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel