Chameleon-PIC Nurve Networks, Chameleon-PIC Datasheet - Page 185

MCU, MPU & DSP Development Tools PIC24 & PROPELLER DEV SYSTEM (SBC)

Chameleon-PIC

Manufacturer Part Number
Chameleon-PIC
Description
MCU, MPU & DSP Development Tools PIC24 & PROPELLER DEV SYSTEM (SBC)
Manufacturer
Nurve Networks
Datasheet

Specifications of Chameleon-PIC

Processor To Be Evaluated
PIC24
Data Bus Width
16 bit
Interface Type
USB, VGA, PS/2, I2C, ISP, SPI
Operating Supply Voltage
3.3 V, 5 V
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
GPU_GFX_SUBFUNC_STATUS_W. The “R” or read message currently does nothing, but the “W” or write message
executes the GPU command which there are currently 4 of as shown in the header code below:
We will see how to call all these in the API section below, but the point is, I want you to see the “big picture” and see how
all this stuff works, not so much, so you can use it, but so that you might use this template, model, or pattern to create
better, faster drivers. In any event, when a message is sent with GPU_GFX_SUBFUNC_STATUS_W then we assume
that a GPU command is being issued and the first data byte of the SPI message is used as the sub-function ID (lower 8-
bits) and the upper 8-bits or second byte is used as the operand or data.
Now, the GPU functions are too complex to request in a single SPI message, so we have to “set them up”. Thus, we have
to initialize pointers to the source, destination, and length of bytes or words to process then we call the GPU command to
actually do the work. For example, the sub-function GPU_GFX_SUBFUNC_FILLMEM16 requires a pointer to the
destination and the number of WORDS to write along with data WORD. So how do we set all those? Easy, we use other
GFX messages to set the destination address pointer, data WORD, and number of bytes for “operation”, then the GPU
sub-function uses those data for the operation! Simple!
At this point, you should have a good idea of how the enhanced NTSC tile engine works, and the entire communication
paths from the AVR/PIC to the Propeller driver itself. So, let’s move onto the API itself.
22.3 API Listing Reference
The API listing for the “NTSC GFX” driver module CHAM_PIC_GFX_DRV_V010.c is listed in Table 22.2 categorized by
functionality.
Function Name
GPU sub-functions
int GFX_GPU_Fill_Mem16(unsigned int dest_ptr,unsigned int value, unsigned int num_bytes);
int GFX_GPU_Copy_Mem16(unsigned int dest_ptr, unsigned int src_ptr, unsigned int num_bytes);
int GFX_GPU_Fill_Mem8(unsigned int dest_ptr,unsigned int value, unsigned int num_bytes);
int GFX_GPU_Copy_Mem8(unsigned int dest_ptr, unsigned int src_ptr, unsigned int num_bytes);
Palette pointer access functions
unsigned int GFX_Read_Palette_Ptr(void);
unsigned int GFX_Write_Palette_Ptr(unsigned int palette_ptr);
Tilemap pointer access functions
unsigned int GFX_Read_Tilemap_Ptr(void);
unsigned int GFX_Write_Tilemap_Ptr(unsigned int tilemap_ptr);
GPU_GFX_subfunc := g_data16 & $FF ' lower 8-bits defines sub-function
GPU_GFX_data
case (GPU_GFX_subfunc)
' extract API subfunction and data
GPU_GFX_SUBFUNC_COPYMEM16: ' 0 - Copies numbytes from src -> dest in wordsize chunks
GPU_GFX_SUBFUNC_FILLMEM16: ' 1 - Fills memory with data16, 2 bytes at a time
GPU_GFX_SUBFUNC_COPYMEM8:
GPU_GFX_SUBFUNC_FILLMEM8:
wordmove( tile_dest_addr_parm, tile_src_addr_parm, tile_numbytes_parm)
wordfill( tile_dest_addr_parm, tile_data16_parm, tile_numbytes_parm >> 1)
bytemove( tile_dest_addr_parm, tile_src_addr_parm, tile_numbytes_parm >> 1)
bytefill( tile_dest_addr_parm, tile_data16_parm & $FF, tile_numbytes_parm)
:= g_data16 >> 8
Table 22.2 – “GFX” module API functions listing.
' 2 - Copies numbytes from src -> dest in byte size chunks
' 3 - Fills memory with low byte of data16, 1 bytes at a time
' upper 8-bits defines data for sub-function
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon PIC 16-Bit”
Description
Reads the tile map palette pointer.
Writes the tile map palette pointer.
Reads the pointer to the top of tilemaps.
Writes the pointer to the top of tilemaps.
Fills memory 16-bits at a time.
Copies memory 16-bits at a time.
Fills memory 8-bits at a time.
Copies memory 8-bits at a time.
185

Related parts for Chameleon-PIC