Mozzi  version 2015-05-11-20:23
sound synthesis library for Arduino
 All Classes Functions Typedefs Groups
mozzi_utils.h
1 
2 #ifndef UTILS_H_
3 #define UTILS_H_
4 
5 
6 #if ARDUINO >= 100
7  #include "Arduino.h"
8 #else
9  #include "WProgram.h"
10 #endif
11 
12 // macros for setting and clearing register bits
13 #ifndef cbi
14 #define cbi(sfr, bit) (_SFR_UINT8_T(sfr) &= ~_BV(bit))
15 #endif
16 #ifndef sbi
17 #define sbi(sfr, bit) (_SFR_UINT8_T(sfr) |= _BV(bit))
18 #endif
19 
20 
23 inline
25 {
26  DDRB |= B00100000;
27 }
28 
29 
32 inline
34 {
35  PORTB |= B00100000;
36 }
37 
38 
41 inline
43 {
44  PORTB &= B11011111;
45 }
46 
47 
48 long trailingZeros(unsigned long v);
49 unsigned int BPMtoMillis(float bpm);
50 
51 #endif /* UTILS_H_ */
void setPin13Out()
Set digital pin 13 to output for testing timing with an oscilloscope.
Definition: mozzi_utils.h:24
long trailingZeros(unsigned long v)
Given a power of 2, work out the number to shift right by to do a divide by the number, or shift left to multiply.
Definition: mozzi_utils.cpp:8
void setPin13High()
Set pin 13 high for testing timing with an oscilloscope.
Definition: mozzi_utils.h:33
void setPin13Low()
Set pin 13 low for testing timing with an oscilloscope.
Definition: mozzi_utils.h:42