libctr9
Nintendo 3DS ARM9 library
ctr_pxi.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (C) 2016 Gabriel Marcano
3  *
4  * Refer to the COPYING.txt file at the top of the project directory. If that is
5  * missing, this file is licensed under the GPL version 2.0 or later.
6  *
7  ******************************************************************************/
8 
11 #ifndef CTR_PXI_H_
12 #define CTR_PXI_H_
13 
14 #include <stdint.h>
15 #include <stdbool.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 //PXI registers
22 #define PXI_SYNC9 (*(uint32_t*)0x10008000)
23 #define PXI_CNT9 (*(uint32_t*)0x10008004)
24 #define PXI_SEND9 (*(uint32_t*)0x10008008)
25 #define PXI_RECV9 (*(uint32_t*)0x1000800C)
26 
31 bool ctr_pxi_send_empty_status(void);
32 
37 bool ctr_pxi_send_full_status(void);
38 
44 
53 void ctr_pxi_set_send_empty_irq(bool state);
54 
59 void ctr_pxi_fifo_send_clear(void);
60 
66 
72 
79 
88 void ctr_pxi_set_receive_not_empty_irq(bool state);
89 
97 void ctr_pxi_set_enabled(bool state);
98 
103 bool ctr_pxi_get_enabled(void);
104 
107 void ctr_pxi_fifo_ack(void);
108 
117 bool ctr_pxi_get_error(void);
118 
126 bool ctr_pxi_push(uint32_t data);
127 
136 bool ctr_pxi_pop(uint32_t *data);
137 
138 #ifdef __cplusplus
139 }
140 #endif
141 
142 #endif//CTR_PXI_H_
143 
bool ctr_pxi_receive_full_status(void)
Checks if the receive PXI queue is full.
bool ctr_pxi_send_empty_status(void)
Checks if the send PXI queue is empty.
void ctr_pxi_set_enabled(bool state)
Sets the state of the PXI system.
void ctr_pxi_fifo_ack(void)
(FIXME Uncertain, this is most likely wrong) Acknowledge IRQ.
bool ctr_pxi_push(uint32_t data)
Push data into the send PXI queue.
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.
bool ctr_pxi_receive_empty_status(void)
Checks if the receive PXI queue is empty.
bool ctr_pxi_get_send_empty_irq(void)
Checks the status of the IRQ for when the send PXI queue is empty.
bool ctr_pxi_get_error(void)
Returns the error status of the PXI system.
void ctr_pxi_set_send_empty_irq(bool state)
Sets the state of the IRQ for when the send PXI queue is empty.
bool ctr_pxi_send_full_status(void)
Checks if the send PXI queue is full.
bool ctr_pxi_pop(uint32_t *data)
Pops data from the receive PXI queue.
void ctr_pxi_fifo_send_clear(void)
Clears/flushes the send PXI queue.
bool ctr_pxi_get_receive_not_empty_irq(void)
Checks the status of the IRQ for when the receive PXI queue is not empty.
bool ctr_pxi_get_enabled(void)
Returns the state of the PXI system.