Foros del Web » Programación para mayores de 30 ;) » Programación General »

MPUSBAPI.DLL (FreeBasic)

Estas en el tema de MPUSBAPI.DLL (FreeBasic) en el foro de Programación General en Foros del Web. Hola! Estoy intentando acceder a la librería MPUSBAPI.DLL (que sirve para poder acceder a los microcontroladores de la serie 18Fxx5x por USB), pero no lo ...
  #1 (permalink)  
Antiguo 31/05/2010, 10:21
 
Fecha de Ingreso: noviembre-2008
Mensajes: 7
Antigüedad: 15 años, 5 meses
Puntos: 0
MPUSBAPI.DLL (FreeBasic)

Hola!

Estoy intentando acceder a la librería MPUSBAPI.DLL (que sirve para poder acceder a los microcontroladores de la serie 18Fxx5x por USB), pero no lo consigo. Sabe alguien cómo poder acceder a ella a través de FreeBasic?

Las funciones más importantes son estas:


* MPUSBOpen
* MPUSBRead
* MPUSBWrite
* MPUSBClose
* MPUSBGetDeviceCount

Os pongo lo que llevo hecho de momento sin resultado satisfactorio:

Código:
Cls

Const MPUS_FAIL = 0
Const MPUSB_SUCCESS = 1
Const MP_WRITE = 0
Const MP_READ = 1
Const MAX_NUM_MPUSB_DEV = 127

Const Vid_Pid = "VID_04D8&PID_000A"
Const Outpipe = "\MCHP_EP3"
Const Inppipe = "\MCHP_EP3"

Dim As UInteger MyInpPipe
Dim As UInteger MyOutPipe

Dim As Integer Count

Dim As Any Ptr hLib

hLib = DylibLoad( "mpusbapi.dll" )
If hLib = 0 Then End

Dim Version As Function () As UInteger
Dim OpenUSB As Function ( ByVal As UInteger, ByVal As String, ByVal As String, ByVal As UInteger, ByVal As UInteger) As Integer
Dim ClosUSB As Function ( ByVal As String ) As Integer
Dim DevCont As Function ( ByVal As String ) As Integer

Version = DyLibSymbol( hLib, "_MPUSBGetDLLVersion" )
OpenUSB = DyLibSymbol( hLib, "_MPUSBOpen" )
ClosUSB = DyLibSymbol( hLib, "_MPUSBClose" )
DevCont = DyLibSymbol( hLib, "_MPUSBGetDeviceCount" )

Count = DevCont(Vid_Pid)

If (Count > 0) Then
MyOutPipe = OpenUSB( 0, Vid_Pid, Outpipe, MP_WRITE, 0 )
MyInpPipe = OpenUSB( 0, Vid_Pid, Inppipe, MP_READ, 0 )
Else
Print "Failed to open data pipes.!"
Sleep
End
EndIf

ClosUSB ( Outpipe )

Sleep

End
  #2 (permalink)  
Antiguo 31/05/2010, 11:58
Avatar de Myakire
Colaborador
 
Fecha de Ingreso: enero-2002
Ubicación: Centro de la república
Mensajes: 8.849
Antigüedad: 22 años, 3 meses
Puntos: 146
Respuesta: MPUSBAPI.DLL (FreeBasic)

Movido desde hardware
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:51.