一:内核中的驱动
1. config配置:
-->Device Drivers
-->Character devices
-->Serial drivers
-->[*] IMX serial port support
[*] console on IMX serial port
2.drivers/tty/serial/Kconfig
Config SERIAL_IMX (bool "IMX serial port support")
config SERIAL_IMX_CONSOLE (bool "Console on IMX serial port")
3.drivers/tty/serial/Makefile
obj-$(CONFIG_SERIAL_IMX) += imx.o
obj-$(CONFIG_SERIAL_IMX_CONSOLE) += mxc_uart_early.o
4.相关的驱动代码文件
drivers/tty/serial/serial_core.c
drivers/tty/serial/mxc_uart_early.c
arch/arm/plat-mxc/include/mach/mxc_uart.h
arch/arm/plat-mxc/include/mach/iomux-mx6q.h
arch/arm/mach-mx6/serial.h
arch/arm/mach-mx6/board-mx6q_sabresd.c
二:硬件抽象层(HAL)通过JNI方法提供java访问硬件服务接口
frameworks/base/services/jni/com_android_server_SerialService.cpp
static jobject android_server_SerialService_open(JNIEnv *env, jobject thiz, jstring path)
三:ApplicationFrameworks层的硬件访问服务
frameworks/base/services/java/com/android/server/SerialService.java
public String[] getSerialPorts()
public ParcelFileDescriptor openSerialPort(String path)
private native ParcelFileDescriptor native_open(String path);
关于Android硬件抽象层(HAL)的了解和学习可以看:http://blog.csdn.net/luoshengyang/article/details/6567257
关于android应用串口通信可以看 android-serialport-api