Charith Dassanayake / CPPToPigpio
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers CPPToPigpio.h Source File

CPPToPigpio.h

00001 #ifndef __CPP_TO_PIGPIO_
00002 #define __CPP_TO_PIGPIO_
00003 #include <stdint.h>
00004 #include <pigpio.h> // include GPIO library
00005 
00006 enum PinName{NC=-1, p0=0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53};
00007 enum PinMode{PullUp=PI_PUD_UP, PullDown=PI_PUD_DOWN, PullNone=PI_PUD_OFF};
00008 
00009 
00010 namespace CPPToPigpio{
00011     
00012     class CPPToPigpio{
00013         private:
00014             static uint32_t _number_active_devices; //Need to track number of devices so that can call gpioInitialise() if making first device
00015         protected:
00016             void _handlePigpioInitialisationIfNeeded();             
00017             void _handlePigpioTermination();
00018             void _setupErrorHandlers();
00019             static void errHandler(int);
00020             static void exitHandler();
00021 
00022     };
00023 
00024 }
00025 #include "DigitalIn.h"
00026 #include "DigitalOut.h"
00027 #include "BusIn.h"
00028 #include "BusOut.h"
00029 #include "PwmOut.h"
00030 #include "I2C.h"
00031 
00032 #endif