libteak
Loading...
Searching...
No Matches
Macros | Functions
apbp.h File Reference

Host Port Interface (APBP aka HPI) More...

#include <teak/types.h>

Macros

#define REG_APBP_ARM_STAT   (*(vu16 *)0x80D8)
 APBP ARM-side Status (mirror of ARM9 Port 400430Ch) (R)
 
#define REG_APBP_CMD0   (*(vu16 *)0x80C2)
 APBP ARM-to-DSP Command 0 (R)
 
#define REG_APBP_CMD1   (*(vu16 *)0x80C6)
 APBP ARM-to-DSP Command 1 (R)
 
#define REG_APBP_CMD2   (*(vu16 *)0x80CA)
 APBP ARM-to-DSP Command 2 (R)
 
#define REG_APBP_CONTROL   (*(vu16 *)0x80D4)
 APBP Control (R/W)
 
#define REG_APBP_PCLEAR   (*(vu16 *)0x80D0)
 APBP ARM-to-DSP Semaphore Ack Flags (W?)
 
#define REG_APBP_PMASK   (*(vu16 *)0x80CE)
 APBP ARM-to-DSP Semaphore Interrupt Mask (R/W)
 
#define REG_APBP_PSEM   (*(vu16 *)0x80CC)
 APBP DSP-to-ARM Semaphore Set Flags (R/W)
 
#define REG_APBP_REP0   (*(vu16 *)0x80C0)
 APBP DSP-to-ARM Reply 0 (R/W)
 
#define REG_APBP_REP1   (*(vu16 *)0x80C4)
 APBP DSP-to-ARM Reply 1 (R/W)
 
#define REG_APBP_REP2   (*(vu16 *)0x80C8)
 APBP DSP-to-ARM Reply 2 (R/W)
 
#define REG_APBP_SEM   (*(vu16 *)0x80D2)
 APBP ARM-to-DSP Semaphore Get Flags (R)
 
#define REG_APBP_STAT   (*(vu16 *)0x80D6)
 APBP DSP-side Status (R)
 

Functions

static void apbpAckSemaphore (uint16_t mask)
 Clears semaphore bits that the ARM9 has set in REG_DSP_PSEM.
 
static void apbpClearSemaphore (uint16_t mask)
 Clears semaphore flags to be seen by the ARM9 in REG_DSP_SEM.
 
static uint16_t apbpGetSemaphore (void)
 Gets semaphore bits that the ARM9 has set in REG_DSP_PSEM.
 
uint16_t apbpReceiveData (uint16_t id)
 Reads data preent in one of the REG_APBP_REPx registers.
 
void apbpSendData (uint16_t id, uint16_t data)
 Sends data using the REG_APBP_CMDx registers.
 
static void apbpSetSemaphore (uint16_t mask)
 Sets semaphore flags to be seen by the ARM9 in REG_DSP_SEM.
 
static void apbpSetSemaphoreIrqMask (uint16_t mask)
 Masks interrupts caused by ARM-to-DSP semaphores.
 

Detailed Description

Host Port Interface (APBP aka HPI)

Function Documentation

◆ apbpAckSemaphore()

static void apbpAckSemaphore ( uint16_t  mask)
inlinestatic

Clears semaphore bits that the ARM9 has set in REG_DSP_PSEM.

Parameters
maskBits to clear.

◆ apbpClearSemaphore()

static void apbpClearSemaphore ( uint16_t  mask)
inlinestatic

Clears semaphore flags to be seen by the ARM9 in REG_DSP_SEM.

Parameters
maskBits to clear.

◆ apbpGetSemaphore()

static uint16_t apbpGetSemaphore ( void  )
inlinestatic

Gets semaphore bits that the ARM9 has set in REG_DSP_PSEM.

Returns
Bits set by the ARM9 to 1.

◆ apbpReceiveData()

uint16_t apbpReceiveData ( uint16_t  id)

Reads data preent in one of the REG_APBP_REPx registers.

If there isn't any value in the register it will wait until the ARM9 has sent any value.

Parameters
id0 to 2 for REG_APBP_REP0 to REG_APBP_REP2.
Returns
Returns the data in that register.

◆ apbpSendData()

void apbpSendData ( uint16_t  id,
uint16_t  data 
)

Sends data using the REG_APBP_CMDx registers.

If there is alredy a value in that register it will wait until the ARM9 has read it.

Parameters
id0 to 2 for REG_APBP_CMD0 to REG_APBP_CMD2.
dataData to write.

◆ apbpSetSemaphore()

static void apbpSetSemaphore ( uint16_t  mask)
inlinestatic

Sets semaphore flags to be seen by the ARM9 in REG_DSP_SEM.

Parameters
maskBits to set on top of the currently set bits.

◆ apbpSetSemaphoreIrqMask()

static void apbpSetSemaphoreIrqMask ( uint16_t  mask)
inlinestatic

Masks interrupts caused by ARM-to-DSP semaphores.

Parameters
maskBits set to 1 will disable interrupts for that semaphore.