C180_oyster_driver

liu qidong [url ssh://qidong.liu@10.2.90.253:29418/] 3c4d809716 添加LCD驱动模块及测试程序 1 周之前
include 4eb70ca980 添加Voltage sysfs驱动模块 2 周之前
test_app 3c4d809716 添加LCD驱动模块及测试程序 1 周之前
.gitignore f5cf925ca0 Add gsensor source code and test case. 3 周之前
Makefile 3c4d809716 添加LCD驱动模块及测试程序 1 周之前
Readme.md f5cf925ca0 Add gsensor source code and test case. 3 周之前
backlight.c e8f25a8015 1、修复bug。2、添加ec version 3 周之前
backlight.h fcb6d28c3a 添加backlight驱动模块框架 1 月之前
batteryled.c 69927d28e6 添加ac_power驱动 3 周之前
batteryled.h 135b437e5d Add the batteryled module framework 1 月之前
buzzer.c fd5fff7a59 add buzzer module 1 月之前
buzzer.h e8f25a8015 1、修复bug。2、添加ec version 3 周之前
cash_drawers.c d67fa27a44 添加cash drawer驱动模块 1 月之前
cash_drawers.h e8f25a8015 1、修复bug。2、添加ec version 3 周之前
ec_version.c e8f25a8015 1、修复bug。2、添加ec version 3 周之前
ec_version.h 72bacf85ae add ec_version module 1 月之前
fan.c 4eb70ca980 添加Voltage sysfs驱动模块 2 周之前
fan.h 039ff3f7f1 添加fan模块框架,具体功能待完善 1 月之前
gsensor.c 7ecf35a3c4 Modify the gsensor to support auto rotate. 3 周之前
gsensor.h f5cf925ca0 Add gsensor source code and test case. 3 周之前
lcd_2x20.c 3c4d809716 添加LCD驱动模块及测试程序 1 周之前
lcd_2x20.h 3c4d809716 添加LCD驱动模块及测试程序 1 周之前
led.c 93e62c30a3 LightRing 1 月之前
led.h 93e62c30a3 LightRing 1 月之前
light_ring.c fd0b21ec1f 修复brightnes bug 1 月之前
light_ring.h 93e62c30a3 LightRing 1 月之前
main.c 3c4d809716 添加LCD驱动模块及测试程序 1 周之前
myname.c 467a213c4b 添加myname驱动ID获取 2 周之前
myname.h e7dd399dbc 添加myname模块框架 1 月之前
power.c 5ff259bfdc 添加power interface驱动 1 周之前
power.h 5ff259bfdc 添加power interface驱动 1 周之前
ssegment.c 71406ab83f Complete the function of the digital display 3 周之前
ssegment.h 4a7624264b 添加数码管驱动和测试程序 1 月之前
switches.c 6d2d74626c 添加switch模块读取GPIO状态的功能 2 周之前
switches.h f6fb8cdef7 添加switch驱动模块框架 1 月之前
watchdog.c 356d7e15f0 修复看门狗bug 2 周之前
watchdog.h 6d3a380834 添加watchdog驱动模块框架 1 月之前
writeprotect.c 8f6ecfc0aa 添加writeprotect模块框架,具体功能待完善 1 月之前
writeprotect.h e7dd399dbc 添加myname模块框架 1 月之前

Readme.md

C180_oyster_driver

编译

$ make clean

$ make

加载驱动

# 加载
$ sudo insmod coral.ko
# 检查加载是否成功
$ lsmod | grep coral

# 卸载
$ sudo rmmod coral

1. Test for gsensor:

# 检查 Verifone 接口
$ ls -la /sys/kernel/vfiec/gsensor/

# 检查是否启用
$ cat /sys/kernel/vfiec/gsensor/enable
# 应输出: 1

# 启用传感器
$ echo 1 | sudo tee /sys/kernel/vfiec/gsensor/enable

# 读取屏幕方向(字符串)
$ cat /sys/kernel/vfiec/gsensor/screen_orientation
# 应输出: portrait, landscape, portrait_flip, 或 landscape_flip

# 读取屏幕方向(十六进制)
$ cat /sys/kernel/vfiec/gsensor/instantaneous_orientation
# 应输出: 0x14, 0x15, 0x16, 或 0x17

# 查看原始数据
$ cat /sys/kernel/vfiec/gsensor/raw_data
# 应输出: X Y Z 值(单位: mg)

# 查看当前模式
$ cat /sys/kernel/vfiec/gsensor/mode
# 输出示例: 0x03 (BIT0=1:中断模式, BIT1=1:已初始化)

# 切换到轮询模式
$ echo 0x01 | sudo tee /sys/kernel/vfiec/gsensor/mode

# 查看状态
$ cat /sys/kernel/vfiec/gsensor/state
# BIT0: 是否启用, BIT1: 中断是否启用

# Test with sh script:
$ sudo test_app/test_gsensor.sh