nuclear@0: #ifndef COPPER_H_ nuclear@0: #define COPPER_H_ nuclear@0: nuclear@0: #include "inttypes.h" nuclear@0: nuclear@0: #define COPPER_MOVE(reg, data) (((uint32_t)(reg) << 16) | ((uint32_t)(data) & 0xffff)) nuclear@0: #define COPPER_WAIT(x, y) \ nuclear@0: (0x0001fffe | ((uint32_t)((x) + 0x81) << 16) | ((uint32_t)((y) + 0x2c) << 24)) nuclear@0: #define COPPER_WAIT_OVERSCAN(x, y) \ nuclear@0: (0x0001fffe | ((uint32_t)(x) << 16) | ((uint32_t)(y) << 24)) nuclear@0: #define COPPER_VWAIT(s) (0x0001ff00 | ((uint32_t)((s) + 0x2c) << 24)) nuclear@0: #define COPPER_VWAIT_OVERSCAN(s) \ nuclear@0: (0x0001ff00 | ((uint32_t)(s) << 24)) nuclear@0: #define COPPER_END 0xfffffffe nuclear@0: nuclear@0: extern uint32_t *copperlist, *copperlist_end; nuclear@0: nuclear@0: enum { nuclear@0: COPPER_SINGLE = 1, nuclear@0: COPPER_DOUBLE = 2 nuclear@0: }; nuclear@0: nuclear@0: int init_copper(int maxlist, int nlists); nuclear@0: void cleanup_copper(void); nuclear@0: nuclear@0: /* enables copper DMA */ nuclear@0: void enable_copper(void); nuclear@0: /* disables copper DMA */ nuclear@0: void disable_copper(void); nuclear@0: nuclear@0: void clear_copper(void); nuclear@0: void add_copper(uint32_t cmd); nuclear@0: void sort_copper(void); /* TODO */ nuclear@0: nuclear@0: void swap_copper(void); nuclear@0: nuclear@0: nuclear@0: #endif /* COPPER_H_ */