Introduction
to
MTK Device drivers
V2.0
2004/07/19
Arthur Shieh
Agenda
• Boot-up & EMI
• SIM
• ADC Scheduler
• Battery Management
• PMIC
• Aux Task
• UART
• Keypad
• LCD & SPI
• GPIO
• GPT
• RTC
• Watchdog Timer
• PWM
• Alerter
• Audio
• Camera
• USB
Folders to look into
• mcu\drv :
– Common Driver implementation and definitions
• mcu\custom\ ”Custom_Proj”:
– Customized driver implementation and definitions
• mcu\interface\hwdrv :
– Interface declarations
• mcu\l1audio :
– Host for audio processing related fils
EMI - Boot-up and Initialization
Receiving start-up
pattern via UART1
within 150ms?
Boot from
BOOTROM
RESET NO
Switch PC to External
Device Bank #0
YES
META Mode
Assign Supervisor
Mode SP
If abnormal reset
Is detected?
NO
YES
Response the
abnormal reset
Configure EMI
Data copy from flash to SRAM
Assign SP to various operation
modes defined by ARM CPU.
Application initialization
Receiving start-up
pattern via UART1
within 150ms?
Boot from
BOOTROM
RESET NO
Switch PC to External
Device Bank #0
YES
META Mode
Assign Supervisor
Mode SP
If abnormal reset
Is detected?
NO
YES
Response the
abnormal reset
Configure EMI
Data copy from flash to SRAM
Assign SP to various operation
modes defined by ARM CPU.
Application initialization
mcu\init\src\bootarm.s
nmcu\init\src\ini.c
Boot-up and Initialization
Generic Initialization sequence:
mcu\init\src\bootarm.s
• Boot ROM code
mcu\custom\include\custom_config.h:
• EMI data structure
mcu\nucleus\src\inc.c
• Initialize system (VOID INC_Initialize(VOID *first_available_memory))
mcu\init\src\init.c
• Initialize HW (void Application_Initialize (void *first_available_memory))
INT_SetEMI Initialize EMI here.
mcu\drv\src\drv_comm.c
• Initialize device (void Drv_Init(void))