Class for PWM/ADC PIC16F1824 tibbit control (Tibbit #16, Tibbit #17 and Tibbit #31)  
 More...
#include <pic.h>
|  | 
| void | initPic (const char *socket, PicFreq freq) | 
|  | PIC initialization (call before PIC first usage)  More... 
 | 
|  | 
| void | configurePwm (const char *socket, int channel) | 
|  | Configure PIC as PWM (supported by Tibbit's #16, #17 and #31)  More... 
 | 
|  | 
| void | configureAdc (const char *socket, int channel) | 
|  | Configure PIC as ADC (supported by Tibbit #31)  More... 
 | 
|  | 
| void | startPwm (const char *socket, int channel, int pulse, int period, int prescaler) | 
|  | Start PWM (configurePwm must called before)  More... 
 | 
|  | 
| void | stopPwm (const char *socket, int channel) | 
|  | Stop PWM (initPic or configurePwm must called before)  More... 
 | 
|  | 
| int | getAdcVoltage (const char *socket, int channel) | 
|  | Get ADC voltage (0...4000 mV) (configureAdc must called before)  More... 
 | 
|  | 
Class for PWM/ADC PIC16F1824 tibbit control (Tibbit #16, Tibbit #17 and Tibbit #31) 
- Examples: 
- tibbit16.cpp, tibbit17.cpp, and tibbit31.cpp.
      
        
          | void Pic::configureAdc | ( | const char * | socket, | 
        
          |  |  | int | channel | 
        
          |  | ) |  |  | 
      
 
Configure PIC as ADC (supported by Tibbit #31) 
- Parameters
- 
  
    | socket | I2C bus name (eg: s1, s15) |  | channel | 1, 2, 3 or 4 |  
 
- Examples: 
- tibbit31.cpp.
 
 
      
        
          | void Pic::configurePwm | ( | const char * | socket, | 
        
          |  |  | int | channel | 
        
          |  | ) |  |  | 
      
 
 
      
        
          | int Pic::getAdcVoltage | ( | const char * | socket, | 
        
          |  |  | int | channel | 
        
          |  | ) |  |  | 
      
 
Get ADC voltage (0...4000 mV) (configureAdc must called before) 
- Parameters
- 
  
    | socket | I2C bus name (eg: s1, s15) |  | channel | Channel number (1, 2, 3 or 4) |  
 
- Returns
- Voltage in mV 
- Examples: 
- tibbit31.cpp.
 
 
      
        
          | void Pic::initPic | ( | const char * | socket, | 
        
          |  |  | PicFreq | freq | 
        
          |  | ) |  |  | 
      
 
PIC initialization (call before PIC first usage) 
- Parameters
- 
  
    | socket | I2C bus name (eg: s1, s15) |  | freq | Frequency of internal oscillator for PWM |  
 
- Examples: 
- tibbit16.cpp, tibbit17.cpp, and tibbit31.cpp.
 
 
      
        
          | void Pic::startPwm | ( | const char * | socket, | 
        
          |  |  | int | channel, | 
        
          |  |  | int | pulse, | 
        
          |  |  | int | period, | 
        
          |  |  | int | prescaler | 
        
          |  | ) |  |  | 
      
 
Start PWM (configurePwm must called before) 
- Parameters
- 
  
    | socket | I2C bus name (eg: s1, s15) |  | channel | Channel number (1, 2 or 3) |  | pulse | PWM pulse width is defined as the base frequency clock count (0, 1, 2...1023) |  | period | PWM period is defined as the base frequency clock count (0, 4, 8...1023) |  | prescaler | Prescaler affects the base frequency (the period is multiplied to the prescaler) (1, 4, 16 or 64) |  
 
- Examples: 
- tibbit16.cpp, tibbit17.cpp, and tibbit31.cpp.
 
 
      
        
          | void Pic::stopPwm | ( | const char * | socket, | 
        
          |  |  | int | channel | 
        
          |  | ) |  |  | 
      
 
Stop PWM (initPic or configurePwm must called before) 
- Parameters
- 
  
    | socket | I2C bus name (eg: s1, s15) |  | channel | Channel number (1, 2 or 3) |  
 
- Examples: 
- tibbit16.cpp, tibbit17.cpp, and tibbit31.cpp.
 
 
The documentation for this class was generated from the following file: