I finally succeeded in implementing a "fillscreen" method. The difference when using the mem32 or viper code is just huge:
using mem32, the screen is filled in 34s ( )
using a bit of viper code : 63 ms ( ) -> almost instantly for human eye
here is my piece of viper code :
Code: Select all
@micropython.viper
def balayage(h:int,end:int,w:int,D_mask:int,hi_value:int,lo_value:int,WR_value:int):
GPIO_OUT_TC = ptr32(GPIO_OUT_W1TC_REG) # GPIO Output W1TC register
GPIO_OUT_TS = ptr32(GPIO_OUT_W1TS_REG) # GPIO Output W1TS register
while (h>0):
end = w
while(end!=0):
GPIO_OUT_TC[0] = D_mask #pin mask -> data pins set to 1
GPIO_OUT_TS[0] = hi_value #color hi bits sent to data pins
GPIO_OUT_TC[0] = WR_value #WR pin mask
GPIO_OUT_TS[0] = 0 #WR pin strobe (off)
GPIO_OUT_TC[0] = WR_value #WR pin mask
GPIO_OUT_TS[0] = WR_value #WR pin strobe (on)
GPIO_OUT_TC[0] = D_mask #pin mask -> data pins set to 1
GPIO_OUT_TS[0] = lo_value #color lo bits sent to data pins
GPIO_OUT_TC[0] = WR_value #WR pin mask
GPIO_OUT_TS[0] = 0 #WR pin strobe (on)
GPIO_OUT_TC[0] = WR_value #WR pin mask
GPIO_OUT_TS[0] = WR_value #WR pin strobe (off)
end-=1
h-=1