forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to use the "sceI2cMasterTransmit" function in

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
realjoeeye1



Joined: 30 Aug 2008
Posts: 20

PostPosted: Sat Mar 07, 2009 5:17 pm    Post subject: How to use the "sceI2cMasterTransmit" function in Reply with quote

Sys:5.00M33
I want to send datas to the I2C bus, so I made an I2Csend.prx and loaded it in my programme to use my functions in kernel mode.The function:

int I2Csend(u8 a,u8 b)
{
u8 param1[4];
param1[0]=a;
param1[1]=b;
int k1 = pspSdkSetK1(0);
int res=sceI2cMasterTransmit(0x42, param1, 2);
pspSdkSetK1(k1);
return res;

}

But when I called this function, my programme recieved an 8002013A err code, what's wrong?
(The pspi2c_driver.a was already there.)
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Sun Mar 08, 2009 6:24 am    Post subject: Reply with quote

That means the library was is not linked. So you must load the .prx file that has sceI2cMasterTransmit() to be able to run that function
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
Dariusc123456



Joined: 12 Aug 2008
Posts: 394

PostPosted: Sun Mar 08, 2009 11:56 am    Post subject: Reply with quote

What prx or library are you loading it from.
Back to top
View user's profile Send private message AIM Address
realjoeeye1



Joined: 30 Aug 2008
Posts: 20

PostPosted: Mon Mar 09, 2009 12:24 am    Post subject: Reply with quote

Dariusc123456 wrote:
What prx or library are you loading it from.

It's in the libpspi2c_driver.a that already in my pspsdk.
Is that means after compile and link, my prx also need to load another prx that contain this function?
Or the function is already linked from libpspi2c_driver.a to my prx?
I found this function in DA's DVE driver decompiled.
Back to top
View user's profile Send private message
realjoeeye1



Joined: 30 Aug 2008
Posts: 20

PostPosted: Mon Mar 09, 2009 2:19 am    Post subject: Reply with quote

!_!
I just bricked my PSP......

I "cut" the clockgen.prx from flash0 to my computer......

Holly shit!
Back to top
View user's profile Send private message
Dariusc123456



Joined: 12 Aug 2008
Posts: 394

PostPosted: Wed Mar 11, 2009 5:02 am    Post subject: Reply with quote

Why are you in the flash? Can you get to the recovery menu?

Try to add to the makefile "LIB = -lpspi2c_driver"?[/url]
Back to top
View user's profile Send private message AIM Address
NoEffex



Joined: 27 Nov 2008
Posts: 108

PostPosted: Wed Mar 11, 2009 4:44 pm    Post subject: Reply with quote

Dariusc123456 wrote:
Why are you in the flash? Can you get to the recovery menu?

Try to add to the makefile "LIB = -lpspi2c_driver"?[/url]
He has the library loaded compiler-side, just not prx-side, similar as if you were to try to make a usb connection with none of the usb modules loaded.

I'd borrow loadstartmodule from psplink and load the module that way(When you figure out which one it is).
_________________
Programming with:
Geany + Latest PSPSDK from svn
Back to top
View user's profile Send private message
realjoeeye1



Joined: 30 Aug 2008
Posts: 20

PostPosted: Thu Mar 12, 2009 12:54 pm    Post subject: Reply with quote

NoEffex wrote:
Dariusc123456 wrote:
Why are you in the flash? Can you get to the recovery menu?

Try to add to the makefile "LIB = -lpspi2c_driver"?[/url]
He has the library loaded compiler-side, just not prx-side, similar as if you were to try to make a usb connection with none of the usb modules loaded.

I'd borrow loadstartmodule from psplink and load the module that way(When you figure out which one it is).


I think it's in the clockgen.prx, so I tried to copy it to my computer and do some test, but I used "cut" instead "copy" so my PSP is bricked......

(My PSP is recovered from brick last night, with help of pandora.)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group