1,Android中HAL如何向上层提供接口总结
http://blog.youkuaiyun.com/flydream0/article/details/7086273
2,理解里面的HAL时,由于对C及C++不熟悉,所以做一个简单的c语言的例子如下:
#include<stdio.h>
struct x_short {
int a;
int b;
};
struct x_hight {
//int h;
struct x_short sh;
int h;
int w;
};
int main(){
struct x_hight p={
sh : {
a:10,
b:11,
},
h:30,
w:31,
};
struct x_short *s=&(p.sh);
printf("short:a=%d,b=%d\n",s->a,s->b);
struct x_hight *ss=(struct x_hight *)s;
printf("hight: sh.a=%d,sh.b=%d,h=%d,w=%d\n",ss->sh.a,ss->sh.b,ss->h,ss->w);
}