410 likes | 533 Views
SDK&UI&LCM&FM Presentation. 報告人 : 侯欽堅. Outline. SDK Structure & Code Flow LCM SPEC & Hardware LCM Code FM SPEC & Hardware FM Code UI Hardware UI Code API Structure & Code Flow. SDK Structure & Code Flow. SDK : Software Development Kit User’s Development :
E N D
SDK&UI&LCM&FM Presentation 報告人: 侯欽堅
Outline • SDK Structure & Code Flow • LCM SPEC & Hardware • LCM Code • FM SPEC & Hardware • FM Code • UI Hardware • UI Code • API Structure & Code Flow
SDK Structure & Code Flow • SDK : Software Development Kit • User’s Development : Song , UI , LCM , FM Module , Lyrics… • \RAM_user\example2\Lcd_controller2.c, funentry.c, i2c.c, song.c, fm_tea5767.c, gpio.c, lrc_parser.c • 與Kernel的連接方式 : a. Customize Function Entry: api_bCustomizeFunEntry() b. APIs
api_bCustomizeFunEntry() • To process the event from the Kernel A. EVENT_QUARTER_SECOND: LCM Display , Timer B. EVENT_LOOP_EPILOG : Song events, Key process C. EVENT_USB_STATUS_CHANGE : USB Status show D. USB_CABLE_IN : Cable in process E. USB_CABLE_OUT : Cable out process F. SYS_INIT_PROLOG : LCD & Radio initial G. SYS_INIT_EPILOG : GUI & Song & Display initial
Example Code Flow • funentry.c : api_bCustomizeFunEntry() • Lcd_controller2.c : LCM Basic process • i2c.c : I2C Driver • fm_tea5767.c : FM Driver • gpio.c : Button basic process • song.c : LCD Display , UI flow control • lrc_parser.c : Lyrics show
vLcdSetAddrY(0) vLcdSetAddrY(95) bit0 ..... vLcdSetAddrX(0) vWriteLCDData() bit7 ..... ..... ..... 32 pixels ..... vLcdSetAddrX(3) 96 pixels LCM SPEC • NT7502 • 65x132 RAM-Map LCD Controller
Command support E R/w 0xE2 0xA2 0xA0 0xC0 0x23 0x81 0x03 0x2C 0x2E 0x2F 0xE0 0x4X 0xAF 0xBX 0x1X 0x0X
vLcdSetAddrY(0) vLcdSetAddrY(95) bit0 ..... vLcdSetAddrX(0) vWriteLCDData() bit7 ..... ..... ..... 32 pixels ..... vLcdSetAddrX(3) 96 pixels LCM Code back
FM SPEC & Hardware • I2C Protocol • FM Register
I2C Protocol • SDA : Serial Data line • SCL : Serial Clock line • Every device has its own unique address • Start • Stop • Send BYTE • Receive BYTE
I2C : Send BYTE • Once the start condition has been sent, a byte can be transmitted by the MASTER to the SLAVE. • This first byte after a start condition will identify the slave on the bus (address) and will select the mode of operation. • ACK
I2C : Receive BYTE • All the master has to do is generate a rising edge on the SCL line (2), read the level on SDA (3) and generate a falling edge on the SCL line (4). The slave will not change the data during the time that SCL is high.
FM SPEC 0x80, 0x00, 0x00, 0x40, 0x00
UI Hardware • (1) 128Pin (2)100Pin
0x8000 RAM CODE DSP Mailbox driver Font Manager Playback control Format/Directory Manager (\RAM_kernel\*.*) 0x9000 ram_api() SDK APIs LCD driver FM driver GUI control (\RAM_user\*.*) 0xFFFF CODE(?PR?*?ramapi (0x9000)) API Structure • API.c
B 0xC0, 0x80, 0x00, 0x00, 0x40, 0x00
B 0x00,
b back
b back