{"id":27275233,"url":"https://github.com/libdriver/mma7660fc","last_synced_at":"2026-04-24T22:31:40.005Z","repository":{"id":285942767,"uuid":"958700465","full_name":"libdriver/mma7660fc","owner":"libdriver","description":"MMA7660FC full-featured driver library for general-purpose MCU and Linux.","archived":false,"fork":false,"pushed_at":"2025-10-26T00:52:06.000Z","size":4213,"stargazers_count":20,"open_issues_count":0,"forks_count":4,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-10-26T02:40:01.662Z","etag":null,"topics":["accelerometer","c","full-featured-driver","iic","linux","mcu","mma7660fc"],"latest_commit_sha":null,"homepage":"https://www.libdriver.com","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libdriver.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-01T16:11:27.000Z","updated_at":"2025-10-26T00:51:46.000Z","dependencies_parsed_at":"2025-10-26T02:33:09.618Z","dependency_job_id":"9e07ff80-f4dc-4adc-9421-71ab5f4baf39","html_url":"https://github.com/libdriver/mma7660fc","commit_stats":null,"previous_names":["libdriver/mma7660fc"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/libdriver/mma7660fc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libdriver%2Fmma7660fc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libdriver%2Fmma7660fc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libdriver%2Fmma7660fc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libdriver%2Fmma7660fc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libdriver","download_url":"https://codeload.github.com/libdriver/mma7660fc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libdriver%2Fmma7660fc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32243129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accelerometer","c","full-featured-driver","iic","linux","mcu","mma7660fc"],"created_at":"2025-04-11T15:47:57.950Z","updated_at":"2026-04-24T22:31:39.997Z","avatar_url":"https://github.com/libdriver.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[English](/README.md) | [ 简体中文](/README_zh-Hans.md) | [繁體中文](/README_zh-Hant.md) | [日本語](/README_ja.md) | [Deutsch](/README_de.md) | [한국어](/README_ko.md)\n\n\u003cdiv align=center\u003e\n\u003cimg src=\"/doc/image/logo.svg\" width=\"400\" height=\"150\"/\u003e\n\u003c/div\u003e\n\n## LibDriver MMA7660FC\n\n[![MISRA](https://img.shields.io/badge/misra-compliant-brightgreen.svg)](/misra/README.md) [![API](https://img.shields.io/badge/api-reference-blue.svg)](https://www.libdriver.com/docs/mma7660fc/index.html) [![License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](/LICENSE)\n\nThe MMA7660FC is a ±1.5 g 3-Axis Accelerometer with Digital Output(I2C). It is a very low power, low profile capacitive MEMS sensor featuring a low pass filter, compensation for 0g offset and gain errors, and conversion to 6-bit digital values at a user configurable samples per second. The device can be used for sensor data changes, product orientation, and gesture detection through an interrupt pin (INT). The device is housed in a small 3mm x 3mm x 0.9mm DFN package.\n\nLibDriver MMA7660FC is a full-featured driver for MMA7660FC, launched by LibDriver. It provides acceleration reading, shake detection, tap detection, motion detection and additional features. LibDriver is MISRA compliant.\n\n### Table of Contents\n\n  - [Instruction](#Instruction)\n  - [Install](#Install)\n  - [Usage](#Usage)\n    - [example basic](#example-basic)\n    - [example motion](#example-motion)\n  - [Document](#Document)\n  - [Contributing](#Contributing)\n  - [License](#License)\n  - [Contact Us](#Contact-Us)\n\n### Instruction\n\n/src includes LibDriver MMA7660FC source files.\n\n/interface includes LibDriver MMA7660FC IIC platform independent template.\n\n/test includes LibDriver MMA7660FC driver test code and this code can test the chip necessary function simply.\n\n/example includes LibDriver MMA7660FC sample code.\n\n/doc includes LibDriver MMA7660FC offline document.\n\n/datasheet includes MMA7660FC datasheet.\n\n/project includes the common Linux and MCU development board sample code. All projects use the shell script to debug the driver and the detail instruction can be found in each project's README.md.\n\n/misra includes the LibDriver MISRA code scanning results.\n\n### Install\n\nReference /interface IIC platform independent template and finish your platform IIC driver.\n\nAdd the /src directory, the interface driver for your platform, and your own drivers to your project, if you want to use the default example drivers, add the /example directory to your project.\n\n### Usage\n\nYou can refer to the examples in the /example directory to complete your own driver. If you want to use the default programming examples, here's how to use them.\n\n#### example basic\n\n```C\n#include \"driver_mma7660fc_basic.h\"\n\nuint8_t res;\nuint32_t i;\nfloat g[3];\n\n/* basic init */\nres = mma7660fc_basic_init();\nif (res != 0)\n{\n    return 1;\n}\n\n...\n    \n/* loop */\nfor (i = 0; i \u003c 3; i++)\n{\n    /* delay 1000ms */\n    mma7660fc_interface_delay_ms(1000);\n\n    /* read data */\n    res = mma7660fc_basic_read(g);\n    if (res != 0)\n    {\n        (void)mma7660fc_basic_deinit();\n\n        return 1;\n    }\n    \n    ...\n        \n    /* output */\n    mma7660fc_interface_debug_print(\"mma7660fc: %d/%d.\\n\", (uint32_t)(i + 1), (uint32_t)3);\n    mma7660fc_interface_debug_print(\"mma7660fc: x is %0.2fg.\\n\", g[0]);\n    mma7660fc_interface_debug_print(\"mma7660fc: y is %0.2fg.\\n\", g[1]);\n    mma7660fc_interface_debug_print(\"mma7660fc: z is %0.2fg.\\n\", g[2]);\n}\n\n...\n    \n/* deinit */\n(void)mma7660fc_basic_deinit();\n\nreturn 0;\n```\n\n#### example motion\n\n```C\n#include \"driver_mma7660fc_motion.h\"\n\nuint8_t res;\nuint32_t i;\nuint32_t timeout = 10000;\nuint8_t (*g_gpio_irq)(void) = NULL;\nvolatile uint16_t gs_flag = 0;\n\nstatic void a_receive_callback(uint8_t type)\n{\n    switch (type)\n    {\n        case MMA7660FC_STATUS_FRONT :\n        {\n            mma7660fc_interface_debug_print(\"mma7660fc: irq front.\\n\");\n            gs_flag |= 1 \u003c\u003c 0;\n            \n            break;\n        }\n        case MMA7660FC_STATUS_BACK :\n        {\n            mma7660fc_interface_debug_print(\"mma7660fc: irq back.\\n\");\n            gs_flag |= 1 \u003c\u003c 1;\n            \n            break;\n        }\n        case MMA7660FC_STATUS_LEFT :\n        {\n            mma7660fc_interface_debug_print(\"mma7660fc: irq left.\\n\");\n            gs_flag |= 1 \u003c\u003c 2;\n            \n            break;\n        }\n        case MMA7660FC_STATUS_RIGHT :\n        {\n            mma7660fc_interface_debug_print(\"mma7660fc: irq right.\\n\");\n            gs_flag |= 1 \u003c\u003c 3;\n            \n            break;\n        }\n        case MMA7660FC_STATUS_DOWN :\n        {\n            mma7660fc_interface_debug_print(\"mma7660fc: irq down.\\n\");\n            gs_flag |= 1 \u003c\u003c 4;\n            \n            break;\n        }\n        case MMA7660FC_STATUS_UP :\n        {\n            mma7660fc_interface_debug_print(\"mma7660fc: irq up.\\n\");\n            gs_flag |= 1 \u003c\u003c 5;\n            \n            break;\n        }\n        case MMA7660FC_STATUS_TAP :\n        {\n            mma7660fc_interface_debug_print(\"mma7660fc: irq tap.\\n\");\n            gs_flag |= 1 \u003c\u003c 6;\n            \n            break;\n        }\n        case MMA7660FC_STATUS_UPDATE :\n        {\n            mma7660fc_interface_debug_print(\"mma7660fc: irq update.\\n\");\n            \n            break;\n        }\n        case MMA7660FC_STATUS_SHAKE :\n        {\n            mma7660fc_interface_debug_print(\"mma7660fc: irq shake.\\n\");\n            gs_flag |= 1 \u003c\u003c 7;\n            \n            break;\n        }\n        case MMA7660FC_STATUS_AUTO_SLEEP :\n        {\n            mma7660fc_interface_debug_print(\"mma7660fc: irq auto sleep.\\n\");\n            gs_flag |= 1 \u003c\u003c 8;\n            \n            break;\n        }\n        case MMA7660FC_STATUS_AUTO_WAKE_UP :\n        {\n            mma7660fc_interface_debug_print(\"mma7660fc: irq auto wake up.\\n\");\n            gs_flag |= 1 \u003c\u003c 9;\n            \n            break;\n        }\n        default :\n        {\n            mma7660fc_interface_debug_print(\"mma7660fc: unknown code.\\n\");\n            \n            break;\n        }\n    }\n}\n\n/* interrupt init */\ng_gpio_irq = mma7660fc_motion_irq_handler;\nres = gpio_interrupt_init();\nif (res != 0)\n{\n    g_gpio_irq = NULL;\n\n    return 1;\n}\n\n/* run motion test */\nres = mma7660fc_motion_init(a_receive_callback);\nif (res != 0)\n{\n    gpio_interrupt_deinit();\n    g_gpio_irq = NULL;\n\n    return 1;\n}\n\n...\n    \n/* init 0 */\ngs_flag = 0;\n\n/* loop */\nfor (i = 0; i \u003c timeout; i++)\n{\n    if (gs_flag == 0x3FF)\n    {\n        break;\n    }\n\n    /* delay 1ms */\n    mma7660fc_interface_delay_ms(1);\n    \n    ...\n}\n\nif (timeout != 0)\n{\n    /* finish motion */\n    mma7660fc_interface_debug_print(\"mma7660fc: finish motion.\\n\");\n}\nelse\n{\n    /* timeout */\n    mma7660fc_interface_debug_print(\"mma7660fc: timeout.\\n\");\n}\n\n...\n    \nmma7660fc_motion_deinit();\ngpio_interrupt_deinit();\ng_gpio_irq = NULL;\n\nreturn 0;\n```\n\n\n### Document\n\nOnline documents: [https://www.libdriver.com/docs/mma7660fc/index.html](https://www.libdriver.com/docs/mma7660fc/index.html).\n\nOffline documents: /doc/html/index.html.\n\n### Contributing\n\nPlease refer to CONTRIBUTING.md.\n\n### License\n\nCopyright (c) 2015 - present LibDriver All rights reserved\n\n\n\nThe MIT License (MIT) \n\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\n\nof this software and associated documentation files (the \"Software\"), to deal\n\nin the Software without restriction, including without limitation the rights\n\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\ncopies of the Software, and to permit persons to whom the Software is\n\nfurnished to do so, subject to the following conditions: \n\n\n\nThe above copyright notice and this permission notice shall be included in all\n\ncopies or substantial portions of the Software. \n\n\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n\nSOFTWARE. \n\n### Contact Us\n\nPlease send an e-mail to lishifenging@outlook.com.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibdriver%2Fmma7660fc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibdriver%2Fmma7660fc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibdriver%2Fmma7660fc/lists"}