libctr9
Nintendo 3DS ARM9 library
ctr_pxi.h File Reference
#include <stdint.h>
#include <stdbool.h>

Go to the source code of this file.

Macros

#define PXI_SYNC9   (*(uint32_t*)0x10008000)
 
#define PXI_CNT9   (*(uint32_t*)0x10008004)
 
#define PXI_SEND9   (*(uint32_t*)0x10008008)
 
#define PXI_RECV9   (*(uint32_t*)0x1000800C)
 

Functions

bool ctr_pxi_send_empty_status (void)
 Checks if the send PXI queue is empty. More...
 
bool ctr_pxi_send_full_status (void)
 Checks if the send PXI queue is full. More...
 
bool ctr_pxi_get_send_empty_irq (void)
 Checks the status of the IRQ for when the send PXI queue is empty. More...
 
void ctr_pxi_set_send_empty_irq (bool state)
 Sets the state of the IRQ for when the send PXI queue is empty. More...
 
void ctr_pxi_fifo_send_clear (void)
 Clears/flushes the send PXI queue. More...
 
bool ctr_pxi_receive_empty_status (void)
 Checks if the receive PXI queue is empty. More...
 
bool ctr_pxi_receive_full_status (void)
 Checks if the receive PXI queue is full. More...
 
bool ctr_pxi_get_receive_not_empty_irq (void)
 Checks the status of the IRQ for when the receive PXI queue is not empty. More...
 
void ctr_pxi_set_receive_not_empty_irq (bool state)
 Sets the state of the IRQ for when the receive PXI queue is not empty. More...
 
void ctr_pxi_set_enabled (bool state)
 Sets the state of the PXI system. More...
 
bool ctr_pxi_get_enabled (void)
 Returns the state of the PXI system. More...
 
void ctr_pxi_fifo_ack (void)
 (FIXME Uncertain, this is most likely wrong) Acknowledge IRQ.
 
bool ctr_pxi_get_error (void)
 Returns the error status of the PXI system. More...
 
bool ctr_pxi_push (uint32_t data)
 Push data into the send PXI queue. More...
 
bool ctr_pxi_pop (uint32_t *data)
 Pops data from the receive PXI queue. More...
 

Function Documentation

void ctr_pxi_fifo_send_clear ( void  )

Clears/flushes the send PXI queue.

Postcondition
Clears/flushes the send PXI queue.
bool ctr_pxi_get_enabled ( void  )

Returns the state of the PXI system.

Returns true if the PXI system is enabled, false otherwise.

bool ctr_pxi_get_error ( void  )

Returns the error status of the PXI system.

An error is set when a read is attempted from the read PXI queue and there is no data there, or when data is attempted to be sent when the send PXI queue is full. No errors are set when the system if offline.

Returns
True if an error is reported by the PXI system, false otherwise.
bool ctr_pxi_get_receive_not_empty_irq ( void  )

Checks the status of the IRQ for when the receive PXI queue is not empty.

Returns
True if the IRQ is enabled, false otherwise.
bool ctr_pxi_get_send_empty_irq ( void  )

Checks the status of the IRQ for when the send PXI queue is empty.

Returns
True if the IRQ is enabled, false otherwise.
bool ctr_pxi_pop ( uint32_t *  data)

Pops data from the receive PXI queue.

Parameters
[in]dataPointer to where to store data popped from the receive PXI queue.
Returns
True if popping succeeded, false if the queue was empty and the pop failed.
bool ctr_pxi_push ( uint32_t  data)

Push data into the send PXI queue.

Parameters
[in]dataData to push into send PXI queue.
Returns
True if pushing succeeded, false if the queue was full and the push failed.
bool ctr_pxi_receive_empty_status ( void  )

Checks if the receive PXI queue is empty.

Returns
True if the receive PXI queue is empty, false otherwise.
bool ctr_pxi_receive_full_status ( void  )

Checks if the receive PXI queue is full.

Returns
True if the receive PXI queue is full, false otherwise.
bool ctr_pxi_send_empty_status ( void  )

Checks if the send PXI queue is empty.

Returns
True if the send PXI queue is empty, false otherwise.
bool ctr_pxi_send_full_status ( void  )

Checks if the send PXI queue is full.

Returns
True if the send PXI queue is full, false otherwise.
void ctr_pxi_set_enabled ( bool  state)

Sets the state of the PXI system.

Parameters
[in]stateState to set the PXI system to.
Postcondition
On setting the state to true, the PXI system is enabled. On false it is disabled.
void ctr_pxi_set_receive_not_empty_irq ( bool  state)

Sets the state of the IRQ for when the receive PXI queue is not empty.

Parameters
[in]stateThe state to set the IRQ to, true to enable, false to disable.
Postcondition
The IRQ will be enabled if thet parameter is true, or disabled if false.
void ctr_pxi_set_send_empty_irq ( bool  state)

Sets the state of the IRQ for when the send PXI queue is empty.

Parameters
[in]stateThe state to set the IRQ to, true to enable, false to disable.
Postcondition
The IRQ will be enabled if thet parameter is true, or disabled if false.