业界动态
gps.zip_android gps驱动_slowdrq_北斗 GPS_北斗 手机GPS手机「gps.zip_android gps驱动_slowdrq_北斗 GPS_北斗 手机」
2025-01-12 11:44
#ifdef MTK_GPS_SUPPORT #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> #include <linux/types.h> #include <linux/wait.h> #include <linux/slab.h> #include <linux/fs.h> #include <linux/sched.h> #include <linux/poll.h> #include <linux/device.h> #include <linux/interrupt.h> #include <linux/delay.h> #include <linux/platform_device.h> #include <linux/cdev.h> #include <linux/errno.h> #include <asm/io.h> #include <asm/uaccess.h> #include <linux/xlog.h> #include <linux/semaphore.h> #include <linux/version.h> #include <mach/devs.h> #include <mach/mt_typedefs.h> //#define FAKE_DATA #define GPS_SUSPEND_RESUME #define GPS_CONFIGURABLE_RESET_DELAY #define GPS_DEVNAME "mt3326-gps" #define GPS_DBG_NONE(fmt, arg...) do {} while (0) #define GPS_DBG_FUNC(fmt, arg...) xlog_printk(ANDROID_LOG_DEBUG, PFX, "%s: " fmt, __FUNCTION__ ,##arg) #define GPS_ERR(fmt, arg...) xlog_printk(ANDROID_LOG_ERROR, PFX, "%s: " fmt, __FUNCTION__ ,##arg) #define GPS_WARN(fmt, arg...) xlog_printk(ANDROID_LOG_WARN, PFX, "%s" fmt, __FUNCTION__ ,##arg) #define GPS_NOTICE(fmt, arg...) xlog_printk(ANDROID_LOG_INFO, PFX, "%s: " fmt, __FUNCTION__ ,##arg) #define GPS_INFO(fmt, arg...) xlog_printk(ANDROID_LOG_INFO, PFX, "%s: " fmt, __FUNCTION__ ,##arg) #define GPS_TRC_FUNC(f) xlog_printk(ANDROID_LOG_INFO, PFX, "<%s> ", __FUNCTION__); #define GPS_TRC_VERBOSE(fmt, arg...) xlog_printk(ANDROID_LOG_VERBOSE, PFX, "%s: " fmt, __FUNCTION__ ,##arg) #define PFX "GPS: " #define GPS_DBG GPS_DBG_FUNC #define GPS_TRC GPS_DBG_NONE //GPS_TRC_FUNC #define GPS_VER GPS_DBG_NONE //GPS_TRC_VERBOSE #define IH_DBG GPS_DBG_NONE enum { GPS_PWRCTL_UNSUPPORTED = 0xFF, GPS_PWRCTL_OFF = 0x00, GPS_PWRCTL_ON = 0x01, GPS_PWRCTL_RST = 0x02, GPS_PWRCTL_OFF_FORCE = 0x03, GPS_PWRCTL_RST_FORCE = 0x04, GPS_PWRCTL_MAX = 0x05, }; enum { GPS_PWR_UNSUPPORTED = 0xFF, GPS_PWR_RESUME = 0x00, GPS_PWR_SUSPEND = 0x01, GPS_PWR_MAX = 0x02, }; enum { GPS_STATE_UNSUPPORTED = 0xFF, GPS_STATE_OFF = 0x00, GPS_STATE_INIT = 0x01, GPS_STATE_START = 0x02, GPS_STATE_STOP = 0x03, GPS_STATE_DEC_FREQ = 0x04, GPS_STATE_SLEEP = 0x05, GPS_STATE_MAX = 0x06, }; enum { GPS_PWRSAVE_UNSUPPORTED = 0xFF, GPS_PWRSAVE_DEC_FREQ = 0x00, GPS_PWRSAVE_SLEEP = 0x01, GPS_PWRSAVE_OFF = 0x02, GPS_PWRSAVE_MAX = 0x03, }; struct gps_data{ int dat_len; int dat_pos; char dat_buf[4096]; spinlock_t lock; wait_queue_head_t read_wait; struct semaphore sem; }; struct gps_sta_itm { unsigned char year; unsigned char month; unsigned char day; unsigned char hour; unsigned char minute; unsigned char sec; unsigned char count; unsigned char reason; }; struct gps_sta_obj { int index; struct gps_sta_itm items[32]; }; struct gps_drv_obj { unsigned char pwrctl; unsigned char suspend; unsigned char state; unsigned char pwrsave; int rdelay; struct kobject *kobj; struct mutex sem; struct gps_sta_obj status; struct mt3326_gps_hardware *hw; }; struct gps_dev_obj { struct class *cls; struct device *dev; dev_t devno; struct cdev chdev; struct mt3326_gps_hardware *hw; }; static struct gps_data gps_private= {0}; #if defined(FAKE_DATA) static char fake_data[] = { "$GPGGA,135036.000,2446.3713,N,12101.3605,E,1,5,1.61,191.1,M,15.1,M,,*51 " "$GPGSA,A,3,22,18,14,30,31,,,,,,,,1.88,1.61,0.98*09 " "$GPGSV,2,1,6,18,83,106,32,22,58,324,35,30,45,157,35,14,28,308,32*44 " "$GPGSV,2,2,6,40,21,254,,31,17,237,29*42 " "$GPRMC,135036.000,A,2446.37125,N,12101.36054,E,0.243,56.48,140109,,A*46 " "$GPVTG,56.48,T,,M,0.243,N,0.451,K,A*07 " }; #endif //FAKE_DATA static char *str_reason[] = {"none", "init", "monitor", "wakeup", "TTFF", "force", "unknown"}; static inline void mt3326_gps_power(struct mt3326_gps_hardware *hw, unsigned int on, unsigned int force) { static unsigned int power_on = 1; int err; GPS_DBG("Switching GPS device %s ", on ? "on" : "off"); if (!hw) { GPS_ERR("null pointer!! "); return; } if (power_on == on) { GPS_DBG("ignore power control: %d ", on); } else if (on) { if (hw->ext_power_on) { err = hw->ext_power_on(0); if (err) GPS_ERR("ext_power_on fail "); } #if 0 #ifndef MTK_MT6620 if (!hwPowerOn(MT6516_POWER_V3GTX, VOL_2800,"MT3326")) { GPS_ERR("power on fails!! "); return; } #endif #endif if (hw->ext_power_on) { err = hw->ext_power_on(1); if (err) GPS_ERR("ext_power_on fail
    以上就是本篇文章【gps.zip_android gps驱动_slowdrq_北斗 GPS_北斗 手机GPS手机「gps.zip_android gps驱动_slowdrq_北斗 GPS_北斗 手机」】的全部内容了,欢迎阅览 ! 文章地址:http://www78564.xrbh.cn/news/32539.html 
     文章      相关文章      动态      同类文章      热门文章      栏目首页      网站地图      返回首页 迅博思语移动站 http://www78564.xrbh.cn/mobile/ , 查看更多   
