{"id":19738425,"url":"https://github.com/sensirion/embedded-i2c-svm4x","last_synced_at":"2025-02-27T22:25:18.233Z","repository":{"id":149345803,"uuid":"429113139","full_name":"Sensirion/embedded-i2c-svm4x","owner":"Sensirion","description":"Generic embedded C driver to work with the Sensirion's SVM41 sensor modules via I2C","archived":false,"fork":false,"pushed_at":"2024-05-23T18:20:37.000Z","size":696,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-10T19:29:47.047Z","etag":null,"topics":["driver","embedded","evaluation-kit","humidity","i2c","nox","sek","sensirion","svm41","svm4x","temperature","voc"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sensirion.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-17T16:06:51.000Z","updated_at":"2024-05-23T18:20:41.000Z","dependencies_parsed_at":"2025-01-10T19:29:45.847Z","dependency_job_id":"d0efdce9-e388-4bb2-a785-bcba7a8b4d8f","html_url":"https://github.com/Sensirion/embedded-i2c-svm4x","commit_stats":null,"previous_names":["sensirion/embedded-i2c-svm4x"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fembedded-i2c-svm4x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fembedded-i2c-svm4x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fembedded-i2c-svm4x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fembedded-i2c-svm4x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sensirion","download_url":"https://codeload.github.com/Sensirion/embedded-i2c-svm4x/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241067964,"owners_count":19903929,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["driver","embedded","evaluation-kit","humidity","i2c","nox","sek","sensirion","svm41","svm4x","temperature","voc"],"created_at":"2024-11-12T01:14:09.421Z","updated_at":"2025-02-27T22:25:18.206Z","avatar_url":"https://github.com/Sensirion.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sensirion Embedded I2C SVM4x Driver\n\nThis is a generic embedded driver for the [Sensirion SVM4x Evaluation Kit](https://www.sensirion.com/my-sgp-ek/).\nIt enables developers to communicate with the SVM4x evaluation kit on different hardware platforms by only adapting the I2C communication related source files.\n\nThe SVM4x evaluation kit covers evaluation of the SGP40 and SGP41 sensors.\n\n\u003ccenter\u003e\u003cimg src=\"images/SVM41.png\" width=\"500px\"\u003e\u003c/center\u003e\n\n# Getting started\n\n## Implement the I2C Interface\n\nSo we need to adjust two files according to your platform.\n\n### Edit `sensirion_i2c_hal.c`\n\nThis file contains the implementation of the sensor communication, which\ndepends on your hardware platform. We provide function stubs for your\nhardware's own implementation.\nSample implementations are available for some platforms:\n[`sample-implementations`](sample-implementations). For Linux based platforms\nlike Raspberry Pi you can just replace the unimplemented HAL template with the\nimplementation in `sample-implementations/linux_user_space/`:\n\n```\ncp sample-implementations/linux_user_space/sensirion_i2c_hal.c ./\n```\n\n### Edit `sensirion_config.h`\n\nSkip this part for Linux based platforms since everything is already setup for\nthis case.\n\nOtherwise you need to check if the libraries `\u003cstdint.h\u003e` and `\u003cstdlib.h\u003e` are\nprovided by your toolchain, compiler or system. If you have no idea on how to\ndo that you can skip this step for now and come back when you get errors\nrelated to these names when compiling the driver.\nThe features we use from those libraries are type definitions for integer sizes\nfrom `\u003cstdint.h\u003e` and `NULL` from `\u003cstdlib.h\u003e`. If they are not available you\nneed to specify the following integer types yourself:\n\n* `int64_t` = signed 64bit integer\n* `uint64_t` = unsigned 64bit integer\n* `int32_t` = signed 32bit integer\n* `uint32_t` = unsigned 32bit integer\n* `int16_t` = signed 16bit integer\n* `uint16_t` = unsigned 16bit integer\n* `int8_t` = signed 8bit integer\n* `uint8_t` = unsigned 8bit integer\n\nIn addition to that you will need to specify `NULL`. For both we have a\ndetailed template where you just need to fill in your system specific values.\n\nNow we are ready to compile and run the example usage for your sensor.\n\n## Compile and Run\n\nPass the source `.c` and header `.h` files in this folder into your C compiler\nand run the resulting binary. This step may vary, depending on your platform.\nHere we demonstrate the procedure for Linux based platforms:\n\n1. Open up a terminal.\n2. Navigate to the directory where this README is located.\n3. Run `make` (this compiles the example code into one executable binary).\n4. Run the compiled executable with `./svm41_i2c_example_usage`\n5. Now you should see the first measurement values appear in your terminal. As\n   a next step you can adjust the example usage file or write your own main\n   function to use the sensor.\n\n# Background\n\n## Files\n\n### sensirion\\_i2c.[ch]\n\nIn these files you can find the implementation of the I2C protocol used by\nSensirion sensors. The functions in these files are used by the embedded driver\nto build the correct frame out of data to be sent to the sensor or receive a\nframe of data from the sensor and convert it back to data readable by your\nmachine. The functions in here calculate and check CRCs, reorder bytes for\ndifferent byte orders and build the correct formatted frame for your sensor.\n\n### sensirion\\_i2c\\_hal.[ch]\n\nThese files contain the implementation of the hardware abstraction layer used\nby Sensirion's I2C embedded drivers. This part of the code is specific to the\nunderlying hardware platform. This is an unimplemented template for the user to\nimplement. In the `sample-implementations/` folder we provide implementations\nfor the most common platforms.\n\n### sensirion\\_config.h\n\nIn this file we keep all the included libraries for our drivers and global\ndefines. Next to `sensirion_i2c_hal.c` *it's the only file you should need to\nedit to get your driver working.*\n\n### sensirion\\_common.[ch]\n\nIn these files you can find some helper functions used by Sensirion's embedded\ndrivers. It mostly contains byte order conversions for different variable\ntypes. These functions are also used by the UART embedded drivers therefore\nthey are kept in their own file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensirion%2Fembedded-i2c-svm4x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsensirion%2Fembedded-i2c-svm4x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensirion%2Fembedded-i2c-svm4x/lists"}