1 #ifndef LIBPROPELLER_PIN_H_ 2 #define LIBPROPELLER_PIN_H_ 5 #define INLINE __attribute__((always_inline)) inline 112 void pwm(
const int decihz,
const bool useCTRA =
true,
Pin * alternatePin = NULL) {
116 const int frq = (decihz * (((1 << 30) / CLKFREQ) << 2)) / 10;
117 int ctr = (0b00101000 << 23) + pinNumber;
119 if(alternatePin != NULL){
120 ctr += alternatePin->getPin() << 9;
121 alternatePin->setOutput();
143 unsigned int pin_mask;
185 return (DIRA & pin_mask) ?
true :
false;
190 return (INA & pin_mask) != 0;
193 INLINE
void libpropeller::Pin::setOutput() {
197 #endif // LIBPROPELLER_PIN_H_
void pwm(const int decihz, const bool useCTRA=true, Pin *alternatePin=NULL)