From 1018d57318a478c7a2b7bbc71a76c756469f0fa2 Mon Sep 17 00:00:00 2001 From: mightymax Date: Fri, 12 Jan 2007 12:29:38 +0000 Subject: [PATCH] added first BB-chip communication functions --- desmume/src/wifi.c | 29 ++++++++++++++++++++++++++++- desmume/src/wifi.h | 3 +++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/desmume/src/wifi.c b/desmume/src/wifi.c index 3c77be610..966b372a5 100644 --- a/desmume/src/wifi.c +++ b/desmume/src/wifi.c @@ -20,6 +20,12 @@ #include "wifi.h" +/******************************************************************************* + + RF-Chip + + *******************************************************************************/ + void WIFI_resetRF(rffilter_t *rf) { /* reinitialize RF chip with the default values refer RF2958 docs */ /* CFG1 */ @@ -142,7 +148,28 @@ u16 WIFI_getRF_DATA(wifimac_t *wifi, u8 part) u16 WIFI_getRF_STATUS(wifimac_t *wifi) { - return rfIOStatus.val ; + return wifi->rfIOStatus.val ; } +/******************************************************************************* + BB-Chip + + *******************************************************************************/ + +void WIFI_setBB_CNT(wifimac_t *wifi,u16 val) +{ + wifi->bbIOCnt.val = val ; +} + +u8 WIFI_getBB_DATA(wifimac_t *wifi) +{ + if ((wifi->bbIOCnt.bits.mode != 2) || !(wifi->bbIOCnt.bits.enable)) return 0 ; /* not for read or disabled */ + return wifi->BB.data[wifi->bbIOCnt.bits.address] ; +} + +void WIFI_setBB_DATA(wifimac_t *wifi, u8 val) +{ + if ((wifi->bbIOCnt.bits.mode != 1) || !(wifi->bbIOCnt.bits.enable)) return ; /* not for write or disabled */ + wifi->BB.data[wifi->bbIOCnt.bits.address] = val ; +} diff --git a/desmume/src/wifi.h b/desmume/src/wifi.h index 9f77d89a6..d985439a6 100644 --- a/desmume/src/wifi.h +++ b/desmume/src/wifi.h @@ -303,6 +303,9 @@ void WIFI_setRF_DATA(wifimac_t *wifi, u16 val, u8 part) ; u16 WIFI_getRF_DATA(wifimac_t *wifi, u8 part) ; u16 WIFI_getRF_STATUS(wifimac_t *wifi) ; +void WIFI_setBB_CNT(wifimac_t *wifi,u16 val) ; +u8 WIFI_getBB_DATA(wifimac_t *wifi) ; +void WIFI_setBB_DATA(wifimac_t *wifi, u8 val) ; #ifdef __cplusplus }