DSWifi
Typedefs | Functions
dswifi7.h File Reference

ARM7 header of DSWifi. More...

#include "dswifi_version.h"

Typedefs

typedef void(* WifiSyncHandler) (void)
 Wifi Sync Handler function. More...
 

Functions

void installWifiFIFO (void)
 Setup system FIFO handler for WiFi library messages.
 
int PowerChip_ReadWrite (int cmd, int data)
 Reads or writes a value to the DS's power chip. More...
 
void Read_Flash (int address, char *destination, int length)
 Reads an arbitrary amount of data from the firmware flash chip. More...
 
void Wifi_Deinit (void)
 In case it is necessary, this function cuts power to the WiFi system. More...
 
void Wifi_Init (unsigned long WifiData)
 Requires the data returned by the ARM9 WiFi init call. More...
 
void Wifi_Interrupt (void)
 Handler for the ARM7 WiFi interrupt. More...
 
void Wifi_SetSyncHandler (WifiSyncHandler sh)
 Call this function to request notification of when the ARM9-side Wifi_Sync() function should be called. More...
 
void Wifi_Sync (void)
 Call this function when requested to sync by the ARM9 side of the WiFi lib.
 
void Wifi_Update (void)
 Sync function to ensure data continues to flow between the two CPUs smoothly. More...
 

Detailed Description

ARM7 header of DSWifi.

Typedef Documentation

◆ WifiSyncHandler

typedef void(* WifiSyncHandler) (void)

Wifi Sync Handler function.

Callback function that is called when the arm9 needs to be told to synchronize with new fifo data. If this callback is used (see Wifi_SetSyncHandler()), it should send a message via the fifo to the ARM9, which will call Wifi_Sync() on ARM9.

Function Documentation

◆ PowerChip_ReadWrite()

int PowerChip_ReadWrite ( int  cmd,
int  data 
)

Reads or writes a value to the DS's power chip.

Parameters
cmdThe byte-long command to send to the chip (top bit 1=read, 0=write - other bits = register ID to read/write)
dataThe data to write to the chip (if sending a read command, this should be zero)
Returns
The data read returned by the serial connection; only really useful when reading.

◆ Read_Flash()

void Read_Flash ( int  address,
char *  destination,
int  length 
)

Reads an arbitrary amount of data from the firmware flash chip.

Parameters
addressOffset to start reading from in the flash chip.
destinationPointer to a memory buffer to hold incoming data.
lengthThe number of bytes to read.

◆ Wifi_Deinit()

void Wifi_Deinit ( void  )

In case it is necessary, this function cuts power to the WiFi system.

After this WiFi will be unusable until Wifi_Init() is called again.

◆ Wifi_Init()

void Wifi_Init ( unsigned long  WifiData)

Requires the data returned by the ARM9 WiFi init call.

The data returned by the ARM9 init call must be passed to the ARM7 and then given to this function.

This function also enables power to the WiFi system, which will shorten battery life.

Parameters
WifiDataYou must pass the 32bit value returned by the call to Wifi_Init on the ARM9.

◆ Wifi_Interrupt()

void Wifi_Interrupt ( void  )

Handler for the ARM7 WiFi interrupt.

It should be called by the interrupt handler on ARM7, and should not have multiple interrupts enabled.

◆ Wifi_SetSyncHandler()

void Wifi_SetSyncHandler ( WifiSyncHandler  sh)

Call this function to request notification of when the ARM9-side Wifi_Sync() function should be called.

Parameters
shPointer to the function to be called for notification.

◆ Wifi_Update()

void Wifi_Update ( void  )

Sync function to ensure data continues to flow between the two CPUs smoothly.

It Should be called at a periodic interval, such as in VBlank.