FT800 Series Programmer Guide
Version 2.1
Document Reference No.: BRT_000030 Clearance No.: BRT#037
161
Copyright © Bridgetek Limited
5.18
CMD_MEMWRITE - write bytes into memory
Writes the following bytes into the FT800 memory. This command can be used to set
register values, or to update memory contents at specific times.
C prototype
void cmd_memwrite( uint32_t ptr,
uint32_t num );
Parameters
Ptr
The memory address to be written
num
Number of bytes to be written.
Description
The data byte should immediately follow in the command buffer. If the number of bytes
is not a multiple of 4, then 1, 2 or 3 bytes should be appended to ensure 4-byte
alignment of the next command, these padding bytes can have any value. The
completion of this function can be detected when the value of REG_CMD_READ is equal
to REG_CMD_WRITE.
Caution: if using this command, it may corrupt the memory of the FT800 if used
improperly.
Command layout
+0
CMD_MEMWRITE(0xffffff1a)
+4
ptr
+8
Num
+12
Byte0
+13
Byte1
..
..
+n
..
Examples
To change the backlight brightness to 64 (half intensity) for a particular screen shot:
...
cmd_swap(); // finish the display list
cmd_dlstart(); // wait until after the swap
cmd_memwrite(REG_PWM_DUTY, 4); // write to the PWM_DUTY register