{"id":20795823,"url":"https://github.com/melexis/mlx90632-library","last_synced_at":"2025-05-06T07:36:03.642Z","repository":{"id":46952881,"uuid":"112714464","full_name":"melexis/mlx90632-library","owner":"melexis","description":"MLX90632 library for the Melexis 90632 Infra Red temperature sensor.","archived":false,"fork":false,"pushed_at":"2024-11-07T09:51:41.000Z","size":656,"stargazers_count":44,"open_issues_count":6,"forks_count":15,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-11-07T10:35:58.317Z","etag":null,"topics":["driver","library","sensor","sensors","temperature-sensor"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/melexis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2017-12-01T08:27:06.000Z","updated_at":"2024-10-24T07:59:35.000Z","dependencies_parsed_at":"2024-08-05T23:27:51.782Z","dependency_job_id":null,"html_url":"https://github.com/melexis/mlx90632-library","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melexis%2Fmlx90632-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melexis%2Fmlx90632-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melexis%2Fmlx90632-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melexis%2Fmlx90632-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/melexis","download_url":"https://codeload.github.com/melexis/mlx90632-library/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225063302,"owners_count":17415069,"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","library","sensor","sensors","temperature-sensor"],"created_at":"2024-11-17T16:24:14.040Z","updated_at":"2024-11-17T16:24:15.297Z","avatar_url":"https://github.com/melexis.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/melexis/mlx90632-library.svg?branch=master)](https://travis-ci.org/melexis/mlx90632-library)\n[![Coverage Status](https://coveralls.io/repos/github/melexis/mlx90632-library/badge.svg?branch=master)](https://coveralls.io/github/melexis/mlx90632-library?branch=master)\n![Uncrustify](https://img.shields.io/badge/uncrustify-pass-brightgreen.svg)\n[![Coverity Scan](https://img.shields.io/coverity/scan/14522.svg)](https://scan.coverity.com/projects/melexis-mlx90632-library)\n[![Documentation](https://img.shields.io/badge/Documentation-published-brightgreen.svg)](https://melexis.github.io/mlx90632-library/)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4367/badge)](https://bestpractices.coreinfrastructure.org/projects/4367)\n[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/melexis/mlx90632-library/issues)\n\nThis is 90632 example driver with virtual i2c read/write functions. There will\nbe some mapping needed with MCU's own i2c read/write procedures, but the core\ncalculations should remain the same. Functions that need to be implemented for\neach individual MCU are listed in `mlx90632_depends.h` file.\n\nSince there is one source and two header files they can be built also just as\nnormal source files. They are dependent on mathlib and errno so appropriate flags are\nrequired. For ease of development and unit-testing Makefile was added with\nfollowing targets:\n\n```\n# All targets can take `CC=clang` variable, otherwise default compiler is GCC. If\n# you need to cross-compile just feed `CROSS_COMPILE` variable to Makefile\n\nmake libs\t# builds library with single file. Include inc/ for header definitions\nmake doxy\t# builds doxygen documentation in build/html/\nmake utest\t# builds and runs unit test program mlx90632 (dependent on ceedling)\nmake all\t# builds unit tests, doxygen documentation, coverage information and library\nmake coverage   # builds coverage information\nmake clean\t# cleans the crap make has made\nmake uncrustify # style fixup of the source, header and test files\n```\n# Documentation\nCompiled documentation is available on [melexis.github.io/mlx90632-library](https://melexis.github.io/mlx90632-library/).\nDatasheet is available in [Melexis documentation](https://www.melexis.com/en/documents/documentation/datasheets/datasheet-mlx90632).\n\n# Example program flow\nYou can either include library directly or object file. Definitions are found\nin library `inc/` folder and you need to point your compiler `-I` flag there.\n\nAfter you have your environment set you need to enter below flow to your program.\n\n```C\n#include \"mlx90632.h\"\n\n/* Declare and implement here functions you find in mlx90632_depends.h */\n\n/* You can use global or local storage for EEPROM register values so declare\n * them whereever you want. Do not forget to declare ambient_new_raw,\n * ambient_old_raw, object_new_raw, object_old_raw\n */\nint main(void)\n{\n    int32_t ret = 0; /**\u003c Variable will store return values */\n    double ambient; /**\u003c Ambient temperature in degrees Celsius */\n    double object; /**\u003c Object temperature in degrees Celsius */\n\n    /* Read sensor EEPROM registers needed for calcualtions */\n\n    /* Now we read current ambient and object temperature */\n    ret = mlx90632_read_temp_raw(\u0026ambient_new_raw, \u0026ambient_old_raw,\n                                 \u0026object_new_raw, \u0026object_old_raw);\n    if(ret \u003c 0)\n        /* Something went wrong - abort */\n        return ret;\n\n    /* Now start calculations (no more i2c accesses) */\n    /* Calculate ambient temperature */\n    ambient = mlx90632_calc_temp_ambient(ambient_new_raw, ambient_old_raw,\n                                         P_T, P_R, P_G, P_O, Gb);\n\n    /* Get preprocessed temperatures needed for object temperature calculation */\n    double pre_ambient = mlx90632_preprocess_temp_ambient(ambient_new_raw,\n                                                          ambient_old_raw, Gb);\n    double pre_object = mlx90632_preprocess_temp_object(object_new_raw, object_old_raw,\n                                                        ambient_new_raw, ambient_old_raw,\n                                                        Ka);\n    /* Calculate object temperature */\n    object = mlx90632_calc_temp_object(pre_object, pre_ambient, Ea, Eb, Ga, Fa, Fb, Ha, Hb);\n}\n```\n\n# Example program flow for extended mode\nYou can either include library directly or object file. Definitions are found\nin library `inc/` folder and you need to point your compiler `-I` flag there.\n\nAfter you have your environment set you need to enter below flow to your program.\n\n```C\n#include \"mlx90632.h\"\n\n/* Declare and implement here functions you find in mlx90632_depends.h */\n\n/* You can use global or local storage for EEPROM register values so declare\n * them whereever you want. Do not forget to declare ambient_new_raw,\n * ambient_old_raw, object_new_raw, object_old_raw\n */\nint main(void)\n{\n    int32_t ret = 0; /**\u003c Variable will store return values */\n    double ambient; /**\u003c Ambient temperature in degrees Celsius */\n    double object; /**\u003c Object temperature in degrees Celsius */\n\n    /* Read sensor EEPROM registers needed for calcualtions */\n\n    /* You can check if the device supports extended measurement mode */\n    ret = mlx90632_init();\n    if(status == ERANGE)\n    {\n       /* Extended mode is supported */\n    }\n\n    /* Set MLX90632 in extended mode */\n    ret = mlx90632_set_meas_type(MLX90632_MTYP_EXTENDED)\n    if(ret \u003c 0)\n        /* Something went wrong - abort */\n        return ret;\n\n    /* Now we read current ambient and object temperature */\n    ret = mlx90632_read_temp_raw_extended(\u0026ambient_new_raw, \u0026ambient_old_raw, \u0026object_new_raw);\n    if(ret \u003c 0)\n        /* Something went wrong - abort */\n        return ret;\n\n    /* Now start calculations (no more i2c accesses) */\n    /* Calculate ambient temperature */\n    ambient = mlx90632_calc_temp_ambient_extended(ambient_new_raw, ambient_old_raw,\n                                                  PT, PR, PG, PO, Gb);\n\n    /* Get preprocessed temperatures needed for object temperature calculation */\n    double pre_ambient = mlx90632_preprocess_temp_ambient_extended(ambient_new_raw,\n                                                                   ambient_old_raw, Gb);\n    double pre_object = mlx90632_preprocess_temp_object_extended(object_new_raw, ambient_new_raw,\n                                                                 ambient_old_raw, Ka);\n\n    /* Calculate object temperature assuming the reflected temperature equals ambient*/\n    object = mlx90632_calc_temp_object_extended(pre_object, pre_ambient, ambient, Ea, Eb, Ga, Fa, Fb, Ha, Hb);\n}\n```\n\n# Example program flow for burst mode\nYou can either include library directly or object file. Definitions are found\nin library `inc/` folder and you need to point your compiler `-I` flag there.\n\nAfter you have your environment set you need to enter below flow to your program.\n\n```C\n#include \"mlx90632.h\"\n\n/* Declare and implement here functions you find in mlx90632_depends.h */\n\n/* You can use global or local storage for EEPROM register values so declare\n * them whereever you want. Do not forget to declare ambient_new_raw,\n * ambient_old_raw, object_new_raw, object_old_raw\n */\nint main(void)\n{\n    int32_t ret = 0; /**\u003c Variable will store return values */\n    double ambient; /**\u003c Ambient temperature in degrees Celsius */\n    double object; /**\u003c Object temperature in degrees Celsius */\n\n    /* Read sensor EEPROM registers needed for calcualtions */\n\n    /* Set MLX90632 in burst mode */\n    ret = mlx90632_set_meas_type(MLX90632_MTYP_MEDICAL_BURST)\n    if(ret \u003c 0)\n        /* Something went wrong - abort */\n        return ret;\n\n    /* Now we read current ambient and object temperature */\n    ret = mlx90632_read_temp_raw_burst(\u0026ambient_new_raw, \u0026ambient_old_raw,\n                                       \u0026object_new_raw, \u0026object_old_raw);\n    if(ret \u003c 0)\n        /* Something went wrong - abort */\n        return ret;\n\n    /* Now start calculations (no more i2c accesses) */\n    /* Calculate ambient temperature */\n    ambient = mlx90632_calc_temp_ambient(ambient_new_raw, ambient_old_raw,\n                                         P_T, P_R, P_G, P_O, Gb);\n\n    /* Get preprocessed temperatures needed for object temperature calculation */\n    double pre_ambient = mlx90632_preprocess_temp_ambient(ambient_new_raw,\n                                                          ambient_old_raw, Gb);\n    double pre_object = mlx90632_preprocess_temp_object(object_new_raw, object_old_raw,\n                                                        ambient_new_raw, ambient_old_raw,\n                                                        Ka);\n    /* Calculate object temperature assuming the reflected temperature equals ambient*/\n    object = mlx90632_calc_temp_object_reflected(pre_object, pre_ambient,ambient, Ea, Eb, Ga, Fa, Fb, Ha, Hb);\n}\n```\n\n# Example program flow for extended burst mode\nYou can either include library directly or object file. Definitions are found\nin library `inc/` folder and you need to point your compiler `-I` flag there.\n\nAfter you have your environment set you need to enter below flow to your program.\n\n```C\n#include \"mlx90632.h\"\n\n/* Declare and implement here functions you find in mlx90632_depends.h */\n\n/* You can use global or local storage for EEPROM register values so declare\n * them whereever you want. Do not forget to declare ambient_new_raw,\n * ambient_old_raw, object_new_raw, object_old_raw\n */\nint main(void)\n{\n    int32_t ret = 0; /**\u003c Variable will store return values */\n    double ambient; /**\u003c Ambient temperature in degrees Celsius */\n    double object; /**\u003c Object temperature in degrees Celsius */\n\n    /* Read sensor EEPROM registers needed for calcualtions */\n\n    /* You can check if the device supports extended measurement mode */\n    ret = mlx90632_init();\n    if(status == ERANGE)\n    {\n       /* Extended mode is supported */\n    }\n\n    /* Set MLX90632 in extended burst mode */\n    ret = mlx90632_set_meas_type(MLX90632_MTYP_EXTENDED_BURST)\n    if(ret \u003c 0)\n        /* Something went wrong - abort */\n        return ret;\n\n    /* Now we read current ambient and object temperature */\n    ret = mlx90632_read_temp_raw_extended_burst(\u0026ambient_new_raw, \u0026ambient_old_raw, \u0026object_new_raw);\n    if(ret \u003c 0)\n        /* Something went wrong - abort */\n        return ret;\n\n    /* Now start calculations (no more i2c accesses) */\n    /* Calculate ambient temperature */\n    ambient = mlx90632_calc_temp_ambient_extended(ambient_new_raw, ambient_old_raw,\n                                                  PT, PR, PG, PO, Gb);\n\n    /* Get preprocessed temperatures needed for object temperature calculation */\n    double pre_ambient = mlx90632_preprocess_temp_ambient_extended(ambient_new_raw,\n                                                                   ambient_old_raw, Gb);\n    double pre_object = mlx90632_preprocess_temp_object_extended(object_new_raw, ambient_new_raw,\n                                                                 ambient_old_raw, Ka);\n\n    /* Calculate object temperature assuming the reflected temperature equals ambient*/\n    object = mlx90632_calc_temp_object_extended(pre_object, pre_ambient, ambient, Ea, Eb, Ga, Fa, Fb, Ha, Hb);\n}\n```\n\n# Dependencies for library unit-testing\nBecause of increased functionality and code size unit test, mocking and building\nframework [Ceedling](http://www.throwtheswitch.org/ceedling/) was picked to ease\nand validate development. It is an established open-source framework that brings\nin additional dependency to ruby and rake (see `.gitlab-ci` file), but it allowed\nfaster development with automatic mocking ([CMock](http://www.throwtheswitch.org/cmock/))\nand wider range of unit test macros ([Unity](http://www.throwtheswitch.org/unity/)).\nBecause of it, cloning repository requires adding a `--recursive` flag\n(so `git clone --recursive \u003curl\u003e \u003cdestination\u003e`) or initialization of submodules\nafterwards using `git submodule update --init --recursive`.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelexis%2Fmlx90632-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmelexis%2Fmlx90632-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelexis%2Fmlx90632-library/lists"}