gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Nintendo DS Wifi Hardware Reference

#59533 - chrissieboy - Wed Nov 02, 2005 2:11 pm

Hi all!

I found this page : http://akkit.org/info/dswifi.htm

But there isn't a library yet i think?

I found in libnds a wifi.h in the arm 7 directory

But there's almost nothing in here :(

Then i saw this :
Code:

0x0304 - POWERCNT - ARM7 Power Control (R/W)
 Bit  Description
  0   Sound Power
  1   Wifi Power
2-15  Unused

Set a bit to '1' to enable power to that system, '0' to disable.


i think this is the hardware adres to put the wifi power on???


then i saw this in the main code :

Code:

POWERCNT |= 2;                                    -- Enable power to the wifi system


so it turns the power on.

So i in my code i made this :
#define POWERCNT 0x0304

but i doesn't know if im doing it right?
In sound.h i saw they define like this :

#define POWERCNT (*(vuint16*)(0x0304))

is this the right way?

Im trying to find documents about how this define works but i really don't understand it, what does vuint16* means??

Can somebody explain me , because i want to try connecting with my computer.

Thanx for your help!

#59535 - Mollusk - Wed Nov 02, 2005 2:33 pm

I think a sort of lib and an API should be out pretty soon, just be patient :)
_________________
PAlib official forum : http://www.palib.info
PAlib official tutorials: http://www.palib.info/wiki
Updates, help, code examples, tutorials, etc...

#59537 - Mighty Max - Wed Nov 02, 2005 2:38 pm

In the meantime, u could add the base to the offset, so you write to the desired address instead of the first few kB at 0x00000000.

The system-hardwarereg base is 0x04000000, the wifi hardwarereg base is 0x04800000 iirc.
_________________
GBAMP Multiboot

#59540 - chrissieboy - Wed Nov 02, 2005 2:51 pm

okay,

but on top at the arm7 System Control Registers stand :

(System Control registers are accessed with a base of 0x04000000)

this is not the wifi i think?

Code:

0x0304 - POWERCNT - ARM7 Power Control (R/W)
 Bit  Description
  0   Sound Power
  1   Wifi Power
2-15  Unused


so i must make this i think :

Code:

#define POWERCNT      (*(vuint16*)0x04000304)


0x04000000 to access the system control register???
and
0x0304 where i can put on the wifi power on the arm7 i think?

and
vuint16 because it's 16 bits?

or am i totally wrong?? it must be this :
Code:

#define POWERCNT      (*(vuint16*)0x04800304)


or even this is totally wrong?

thanx for your help!

#59542 - Mighty Max - Wed Nov 02, 2005 2:59 pm

chrissieboy wrote:
okay,

but on top at the arm7 System Control Registers stand :

(System Control registers are accessed with a base of 0x04000000)

this is not the wifi i think?

Code:

0x0304 - POWERCNT - ARM7 Power Control (R/W)
 Bit  Description
  0   Sound Power
  1   Wifi Power
2-15  Unused


so i must make this i think :

Code:

#define POWERCNT      (*(vuint16*)0x04000304)




That's correct. Remember that this register is ARM7 specific. Doing the same POWERCNT |= 2 on ARM9 will power up "2D Core A Power"
_________________
GBAMP Multiboot

#59544 - chrissieboy - Wed Nov 02, 2005 3:10 pm

sorry for my next stupid question :

(*(vuint16*)0x04000304)

what does (vuint16*) stands for????? 16 bit hex or something?

can't find anything on google about this :(

also never used it but know i want it to know :) !

and the next line on the code :
Code:
 *((volatile u16 *)0x04000206) = 0x30;             -- unclear if this is necessary, or exactly what it does.

gives an error : expected unqualified-id before 'volatile'

sorry but it's al very weird to me :(

thanx for all your help!

#59547 - JaJa - Wed Nov 02, 2005 3:30 pm

Sgstair won't release his libraries until monday at least.
They will then have TCP/IP in them.
He has however done all the documentation, so if anyone felt like writing thier own stack they could.

#59549 - mike260 - Wed Nov 02, 2005 3:35 pm

chrissieboy wrote:

what does (vuint16*) stands for????? 16 bit hex or something?


From libnds's nds/jtypes.h:
Code:

typedef unsigned short int      uint16;
typedef volatile uint16         vuint16;


But be aware that writing your own networking stack will be very, very, very difficult.
_________________
"Ever tried? Ever failed? No matter. Try Again. Fail again. Fail better."
-- Samuel Beckett

#59561 - chrissieboy - Wed Nov 02, 2005 6:14 pm

hmm so i must also make my own tcp/ip ok i'll wait!!

I think im going to learn more advanced c++ i think!

thanx for all your help guys!