mirror of
https://github.com/YuzuZensai/MCUFRIEND_kbv.git
synced 2026-01-06 04:32:38 +00:00
move OPENSMART, TFT_HX8357GLUE to unused
This commit is contained in:
179
extras/unused/appnote_himax.sed
Normal file
179
extras/unused/appnote_himax.sed
Normal file
@@ -0,0 +1,179 @@
|
||||
#n does not work. use nsed -n
|
||||
|
||||
######################################################################
|
||||
# nsed -f pagebreak.sed file.txt | nsed -n -f appnote_himax.sed
|
||||
|
||||
# copy-paste Ilitek App Note examples to xxx.txt
|
||||
# ditto Renesas, Himax, ...
|
||||
# or just pipe UTFT initlcd.h through
|
||||
|
||||
# parse Ilitek App Note sequence. e.g.
|
||||
# LCD_ILI9486_CMD(0XF2);
|
||||
# LCD_ILI9486_INDEX(0x18);
|
||||
# Delayms(1); // Delay 1ms
|
||||
|
||||
# parse GalaxyCore App Note sequence. e.g.
|
||||
# LCD_ GC9102_CMD(0XF2);
|
||||
# LCD_ GC9102_DATA(0x18);
|
||||
# delayms(1); // Delay 1ms
|
||||
|
||||
# parse Himax App Note sequence. e.g.
|
||||
# Set_NOKIA_8B_CMD(0XF2);
|
||||
# Set_NOKIA_8B_PA(0x18);
|
||||
# DelayX1ms(1); // Delay 1ms
|
||||
|
||||
# parse Renesas App Note sequence. e.g.
|
||||
# {setc, 0x000F2}
|
||||
# {setp, 0x00018}
|
||||
# {time, 0040,ms}
|
||||
|
||||
# parse UTFT sequence. e.g.
|
||||
# LCD_Write_COM(0XF2);
|
||||
# LCD_Write_DATA(0x18);
|
||||
# delay(1); // Delay 1ms
|
||||
|
||||
# parse EastRising sequence. e.g.
|
||||
# Write_Cmd(0XF2);
|
||||
# Write_Cmd_Data(0x18);
|
||||
# delayms(1); // Delay 1ms
|
||||
|
||||
:Ilitek
|
||||
# remove leading white space
|
||||
s/^[ ]*//
|
||||
# //comment// to //comment
|
||||
s/----\/\/$/----/
|
||||
# //comment to /* comment */
|
||||
s/[/][/]\(.*\)/\/\*\1\*\/ /
|
||||
# change to consistent CMD syntax
|
||||
s/LCD_ILI9..._CMD_INDEX/LCD_Write_COM/
|
||||
s/LCD_ILI9..._CMD/LCD_Write_COM/
|
||||
s/LCD_ GC9102_CMD/LCD_Write_COM/
|
||||
s/r61581_cmd/LCD_Write_COM/
|
||||
s/LV_DRV_DELAY_MS/delay/
|
||||
s/LCD_Write_COM_DATA(\(.*\),\(.*\));/ (\1), 1, \2, /
|
||||
s/IO.writeCommandTransaction/LCD_Write_COM/
|
||||
s/Delayms/delay/
|
||||
s/Set_NOKIA_8B_CMD/LCD_Write_COM/
|
||||
s/DelayX1ms/delay/
|
||||
s/Lcd_Write_Com/LCD_Write_COM/
|
||||
s/lcdWriteReg(0x00/LCD_Write_COM(0x/
|
||||
s/writecommand/LCD_Write_COM/
|
||||
s/{setc,.* 0x000\(..\)}/LCD_Write_COM(0x\1);/
|
||||
s/{time, 0*\(.*\),ms}/delay(\1);/
|
||||
s/delayms/delay/
|
||||
s/GUI_Delay/delay/
|
||||
s/Write_Cmd_Data/LCD_Write_DATA/
|
||||
s/Write_Cmd/LCD_Write_COM/
|
||||
s/lcdWriteData(0x00/LCD_Write_DATA(0x/
|
||||
s/LCD_WR_REG(/LCD_Write_COM(/
|
||||
s/LCD_Write_COM *(/LCD_Write_COM(/
|
||||
/LCD_Write_COM(/b good
|
||||
/delay(/b good
|
||||
b print
|
||||
{
|
||||
:good
|
||||
h
|
||||
:args
|
||||
n
|
||||
s/^[ ]*//
|
||||
s/[ ]*\/\/[VP][0-9]+$//
|
||||
s/[/][/]\(.*\)/ \/\*\1\*\/ /
|
||||
s/LCD_ILI9..._CMD_PAs/LCD_Write_DATA/
|
||||
s/LCD_ILI9..._INDEX/LCD_Write_DATA/
|
||||
s/LCD_ILI9..._ Parameter/LCD_Write_DATA/
|
||||
s/LCD_ GC9102_DATA/LCD_Write_DATA/
|
||||
s/r61581_data/LCD_Write_DATA/
|
||||
s/IO.writeDataTransaction/LCD_Write_DATA/
|
||||
s/Set_NOKIA_8B_PA/LCD_Write_DATA/
|
||||
s/DelayX1ms/delay/
|
||||
s/{setp,.* 0x000\(..\)}/LCD_Write_DATA(0x\1);/
|
||||
s/{setp,.* 0x00\(...\)}/LCD_Write_DATA(0x\1);/
|
||||
# s/{time, 0*\(.*\),ms}/delay(\1)/
|
||||
s/LCD_Write_DATA_8/LCD_Write_DATA/
|
||||
s/Lcd_Write_Data/LCD_Write_DATA/
|
||||
s/lcdWriteData(0x00/LCD_Write_DATA(0x/
|
||||
s/writedata/LCD_Write_DATA/
|
||||
s/delayms/delay/
|
||||
s/Write_Cmd_Data/LCD_Write_DATA/
|
||||
s/LCD_WR_DATA(/LCD_Write_DATA(/
|
||||
s/LCD_Write_DATA *(/LCD_Write_DATA(/
|
||||
#kludges for inconsistent syntax in Ilitek PDF
|
||||
s/;)$/);/
|
||||
s/)$/);/
|
||||
s/;;/;/
|
||||
# append any data to Hold space
|
||||
/LCD_Write_DATA(/{
|
||||
H
|
||||
b args
|
||||
}
|
||||
/^$/b args
|
||||
x
|
||||
# parse command byte to (0xNN),
|
||||
s/LCD_Write_COM(\([^)]+\)/ (\1)/
|
||||
s/(0[xX]00\(..\))/(0x\1)/
|
||||
# parse data byte to 0xNN,
|
||||
s/\nLCD_Write_DATA(//g
|
||||
# parse delay times
|
||||
s/delay(\(.+\));/ TFTLCD_DELAY8, \1, /
|
||||
s/)\;/,/g
|
||||
s/0X/0x/g
|
||||
s/0x,/0x00,/g
|
||||
s/;,/,/
|
||||
w 9806.out
|
||||
# attempt to calculate number of parameters. show #ERROR# if > 16
|
||||
/0x..),.*,.*,.*,.*,.*,.*,.*,.*,.*,.*,.*,.*,.*,.*,.*,.*,.*,/s/),/),#ERROR#,/
|
||||
t counted
|
||||
/0x..),.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,/s/),/),16,/
|
||||
t counted
|
||||
/0x..),.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,/s/),/),15,/
|
||||
t counted
|
||||
/0x..),.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,/s/),/),14,/
|
||||
t counted
|
||||
/0x..),.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,/s/),/),13,/
|
||||
t counted
|
||||
/0x..),.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,/s/),/),12,/
|
||||
t counted
|
||||
/0x..),.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,/s/),/),11,/
|
||||
t counted
|
||||
/0x..),.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,/s/),/),10,/
|
||||
t counted
|
||||
/0x..),.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,/s/),/), 9,/
|
||||
t counted
|
||||
/0x..),.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,/s/),/), 8,/
|
||||
t counted
|
||||
/0x..),.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,/s/),/), 7,/
|
||||
t counted
|
||||
/0x..),.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,/s/),/), 6,/
|
||||
t counted
|
||||
/0x..),.*0x..,.*0x..,.*0x..,.*0x..,.*0x..,/s/),/), 5,/
|
||||
t counted
|
||||
/0x..),.*0x..,.*0x..,.*0x..,.*0x..,/s/),/), 4,/
|
||||
t counted
|
||||
/0x..),.*0x..,.*0x..,.*0x..,/s/),/), 3,/
|
||||
t counted
|
||||
/0x..),.*0x..,.*0x..,/s/),/), 2,/
|
||||
t counted
|
||||
/0x..),.*0x..,/s/),/), 1,/
|
||||
t counted
|
||||
/0x..),/s/),/), 0,/
|
||||
:counted
|
||||
# life is simpler with multiple whitespace reduced to single space
|
||||
s/[ ]+/ /g
|
||||
s/ $//
|
||||
#/(0x2C)/p
|
||||
# attempt to move first comment to end of line
|
||||
s/\((0x..),[ 1][0-9],\) \/\*\([^*]*\)\*\/ \(.*\)/\1 \3 \/\/\2/
|
||||
#s/\((0x..),[ 1][0-9],\) \(\/\*[^*]*\*\/\) \(.*\)/\1 \3 \2/
|
||||
#/0x..),[ 1][0-9],/s/ *\(\/\*[^*]*\*\/\) *\(.*\)/ \2 \1/
|
||||
p
|
||||
x
|
||||
b Ilitek
|
||||
}
|
||||
:print
|
||||
s/^[Vv]oid \(.*\)_Initial.*(void)/const unsigned char \1[] =/
|
||||
s/^void LCD_Initial_\(.*\)(void)/const unsigned char \1[] =/
|
||||
s/^void \(.*\)::init()/const unsigned char \1[] =/
|
||||
s/^}$/};/
|
||||
p
|
||||
|
||||
:end
|
||||
@@ -1,54 +0,0 @@
|
||||
#n does not work. use nsed -n
|
||||
|
||||
######################################################################
|
||||
# nsed -f pagebreak.sed file.txt | nsed -n -f appnote_ilitek.sed
|
||||
|
||||
# parse Ilitek App Note sequence. e.g.
|
||||
# LCD_ILI9486_CMD(0XF2);
|
||||
# LCD_ILI9486_INDEX(0x18);
|
||||
# Delayms(1); // Delay 1ms
|
||||
|
||||
:Ilitek
|
||||
# //Title line
|
||||
s/^[1-9].*/\/\/ &/
|
||||
# //comment to /* comment */
|
||||
s/[/][/]\(.*\)/\/\*\1\*\/ /
|
||||
s/_CMD_INDEX/_CMD/
|
||||
s/_CMD_PAs/_INDEX/
|
||||
s/_ Parameter (/_INDEX(/
|
||||
/LCD_ILI9..._CMD(/b good
|
||||
/Delayms(/b good
|
||||
b print
|
||||
{
|
||||
:good
|
||||
h
|
||||
:args
|
||||
n
|
||||
s/[/][/]\(.*\)/\/\*\1\*\/ /
|
||||
s/_CMD_INDEX/_CMD/
|
||||
s/_CMD_PAs/_INDEX/
|
||||
s/_ Parameter (/_INDEX(/
|
||||
# append any data to Hold space
|
||||
/LCD_ILI9..._INDEX(/{
|
||||
H
|
||||
b args
|
||||
}
|
||||
/^$/b args
|
||||
x
|
||||
# parse command byte to (0xNN),
|
||||
s/LCD_ILI9..._CMD(\([^)]+\)/ (\1)/
|
||||
# parse data byte to 0xNN,
|
||||
s/\nLCD_ILI9..._INDEX(//g
|
||||
# parse delay times
|
||||
s/Delayms(\(.+\));/ TFTLCD_DELAY8, \1, /
|
||||
s/)\;/,/g
|
||||
s/0X/0x/g
|
||||
s/,;/,/
|
||||
p
|
||||
x
|
||||
b Ilitek
|
||||
}
|
||||
:print
|
||||
p
|
||||
|
||||
:end
|
||||
@@ -1,55 +0,0 @@
|
||||
#n does not work. use nsed -n
|
||||
|
||||
######################################################################
|
||||
# nsed -f appnote_novatek.sed inputfile
|
||||
# produce output in: init_sequence.out
|
||||
# still requires removing some garbage.
|
||||
# adding array declaration, inserting argument count on each line.
|
||||
|
||||
# parse Novatek App Note sequence. e.g.
|
||||
# Lcd_Write_Com(0XF2);
|
||||
# Lcd_Write_Data(0x18);
|
||||
# delay(100);
|
||||
|
||||
:Novatek
|
||||
# trim any leading, trailing whitespace. Line scope comments
|
||||
s/^[\t ]*//
|
||||
s/[\t ]*$//
|
||||
s/[\t ]*[/][/]\(.*\)/ \/\*\1\*\/ /
|
||||
# block start
|
||||
/Lcd_Write_Com(/b good
|
||||
/delay(/b good
|
||||
b print
|
||||
{
|
||||
:good
|
||||
h
|
||||
:args
|
||||
n
|
||||
s/^[\t ]*//
|
||||
s/[\t ]*$//
|
||||
s/[\t ]*[/][/]\(.*\)/ \/\*\1\*\/ /
|
||||
# append any data to Hold space
|
||||
/Lcd_Write_Data(/{
|
||||
H
|
||||
b args
|
||||
}
|
||||
/^$/b args
|
||||
x
|
||||
# trim ( 0xNN ) to (0xNN)
|
||||
s/( */(/g
|
||||
s/ *)/)/g
|
||||
# parse command byte to (0xNN),
|
||||
s/Lcd_Write_Com(\([^)]+\)/ (\1)/
|
||||
# parse data byte to 0xNN,
|
||||
s/\nLcd_Write_Data(//g
|
||||
# parse delay times
|
||||
s/delay(\(.+\));/ TFTLCD_DELAY8, \1, /
|
||||
s/) *\;/,/g
|
||||
s/0X/0x/g
|
||||
s/,;/,/
|
||||
winit_sequence.out
|
||||
x
|
||||
b Novatek
|
||||
}
|
||||
:print
|
||||
:end
|
||||
@@ -1,47 +0,0 @@
|
||||
#n does not work. use nsed -n
|
||||
|
||||
######################################################################
|
||||
# parse Renesas App Note sequence. e.g.
|
||||
# {setc, [107], W, 0x000B0}
|
||||
# {setc, 0x000D0}
|
||||
# {setp, 0x00033}
|
||||
# {time, 0040,ms}
|
||||
|
||||
:Renesas
|
||||
# //Title line
|
||||
s/^[1-9].*/\/\/ &/
|
||||
# //comment to /* comment */
|
||||
s/[/][/]\(.*\)/\/\*\1\*\/ /
|
||||
/{setc,/b good
|
||||
/{time,/b good
|
||||
b print
|
||||
{
|
||||
:good
|
||||
h
|
||||
:args
|
||||
n
|
||||
s/[/][/]\(.*\)/\/\*\1\*\/ /
|
||||
# append any data to Hold space
|
||||
/setp/{
|
||||
H
|
||||
b args
|
||||
}
|
||||
# /^$/b args
|
||||
x
|
||||
# verbose format
|
||||
s/, \[[0-9]+\], W, 0x/, 0x/g
|
||||
# parse command byte to (0xNN),
|
||||
s/{setc, 0x000\(..\)}/ (0x\1), /
|
||||
# parse data byte to 0xNN,
|
||||
# s/\nLCD_ILI9486_INDEX(//g
|
||||
s/\n{setp, 0x000\(..\)}/0x\1, /g
|
||||
s/\n{setp, 0x00\(...\)}/0x\1, /g
|
||||
# parse delay times
|
||||
s/{time, 0*\(.*\),ms}/ TFTLCD_DELAY8, \1, /
|
||||
s/)\;/,/g
|
||||
p
|
||||
x
|
||||
b Renesas
|
||||
}
|
||||
:print
|
||||
p
|
||||
@@ -1,3 +1,21 @@
|
||||
# skip the PDF page footers.
|
||||
# skip the Ilitek PDF page footers.
|
||||
/^a-.*/,/^Page.*/d
|
||||
/^[0-9]+$/,/^.2010.*/d
|
||||
# skip the GalaxyCore PDF page headers.
|
||||
/^Page*/,/^132RGB.*/d
|
||||
# GalaxyCore //comment// to //comment
|
||||
s/----\/\/$/----/
|
||||
# skip the Himax PDF page footers.
|
||||
/^Him.ax Confidential*/,/^APPLICATION NOTE/d
|
||||
/^-P.*Himax Confidential*/,/^APPLICATION NOTE/d
|
||||
# skip the Renesas PDF page footers.
|
||||
/^[0-9]+$/,/Renesas SP Drivers/d
|
||||
#/Initial Code(/d
|
||||
# comment the Panel Title
|
||||
s/^[1-9]/\/\/ &/
|
||||
# remove Enter/Exit Sleep functions
|
||||
/^[Vv]oid.*Sleep/,/^}/d
|
||||
/^[Vv]oid.*Standby/,/^}/d
|
||||
# legal function name
|
||||
/^void/s/[.]//
|
||||
# remove hardware Reset sequence
|
||||
/Reset LCD Driver/,/Start Initial Sequence/d
|
||||
|
||||
Reference in New Issue
Block a user