最新文章
党员入党誓词(精选3篇)_0.docVIP
PAGE2/NUMPAGES2党员入党誓词(精选3篇)党员入党誓词篇1三月二十八日上午,市局机关全体党员在革命烈士纪念碑前庄严宣誓。“我志
ROOT大师 电脑版v1.8.9.21144手机root工具「ROOT大师 电脑版v1.8.9.21144」
ROOT大师工具是一个常用的安卓手机刷机工具,ROOT大师工具可完美支持三星、HTC、索尼、华为、中兴、联想、酷派等近千款型号的机
gta5手游安卓版 v0.14.0gta5手机版「gta5手游安卓版 v0.14.0」
gta5手游安卓版是一款网上超级火爆好玩的都市冒险赛车竞速闯关游戏,游戏融入了多样化的玩法元素,玩家们可以自由的去挑战不同的
你的手机还好吗?手机缓存「你的手机还好吗?」
当夜深人静,娃终于睡着,拿起手机开始刷剧,然而,手机一直在转圈圈……当刚拍好短视频,兴奋地准备上传抖音和粉丝分享,然而,
仿ios备忘录手机版(notes) v3.2.5仿苹果手机「仿ios备忘录手机版(notes) v3.2.5」
苹果备忘录下载安卓版最新版分享给大家!这是一款专为安卓手机打造的仿ios系统备忘录,简洁好用,不管是记录日常琐事还是记账都
WeChat微信手机版 V8.0.11安卓版微信手机版「WeChat微信手机版 V8.0.11安卓版」
微信APP是腾讯公司推出的一款手机通讯聊天软件,为智能终端提供即时通讯服务的免费应用程序,支持跨通信运营商、跨操作系统平台
iPhone X/XS手机壳怎么选,看完这篇少走坑路iphone手机壳「iPhone X/XS手机壳怎么选,看完这篇少走坑路」
作为标准的处女座,不带套的iPhone只发生在多年前, 自iPhone6时代后凸出,iPhoneX时代天价后玻璃面板,再也没理由不上壳。使用
OPPO手机怎么玩才对?教你几个功能玩转ColorOS手机vpn「OPPO手机怎么玩才对?教你几个功能玩转ColorOS」
推广买手机,除了要看颜值、性能,其实系统也很重要,它影响手机的流畅度和日常使用个体验。随着移动办公的兴起,手机也成为很多
全球最坚固三防4G智能手机 Sonim XP7发布会三防智能手机「全球最坚固三防4G智能手机 Sonim XP7发布会」
说到三防,就绕不开Sonim这个牌子。Sonim公司是一家致力于研发和生产全球最领先的工业和户外耐用多防对讲智能手机的高科技公司,
中兴手机可以啊,性价比真高!中兴手机怎么样「中兴手机可以啊,性价比真高!」
拿到手机,背面渐变幻彩的设计太偏漂亮了,拿在手里看在眼里,赏心悦目,还有金属边框玻璃后盖,手感一绝!屏幕看起来挺舒服,自