How to use the "sceI2cMasterTransmit" function in

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
realjoeeye1
Posts: 20
Joined: Sat Aug 30, 2008 10:24 pm

How to use the "sceI2cMasterTransmit" function in

Post by realjoeeye1 »

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.)
Pirata Nervo
Posts: 409
Joined: Tue Oct 09, 2007 4:22 am

Post by Pirata Nervo »

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
Image
Upgrade your PSP
Dariusc123456
Posts: 388
Joined: Tue Aug 12, 2008 12:46 am

Post by Dariusc123456 »

What prx or library are you loading it from.
realjoeeye1
Posts: 20
Joined: Sat Aug 30, 2008 10:24 pm

Post by realjoeeye1 »

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.
realjoeeye1
Posts: 20
Joined: Sat Aug 30, 2008 10:24 pm

Post by realjoeeye1 »

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

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

Holly shit!
Dariusc123456
Posts: 388
Joined: Tue Aug 12, 2008 12:46 am

Post by Dariusc123456 »

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

Try to add to the makefile "LIB = -lpspi2c_driver"?[/url]
NoEffex
Posts: 106
Joined: Thu Nov 27, 2008 6:48 am

Post by NoEffex »

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
realjoeeye1
Posts: 20
Joined: Sat Aug 30, 2008 10:24 pm

Post by realjoeeye1 »

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.)
Post Reply