Răsfoiți Sursa

Added Initialize().

woollybah 5 ani în urmă
părinte
comite
2e742cad92
2 a modificat fișierele cu 8 adăugiri și 3 ștergeri
  1. 3 0
      core.mod/gpio/gpiodriver.bmx
  2. 5 3
      pcx857x.mod/pcx857x.bmx

+ 3 - 0
core.mod/gpio/gpiodriver.bmx

@@ -28,6 +28,9 @@ Import "../common.bmx"
 
 Type TGpioDriver Implements IDisposable Abstract
 
+	Method Initialize()
+	End Method
+	
 	Method PinCount:Int() Abstract
 	
 	Method ConvertPinNumberToLogicalNumberingScheme:Int(pinNumber:Int) Abstract

+ 5 - 3
pcx857x.mod/pcx857x.bmx

@@ -28,7 +28,9 @@ Type TPcx857x Extends TGpioDriver
 			End If
 			masterGpioController.OpenPin(interrupt, EpinMode.Input)
 		End If
-		
+	End Method
+	
+	Method Initialize()
 		' These controllers do not have commands, setting the pins to high designates
 		' them as able to recieve input. As we don't want to set high on pins intended
 		' for output we'll set all of the pins to low for our initial state.
@@ -38,7 +40,7 @@ Type TPcx857x Extends TGpioDriver
 			InternalWriteUInt16(0)
 		End If
 		
-		pinModes = $FFFF
+		pinModes = $FFFF	
 	End Method
 	
 	Method ReadByte:Byte()
@@ -198,7 +200,7 @@ End Type
 Rem
 bbdoc: Base class for 8 bit I/O expanders.
 End Rem
-Type TPcx8574 Extends TPcx857x
+Type TPcx8574 Extends TPcx857x Abstract
 
 	Method New(device:TI2cDevice, interrupt:Int = -1, gpioController:TGpioController = Null)
 		Super.New(device, interrupt, gpioController)