Datasheet

SAM9263 [DATASHEET]
Atmel-6249N-ATARM-SAM9263-Datasheet_14-Mar-16
960
graphics_control.TDGC_TEXR = endx;
graphics_control.TDGC_TEYR = endy;
graphics_control.TDGC_LOR = 0x00; // Select logic operation MOV
graphics_control.TDGC_CSR = 0x00; // Colour black
graphics_control.TDGC_LWR = 0x02; // 2 pixels wide
graphics_control.TDGC_LPR = 0x5555; // Patterned line ON, OFF, ON, OFF …
// set clip rectangle boundary (4,2), (8,2), (4,4), (8,4)
graphics_control.TDGC_CXMINR = 4;
graphics_control.TDGC_CXMAXR = 8;
graphics_control.TDGC_CYMINR = 2;
graphics_control.TDGC_CYMAXR = 4;
graphics_control.TDGC_CCR = 1; // Enable clipping
graphics_control.TDGC_GOR = 0xD5; // Line draw, absolute, no update, 1D pattern
while(graphics_control.TDGC_GSR & 1);
}
44.4.4 Drawing Using Command Queue
This function draws a series of lines. All commands are written into the FIFO which is automatically converted to
drawing commands. startx, starty, endx and endy should be in pixel units.
void command_queue_draw(unsigned short startx, unsigned short starty, unsigned
short endx)
{
int add_count=6;
int i;
add_count = 6; // number of writes to TDGC_CQR
chk_for_buffer_empty(add_count);
graphics_control.TDGC_CQR = 0x08; // start address, start x register
address
graphics_control.TDGC_CQR = 0x04; // length, number of registers to
update
graphics_control.TDGC_CQR = 120; // start x
graphics_control.TDGC_CQR = 160; // start y
graphics_control.TDGC_CQR = 0; // end x
graphics_control.TDGC_CQR = 0; // end y
for(i = 0;i < 320; i ++)
{
add_count = 7;
chk_for_buffer_empty(add_cnt);
graphics_control.TDGC_CQR = 0x14; // start address, end y register
address
graphics_control.TDGC_CQR = 0x05; // length,# of registers to update
graphics_control.TDGC_CQR = i; // end y
graphics_control.TDGC_CQR = 0xFFFF; // line pattern
graphics_control.TDGC_CQR = 0x04; // colour select
graphics_control.TDGC_CQR = 0x00; // logic operation, MOV
graphics_control.TDGC_CQR = 0xD4; // operation, line draw
}
}
void chk_for_buffer_empty(int add_cnt)