From d4c1b31d66a22c6e9495341a6180f409d2a2802b Mon Sep 17 00:00:00 2001 From: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Tue, 13 Dec 2022 18:16:17 -0800 Subject: [PATCH 01/49] Fix README (#188) * added linting and unit testing workflow * workflow fix * add venv activation between steps * initial tc module commit * update workflow * workflow fix * workflow fix * add self-hosted workflow runner * remove setup-python from self-hosted workflow * linting stringency changes * fix workflow import errors * activate virtual env * initial tc module structure * refactor pylint workflow * ignore trailing-whitespace * add pylint ignores * fix lint errors * update docstrings * tc module structure update * fix update command opcodes * add opcode to register mapping * add collective configuration method * add method for generating cr0 write command * refactor update code generate methods * debug refactoring * spi transfer issue debugging, and mock transfer * refactor mock spi transfer to library * add gpiozero requirement until spi transfer fixed * refactor register reading * refactor set_config with helper methods * add update code generation for cr1 * refactor unit testing workflow * change workflows to dev branch only * add temperature sampling * abstract out register value updates * unit tests, negative temperature sampling bug fix * add incompatible opcode mask check * add change flags for register updates * remove magic numbers * refactor temperature conversion * expand opcode unit tests * add unit test documentation * add debug message to custom error * clean up comments * expand apply_opcode unit testing * remove redundant dictionary assignment * fix incompatible mask checking bug * pull request fixes * replace bitwise ops with bitstring pack * add bitstring to requirements * Revert "add bitstring to requirements" This reverts commit 3375cc622aad956238d5e821a3c06a08bd1fb374. * add bitstring to package dependencies * add package install documentation * add exceptions testing for code_to_temp * add edge-cases to code_to_temp unit testing * Update thermocouple.md * add_change_flags unit tests * input validation, unit testing for apply_opcodes * refactor filter utility function * unit test filter_dict * update documentation * unit test negative_temp_check * cleanup outdated comments * Update thermocouple.md * update documentation * closes #25 * update documentation * refactor register value map formatting * move filter_dict to utilities module * Update and rename thermocouple.md to README.md * rename read_temps * add publishing workflows * Update README.md * Update README.md * Update README.md * add self-hosted workflow runner * remove setup-python from self-hosted workflow * fix workflow import errors * activate virtual env * initial tc module structure * refactor pylint workflow * ignore trailing-whitespace * add pylint ignores * fix lint errors * update docstrings * tc module structure update * add opcode to register mapping * add collective configuration method * add method for generating cr0 write command * refactor update code generate methods * debug refactoring * spi transfer issue debugging, and mock transfer * refactor mock spi transfer to library * add gpiozero requirement until spi transfer fixed * refactor register reading * refactor set_config with helper methods * add update code generation for cr1 * refactor unit testing workflow * change workflows to dev branch only * add temperature sampling * abstract out hardware from edgepi_tc tests * update requirements * Update README.md * update README * update package version * Update README.md * Update README.md * Update README.md * Publish SDK (#184) * update README * remove install info from tc readme * TC merge for housekeeping (#44) * add fault status reading * add fault mask configuration * tc module restructuring * update documentation * update decimal bit constants * Tc dev fixes (#36) * refactor fault reading * add human readable Fault printing * add option for less verbose fault reading * filter out normal status Faults * refactor fault masking to set individual masks * Gpio merge for house keeping (#42) * gpio periphery being added * gpio periphery being added * rebase gpio branch * created gpio folder and files and tests * Feature branch git action added, gpio command and constants are added * github action yml changed * testing GPIO * gpio bias keyword takenout * path typeError troubleshooting * gpio in progress #20 * disable push test until fixing the bug * Update gpio.py add all keyword args * Update gpio.py passing arguments without keyword * Update gpio.py * gpio test issue resolved #20 * working on constants * Adc rebased and merge to dev (#43) * added constants #17 * adding Methods to ADCCommand class #17 * added write_register method, testing exception as well #17 * added dataclasses for register configurations, tests are added for testing immutable class #17 * added more registers and tests, #17 * added workflow for CI, #17 * modifying linting requirements * testing * changed global user and email * user name testing * added constants #17 * adding Methods to ADCCommand class #17 * added write_register method, testing exception as well #17 * added dataclasses for register configurations, tests are added for testing immutable class #17 * added more registers and tests, #17 * modifying linting requirements * testing * changed global user and email * user name testing * modified readme back to original state Co-authored-by: SJ Park * Update README module links (#45) Adding module link to ADC now that it is merged to dev, and updating other links to use relative link (so it links to folders on the same branch as top-level readme they're being accessed from) * refactor utilities to support non Enum set_config args (#47) * refactor utilities to support non Enum set_config args * added gpio_cofings.py to add configuration data class for dac #40 (#46) * added gpio_cofings.py to add configuration data class for dac #40 * changed function description * PR #46 fixes * steven can't write :( * filter_dict by value (#53) * add names to test and lint workflows (#56) * add names to test and lint workflows * remove pytest-gpio workflow * Pytest fix (#57) * Update adc_commands.py updated adc_command to fix the pytest issue * Update adc_commands.py updated adc_command to fix the pytest issue * Edgepi gpio dac config (#55) * gpio-dac-config being implemented #20, #48, #49, #51, #16 * testing I2C * 1. Added gpio config #48 2. edgepi_gpio init method: instantiate super class when I2C gpio group selected and generate pin list #48 #51 #52 3. I2C mocking class for window and Linux environment, #16 * gpio module configurations packed as enum using enum to check configuration by iterating through the enum class * filter_dict by value (#53) * add names to test and lint workflows (#56) * add names to test and lint workflows * remove pytest-gpio workflow * added mock for testing I2C * gpio-dac-config being implemented #20, #48, #49, #51, #16 * testing I2C * 1. Added gpio config #48 2. edgepi_gpio init method: instantiate super class when I2C gpio group selected and generate pin list #48 #51 #52 3. I2C mocking class for window and Linux environment, #16 * gpio module configurations packed as enum using enum to check configuration by iterating through the enum class * added mock for testing I2C * combined repetitive dataclass fixed a problem with circular dependency * fixing pytest failures Co-authored-by: flavius-t <77416463+flavius-t@users.noreply.github.com> Co-authored-by: flavius-t * TC Open Circuit (#59) * add open fault detection mode config * Fix Linting (#65) * Fix TestPyPi (#66) * TC Compute Conversion Time (#63) * add compute conversion time * refactor single_sample for time delay computation * update time conv docstrings * inflate time delays * TC Set Temperatures (#60) * add temperature setting to set_config * add cold junction temp override method * add temperature input validation * add update_registers_from_dict and test * add temperature range validation by tc type * add custom exceptions, expand tempcode testing * add convert from DecBits to float * add cold-junction overwrite error * TC Integration Tests (#70) * separate tests to unit and integration * add thermocouple integration tests * refactoring to support tc integration testing * Edgepi gpio transfer (#62) * fixed I2C.Message Mocking * tested transfer function and it is working * set default in progress #51, #52, #50, #48 * more commands being added added more gpio state parameter in I2C info dataclass * Update edgepi_gpio.py added todo notes * set default in progress * Set default in progress another GPIO config added to I2CpinInfo dataclass adding helper methods read register and map register to dictionary * added reg helper class to generate the register dictionary. added another function to split pin list into two separate lists to check whether the gpio group uses two separate I2C expander * set-default need testing * set default tested * fixed I2C.Message Mocking * tested transfer function and it is working * set default in progress #51, #52, #50, #48 * more commands being added added more gpio state parameter in I2C info dataclass * Update edgepi_gpio.py added todo notes * set default in progress * Set default in progress another GPIO config added to I2CpinInfo dataclass adding helper methods read register and map register to dictionary * added reg helper class to generate the register dictionary. added another function to split pin list into two separate lists to check whether the gpio group uses two separate I2C expander * set-default need testing * set default tested * Update edgepi_tc.py the __ was deleted by accident * tests not passing * testing fixed * Update test_edgepi_gpio.py fixed tests * requested changed from Farzad * Todos added * working on todos, changed pin list to be self-explanatory, need to work on __generate_default_reg_dict to be more intuitie * changed naming conventions and using dictionary instead of list for describing pins * fixing pylint * fixing linting issue * fix I2C test and pylint on linux * disabled E1101 to go work around the error from mock class * fixed lint and testing mock * Unit Test Fixes (#74) * separate peripherals testing to unit/integration * testing workflow changes * Edgepi gpio toggle (#75) * adding set_gpio function modified set_default and dgenerate default reg dict -instead of using list of dictionary, using dictionary format - set expander pin uses pin_name to set corresponding gpio #49 * clear expander pin * Toggle gpio pin added #49 * pylint passed" * adding set_gpio function modified set_default and dgenerate default reg dict -instead of using list of dictionary, using dictionary format - set expander pin uses pin_name to set corresponding gpio #49 * clear expander pin * Toggle gpio pin added #49 * pylint passed" * refactored for-loop test for __write_changed_values is not added since the function doesn't return any value and only execute the transaction * Readme added while working on the readme, i realized the order of AO_ENx pins were reversed. the order is fixed now * Update edgepi_gpio.py for loop replaced with a write change value method * Add Test Coverage (#79) * add code coverage to unit test workflow * add workflow status badges * DAC Interface (#77) * add set channel power mode * add set_gain_mode * add software reset * add readback * add code to voltage * integrate with gpio module * Dac calibration (#84) * refactoring calibration parameter dataclass #9 * changed test fixture for dac_command * calibration parameter refactored * dac calibration refactored * Update test_edgepi_dac.py linter fix * added and edited suggested comments * Calibration module (#92) * #83 creating files * adding unittest * Update test_access_eeprom.py * added unittest & i2c transfer return change * adding calibration mapping and class * Update edgepi_calibration.py todo notes added * pylint fix * code review suggestions * Requested PR fixes - Nomenclature files - Reg address name change -> mem_addr - Device address is a constant now - EEPROM class * ADC Interface (#97) * Adding functions to calibration class (#98) * adding helper class for calibration process * adding functions to generate necessary dictionaries * pylint fixes * Update test_adc_state.py (#100) #99 * Get/Set Individual Pin States (#105) * LED Module (#106) * Individual channel modification (#108) * Individual channel modification #103 - Only single pins gets accessed - simplified code calculate for now, calibration to be added * fixed voltage_to_code and code_to_voltage calculation * applying suggested fix * Issue102 dac (#109) * Individual channel modification #103 - Only single pins gets accessed - simplified code calculate for now, calibration to be added * adding get_state() dac #102 dac get_state is being added * fixed voltage_to_code and code_to_voltage calculation * passing pytest * changed the key from string name to number * changed get_state function #102 osensa/edgepi-device-manager/issues/3 * pylint fix * Issue103 adc (#110) * adc testing being added * added test * Individual channel modification (#108) * Individual channel modification #103 - Only single pins gets accessed - simplified code calculate for now, calibration to be added * fixed voltage_to_code and code_to_voltage calculation * applying suggested fix * added todo and fixed pylint * used enums for pin names * Update edgepi_adc.py removed clear exapnder to avoid resetting of Ground reference when a new object is instantiated * Update edgepi_adc.py (#115) * Update edgepi_adc.py To Do added * Update edgepi_adc.py have a ruler set for pylint, and still fails on line-too-long :( * Gpio delete set default (#116) * deleting obsolete function * added unit tests for functions changed gpio pin ordering of DAC module * Loading DAC related Calibration parameter from the EEPROM (#114) * dummy functions added for calibration added logger added generate calib dictionary functions , logics to be implemented * unpacking packing added unpacking: from list of parameter that read from eeprom to a single value packing : from a value to a list of bytes to load to the eeprom * calib dictionary generation for dac * loading calib param added and tested * Update test_edgepi_calibration.py updated the unit test for get_calibration_dict. Other module test cases are deleted for now * PR#114 fix - added a dictionary of functions - added more description to the address constants * Remove ADC Init Configs (#119) * remove configs from adc init * rename to private method * Calibration dac (#120) * Update edgepi_dac.py adding calibration classes, need to check dictionary structure. implement DAC_GAIN parameter maybe needed * DAC calibration updated #111 - loading of calibration parameter from eeprom - generation and get calibration dictionary - check dac_gain state before code2voltage or voltage 2code conversion - conversion formula edited to accommodate the calibration param and dac gain state * set/clear internal DAC gain #76 * Update edgepi_dac.py PR #120 suggested fix * constant name change PR #120 suggested fix * ADC Differential Reads, RTD Mode (#118) * remove unused duplicate channel assignment code * fix pytest discovery error * add SPI debugging logs * change rtd_enabled check logic * diff read constants * rtd property check, set diff mode * unit test validate_no_rtd_conflict * unit test select_differential * ignore local test scripts * documentation additions * opcodes for RTD mode * doc updates, pytest config * unit test IDACMUX opcodes * unit test IDACMAG opcodes * fix IDACMAG opcode bug * fix REFMUX opcode bug * expand REFMUX opcode unit tests, renaming * uncomment adc config integration tests * integration test IDACMUX opcodes * integration test IDACMAG opcodes * integration test REFMUX opcodes * integration test select_differential * add idac channel 9 * fix opcode name, failing unit test * add rtd mode enums * add rtd_mode, todos for get_state with caching * rename __get_rtd_en_status * fix rtd_mode logic, unit test * integration test rtd_mode, fix bug * Remap ADC Multiplexers (#122) * mux mapping set mux_n to AINCOM * refactor mux arg handling in __config * refactor None checking, update docstring * remove temporary test fix * remove unnecessary test cases * I2C set_msg function takes list of addresses (#128) * #127 added another type for addr parameter of set_read_msg and set_write_msg to accomodate a list of addresses * | was introduced in python 3.10 but the test automation is using python 3.9 * Calibration suggestion (#129) * Nov1 code review suggestions * refactoring eeprom access module to accomodate the hardware change * EEPROM class is refactored to accomodate the larger memory size #125 * pylint fix * Eeprom protobuf (#131) * protobuf implementation #126 #124 * test added * pylint fix and update dependencies * Update requirements_test.txt * delete Todos * suggested fixes * suggested name fix * generate_calib_param dictionary added (#134) * generate_calib_param dictionary added * pytest fix * suggested fix - calib_params nomenclature - better description for docstring * suggest fix - calib param dataclass formation done in eeprom class - removed redundant methods and tests * ADC Get State (#132) * refactor get_state to EdgePiADC * refactor ADCModes * add get_register_map * use get_register_map for internal register reads * refactor ADCState * use new ADCState for getting state internally * add get mux states * refactor state query constants to module * ADC Calibration (#138) * added eeprom reading to load calibration parameter * diff/individual voltage read calibration handling #133 Co-authored-by: sjpark608 * fixed typing issue (#136) #135 added test cases for checking the type * Add ADC2 (#139) * add adc-2 to voltage reads, set_config * dac conversion formula change (#146) * dac conversion formula change #143 #144 - added updated serialized file for testing - updated formula for voltage2code code2voltage - updated unittest - added serialized read helper file - deleted outdated dac_calibration files * pylint fix * DAC Enum Args (#152) * refactor user interface to enum channel args * GPIO refactoring in progress (#156) * gpio module refactored #153 * adding test cases fixing typos * gpio module refactor adding edgpi gpio test * fix suggestions * RTD Sampling (#160) * Hardware Tests (#162) * voltage read-write test * add test report to gitignore * custom approx comparator * move adc conversion time tests * update hardware test instructions * move integration tests to new folder * diff voltage tests * add adc_2 diff test * add rtd tests * bypass rtd validation in mux mapping * fix rtd temp calculation bug * GPIO module refactoring intermediate PR (#161) * refactoring generating pin dictionary to have generic dictionary #154 #155 * generic object instantiation #154 #155 * Update test_dac.py dict_pin changed to expander_pin_dict after refactor * lint fix * Gpio refactor 154 (#167) * added gpio exception, gpio write, need some testing on the hardware #166 #154 #155 * added set direction in out function, get direction function * edgepi gpio methods gets enum values typed string * changed function name used in different modules * fixed pytest and pylint issues * added toggle pin * deleted unused module * PR #167 suggested fix - added __pin_name_check() - added more tests * GPIO DOUT pin list re-order (#169) * Update gpio_configs.py Forgotten change * fixed LED integration test * Get State Override Cache (#175) * add override cache to get state * Fix Read Voltage Validation (#176) * fix conv mode validation in read_voltage * Digital input module (#173) * adding din module and tests * Digital input reading #170 * Added test parameters * added exception and testing * digital out module #171 (#172) * Main README Update (#181) * Update README.md * update sdk package naming * update version num * added README and re-naming module (#182) * LED Module README (#183) * Create README.md * Update README.md Co-authored-by: sjpark608 <78987042+sjpark608@users.noreply.github.com> Co-authored-by: SJ Park Co-authored-by: sjpark608 * Fix README (#187) * update README * remove install info from tc readme * TC merge for housekeeping (#44) * add fault status reading * add fault mask configuration * tc module restructuring * update documentation * update decimal bit constants * Tc dev fixes (#36) * refactor fault reading * add human readable Fault printing * add option for less verbose fault reading * filter out normal status Faults * refactor fault masking to set individual masks * Gpio merge for house keeping (#42) * gpio periphery being added * gpio periphery being added * rebase gpio branch * created gpio folder and files and tests * Feature branch git action added, gpio command and constants are added * github action yml changed * testing GPIO * gpio bias keyword takenout * path typeError troubleshooting * gpio in progress #20 * disable push test until fixing the bug * Update gpio.py add all keyword args * Update gpio.py passing arguments without keyword * Update gpio.py * gpio test issue resolved #20 * working on constants * Adc rebased and merge to dev (#43) * added constants #17 * adding Methods to ADCCommand class #17 * added write_register method, testing exception as well #17 * added dataclasses for register configurations, tests are added for testing immutable class #17 * added more registers and tests, #17 * added workflow for CI, #17 * modifying linting requirements * testing * changed global user and email * user name testing * added constants #17 * adding Methods to ADCCommand class #17 * added write_register method, testing exception as well #17 * added dataclasses for register configurations, tests are added for testing immutable class #17 * added more registers and tests, #17 * modifying linting requirements * testing * changed global user and email * user name testing * modified readme back to original state Co-authored-by: SJ Park * Update README module links (#45) Adding module link to ADC now that it is merged to dev, and updating other links to use relative link (so it links to folders on the same branch as top-level readme they're being accessed from) * refactor utilities to support non Enum set_config args (#47) * refactor utilities to support non Enum set_config args * added gpio_cofings.py to add configuration data class for dac #40 (#46) * added gpio_cofings.py to add configuration data class for dac #40 * changed function description * PR #46 fixes * steven can't write :( * filter_dict by value (#53) * add names to test and lint workflows (#56) * add names to test and lint workflows * remove pytest-gpio workflow * Pytest fix (#57) * Update adc_commands.py updated adc_command to fix the pytest issue * Update adc_commands.py updated adc_command to fix the pytest issue * Edgepi gpio dac config (#55) * gpio-dac-config being implemented #20, #48, #49, #51, #16 * testing I2C * 1. Added gpio config #48 2. edgepi_gpio init method: instantiate super class when I2C gpio group selected and generate pin list #48 #51 #52 3. I2C mocking class for window and Linux environment, #16 * gpio module configurations packed as enum using enum to check configuration by iterating through the enum class * filter_dict by value (#53) * add names to test and lint workflows (#56) * add names to test and lint workflows * remove pytest-gpio workflow * added mock for testing I2C * gpio-dac-config being implemented #20, #48, #49, #51, #16 * testing I2C * 1. Added gpio config #48 2. edgepi_gpio init method: instantiate super class when I2C gpio group selected and generate pin list #48 #51 #52 3. I2C mocking class for window and Linux environment, #16 * gpio module configurations packed as enum using enum to check configuration by iterating through the enum class * added mock for testing I2C * combined repetitive dataclass fixed a problem with circular dependency * fixing pytest failures Co-authored-by: flavius-t <77416463+flavius-t@users.noreply.github.com> Co-authored-by: flavius-t * TC Open Circuit (#59) * add open fault detection mode config * Fix Linting (#65) * Fix TestPyPi (#66) * TC Compute Conversion Time (#63) * add compute conversion time * refactor single_sample for time delay computation * update time conv docstrings * inflate time delays * TC Set Temperatures (#60) * add temperature setting to set_config * add cold junction temp override method * add temperature input validation * add update_registers_from_dict and test * add temperature range validation by tc type * add custom exceptions, expand tempcode testing * add convert from DecBits to float * add cold-junction overwrite error * TC Integration Tests (#70) * separate tests to unit and integration * add thermocouple integration tests * refactoring to support tc integration testing * Edgepi gpio transfer (#62) * fixed I2C.Message Mocking * tested transfer function and it is working * set default in progress #51, #52, #50, #48 * more commands being added added more gpio state parameter in I2C info dataclass * Update edgepi_gpio.py added todo notes * set default in progress * Set default in progress another GPIO config added to I2CpinInfo dataclass adding helper methods read register and map register to dictionary * added reg helper class to generate the register dictionary. added another function to split pin list into two separate lists to check whether the gpio group uses two separate I2C expander * set-default need testing * set default tested * fixed I2C.Message Mocking * tested transfer function and it is working * set default in progress #51, #52, #50, #48 * more commands being added added more gpio state parameter in I2C info dataclass * Update edgepi_gpio.py added todo notes * set default in progress * Set default in progress another GPIO config added to I2CpinInfo dataclass adding helper methods read register and map register to dictionary * added reg helper class to generate the register dictionary. added another function to split pin list into two separate lists to check whether the gpio group uses two separate I2C expander * set-default need testing * set default tested * Update edgepi_tc.py the __ was deleted by accident * tests not passing * testing fixed * Update test_edgepi_gpio.py fixed tests * requested changed from Farzad * Todos added * working on todos, changed pin list to be self-explanatory, need to work on __generate_default_reg_dict to be more intuitie * changed naming conventions and using dictionary instead of list for describing pins * fixing pylint * fixing linting issue * fix I2C test and pylint on linux * disabled E1101 to go work around the error from mock class * fixed lint and testing mock * Unit Test Fixes (#74) * separate peripherals testing to unit/integration * testing workflow changes * Edgepi gpio toggle (#75) * adding set_gpio function modified set_default and dgenerate default reg dict -instead of using list of dictionary, using dictionary format - set expander pin uses pin_name to set corresponding gpio #49 * clear expander pin * Toggle gpio pin added #49 * pylint passed" * adding set_gpio function modified set_default and dgenerate default reg dict -instead of using list of dictionary, using dictionary format - set expander pin uses pin_name to set corresponding gpio #49 * clear expander pin * Toggle gpio pin added #49 * pylint passed" * refactored for-loop test for __write_changed_values is not added since the function doesn't return any value and only execute the transaction * Readme added while working on the readme, i realized the order of AO_ENx pins were reversed. the order is fixed now * Update edgepi_gpio.py for loop replaced with a write change value method * Add Test Coverage (#79) * add code coverage to unit test workflow * add workflow status badges * DAC Interface (#77) * add set channel power mode * add set_gain_mode * add software reset * add readback * add code to voltage * integrate with gpio module * Dac calibration (#84) * refactoring calibration parameter dataclass #9 * changed test fixture for dac_command * calibration parameter refactored * dac calibration refactored * Update test_edgepi_dac.py linter fix * added and edited suggested comments * Calibration module (#92) * #83 creating files * adding unittest * Update test_access_eeprom.py * added unittest & i2c transfer return change * adding calibration mapping and class * Update edgepi_calibration.py todo notes added * pylint fix * code review suggestions * Requested PR fixes - Nomenclature files - Reg address name change -> mem_addr - Device address is a constant now - EEPROM class * ADC Interface (#97) * Adding functions to calibration class (#98) * adding helper class for calibration process * adding functions to generate necessary dictionaries * pylint fixes * Update test_adc_state.py (#100) #99 * Get/Set Individual Pin States (#105) * LED Module (#106) * Individual channel modification (#108) * Individual channel modification #103 - Only single pins gets accessed - simplified code calculate for now, calibration to be added * fixed voltage_to_code and code_to_voltage calculation * applying suggested fix * Issue102 dac (#109) * Individual channel modification #103 - Only single pins gets accessed - simplified code calculate for now, calibration to be added * adding get_state() dac #102 dac get_state is being added * fixed voltage_to_code and code_to_voltage calculation * passing pytest * changed the key from string name to number * changed get_state function #102 osensa/edgepi-device-manager/issues/3 * pylint fix * Issue103 adc (#110) * adc testing being added * added test * Individual channel modification (#108) * Individual channel modification #103 - Only single pins gets accessed - simplified code calculate for now, calibration to be added * fixed voltage_to_code and code_to_voltage calculation * applying suggested fix * added todo and fixed pylint * used enums for pin names * Update edgepi_adc.py removed clear exapnder to avoid resetting of Ground reference when a new object is instantiated * Update edgepi_adc.py (#115) * Update edgepi_adc.py To Do added * Update edgepi_adc.py have a ruler set for pylint, and still fails on line-too-long :( * Gpio delete set default (#116) * deleting obsolete function * added unit tests for functions changed gpio pin ordering of DAC module * Loading DAC related Calibration parameter from the EEPROM (#114) * dummy functions added for calibration added logger added generate calib dictionary functions , logics to be implemented * unpacking packing added unpacking: from list of parameter that read from eeprom to a single value packing : from a value to a list of bytes to load to the eeprom * calib dictionary generation for dac * loading calib param added and tested * Update test_edgepi_calibration.py updated the unit test for get_calibration_dict. Other module test cases are deleted for now * PR#114 fix - added a dictionary of functions - added more description to the address constants * Remove ADC Init Configs (#119) * remove configs from adc init * rename to private method * Calibration dac (#120) * Update edgepi_dac.py adding calibration classes, need to check dictionary structure. implement DAC_GAIN parameter maybe needed * DAC calibration updated #111 - loading of calibration parameter from eeprom - generation and get calibration dictionary - check dac_gain state before code2voltage or voltage 2code conversion - conversion formula edited to accommodate the calibration param and dac gain state * set/clear internal DAC gain #76 * Update edgepi_dac.py PR #120 suggested fix * constant name change PR #120 suggested fix * ADC Differential Reads, RTD Mode (#118) * remove unused duplicate channel assignment code * fix pytest discovery error * add SPI debugging logs * change rtd_enabled check logic * diff read constants * rtd property check, set diff mode * unit test validate_no_rtd_conflict * unit test select_differential * ignore local test scripts * documentation additions * opcodes for RTD mode * doc updates, pytest config * unit test IDACMUX opcodes * unit test IDACMAG opcodes * fix IDACMAG opcode bug * fix REFMUX opcode bug * expand REFMUX opcode unit tests, renaming * uncomment adc config integration tests * integration test IDACMUX opcodes * integration test IDACMAG opcodes * integration test REFMUX opcodes * integration test select_differential * add idac channel 9 * fix opcode name, failing unit test * add rtd mode enums * add rtd_mode, todos for get_state with caching * rename __get_rtd_en_status * fix rtd_mode logic, unit test * integration test rtd_mode, fix bug * Remap ADC Multiplexers (#122) * mux mapping set mux_n to AINCOM * refactor mux arg handling in __config * refactor None checking, update docstring * remove temporary test fix * remove unnecessary test cases * I2C set_msg function takes list of addresses (#128) * #127 added another type for addr parameter of set_read_msg and set_write_msg to accomodate a list of addresses * | was introduced in python 3.10 but the test automation is using python 3.9 * Calibration suggestion (#129) * Nov1 code review suggestions * refactoring eeprom access module to accomodate the hardware change * EEPROM class is refactored to accomodate the larger memory size #125 * pylint fix * Eeprom protobuf (#131) * protobuf implementation #126 #124 * test added * pylint fix and update dependencies * Update requirements_test.txt * delete Todos * suggested fixes * suggested name fix * generate_calib_param dictionary added (#134) * generate_calib_param dictionary added * pytest fix * suggested fix - calib_params nomenclature - better description for docstring * suggest fix - calib param dataclass formation done in eeprom class - removed redundant methods and tests * ADC Get State (#132) * refactor get_state to EdgePiADC * refactor ADCModes * add get_register_map * use get_register_map for internal register reads * refactor ADCState * use new ADCState for getting state internally * add get mux states * refactor state query constants to module * ADC Calibration (#138) * added eeprom reading to load calibration parameter * diff/individual voltage read calibration handling #133 Co-authored-by: sjpark608 * fixed typing issue (#136) #135 added test cases for checking the type * Add ADC2 (#139) * add adc-2 to voltage reads, set_config * dac conversion formula change (#146) * dac conversion formula change #143 #144 - added updated serialized file for testing - updated formula for voltage2code code2voltage - updated unittest - added serialized read helper file - deleted outdated dac_calibration files * pylint fix * DAC Enum Args (#152) * refactor user interface to enum channel args * GPIO refactoring in progress (#156) * gpio module refactored #153 * adding test cases fixing typos * gpio module refactor adding edgpi gpio test * fix suggestions * RTD Sampling (#160) * Hardware Tests (#162) * voltage read-write test * add test report to gitignore * custom approx comparator * move adc conversion time tests * update hardware test instructions * move integration tests to new folder * diff voltage tests * add adc_2 diff test * add rtd tests * bypass rtd validation in mux mapping * fix rtd temp calculation bug * GPIO module refactoring intermediate PR (#161) * refactoring generating pin dictionary to have generic dictionary #154 #155 * generic object instantiation #154 #155 * Update test_dac.py dict_pin changed to expander_pin_dict after refactor * lint fix * Gpio refactor 154 (#167) * added gpio exception, gpio write, need some testing on the hardware #166 #154 #155 * added set direction in out function, get direction function * edgepi gpio methods gets enum values typed string * changed function name used in different modules * fixed pytest and pylint issues * added toggle pin * deleted unused module * PR #167 suggested fix - added __pin_name_check() - added more tests * GPIO DOUT pin list re-order (#169) * Update gpio_configs.py Forgotten change * fixed LED integration test * Get State Override Cache (#175) * add override cache to get state * Fix Read Voltage Validation (#176) * fix conv mode validation in read_voltage * Digital input module (#173) * adding din module and tests * Digital input reading #170 * Added test parameters * added exception and testing * digital out module #171 (#172) * Main README Update (#181) * Update README.md * update sdk package naming * update version num * added README and re-naming module (#182) * LED Module README (#183) * Create README.md * Update README.md * Fix README (#186) Co-authored-by: sjpark608 <78987042+sjpark608@users.noreply.github.com> Co-authored-by: SJ Park Co-authored-by: sjpark608 Co-authored-by: sjpark608 <78987042+sjpark608@users.noreply.github.com> Co-authored-by: SJ Park Co-authored-by: sjpark608 --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c167262c..81f57ef5 100644 --- a/README.md +++ b/README.md @@ -47,20 +47,22 @@ The EdgePi SDK contains modules intended to represent each connected peripheral * [Digital to Analog Converter (DAC)](src/edgepi/dac) * [Analog to Digital Converter (ADC)](src/edgepi/adc) * [LED Array](src/edgepi/led) -* [Digital In (DIN)](src/edgepi/din) -* [Digital Out (DOUT)](src/edgepi/dout) +* [Digital Input (DIN)](src/edgepi/digital_input) +* [Digital Output (DOUT)](src/edgepi/digital_output) # Development Active development SDK versions can be accessed from the following resources: ## Installing from TestPyPi To install the most recent active development SDK version via [TestPyPi](https://test.pypi.org/project/edgepi-python-sdk/): ``` -$ python3 -m pip install -i https://test.pypi.org/simple/ edgepi-python-sdk + +$ python3 -m pip install -i https://test.pypi.org/simple/edgepi-python-sdk ``` Previous development SDK versions can also be installed by specifiying the version number: ``` -$ python3 -m pip install -i https://test.pypi.org/simple/ edgepi-python-sdk== +$ python3 -m pip install -i https://test.pypi.org/simple/edgepi-python-sdk== ``` Please refer to [TestPyPi](https://test.pypi.org/project/edgepi-python-sdk/) for available SDK versions. + ## Installing from GitHub To install the SDK via HTTPS from GitHub: ``` From 10e392fd8852984ac651702cf7c2d8d3982150e4 Mon Sep 17 00:00:00 2001 From: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Thu, 15 Dec 2022 15:25:40 -0800 Subject: [PATCH 02/49] Publishing Workflow Fixes (#199) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix Publishing Workflows (#192) * new auto bump method * add release workflow Co-authored-by: bot-edgepi * re-add package build dependencies (#193) * Disable Integration Test Workflow (#195) * change python to python3 * update test path * disable integration test workflow * Publishing Workflow Fixes (#196) * Fix Publishing Workflows (#192) * new auto bump method * add release workflow * re-add package build dependencies (#193) * Disable Integration Test Workflow (#195) * change python to python3 * update test path * disable integration test workflow Co-authored-by: bot-edgepi * Bump version: 1.1.8 → 1.1.9 * remove integration test workflow (#197) * remove integration test workflow * bump versions due to failed staging run * Bump version: 1.1.9 → 1.1.10 Co-authored-by: bot-edgepi --- .bumpversion.cfg | 3 ++ .github/workflows/build-and-publish-PyPI.yml | 12 ++++--- .../workflows/build-and-publish-TestPyPI.yml | 25 ++++++++++--- .github/workflows/create-release-tag.yml | 31 ++++++++++++++++ .github/workflows/python-integration-test.yml | 35 ------------------- bump_patch.py | 35 ------------------- setup.py | 2 +- 7 files changed, 63 insertions(+), 80 deletions(-) create mode 100644 .bumpversion.cfg create mode 100644 .github/workflows/create-release-tag.yml delete mode 100644 .github/workflows/python-integration-test.yml delete mode 100644 bump_patch.py diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 00000000..dfebd998 --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,3 @@ +[bumpversion] +tag_name = "rc/v{new_version}" +current_version = 1.1.10 diff --git a/.github/workflows/build-and-publish-PyPI.yml b/.github/workflows/build-and-publish-PyPI.yml index bf92ed52..f639fcf3 100644 --- a/.github/workflows/build-and-publish-PyPI.yml +++ b/.github/workflows/build-and-publish-PyPI.yml @@ -1,15 +1,16 @@ # This workflow will build and publish the package to PyPI upon push or merge to main branch +# and then create a GitHub release based on latest release tag -name: Build and Publish to PyPI +name: Build and Release on: push: - branches: - - 'main' + tags: + - release/* jobs: build-and-publish: - name: Build and publish Package to PyPI + name: Publish to PyPi and Release runs-on: ubuntu-latest steps: - name: Checkout @@ -28,6 +29,7 @@ jobs: - name: Publish Package to PyPI uses: pypa/gh-action-pypi-publish@v1.5.0 with: - # TODO: add PyPI user password or access token user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} + - name: Release Package + uses: ncipollo/release-action@v1.12.0 diff --git a/.github/workflows/build-and-publish-TestPyPI.yml b/.github/workflows/build-and-publish-TestPyPI.yml index 2299a8be..a097c5a0 100644 --- a/.github/workflows/build-and-publish-TestPyPI.yml +++ b/.github/workflows/build-and-publish-TestPyPI.yml @@ -1,4 +1,5 @@ -# This workflow will build and publish the package to TestPyPI upon push or merge to dev branch +# This workflow will increment version patch number, and build and publish +# the python package to TestPyPI upon push or merge to staging branch name: Build and Publish to TestPyPI @@ -6,6 +7,10 @@ on: push: branches: - 'staging' + # needed to stop endless commit loop by auto-bump + paths-ignore: + - setup.py + - .bumpversion.cfg jobs: build-and-publish: @@ -14,6 +19,21 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + with: + persist-credentials: false + # cut assumes version number is surrounded by double-quotes. + - name: Get Current Version + run: echo "current_version=$(grep "version" setup.py | cut -d '"' -f2)" >> $GITHUB_ENV + - name: Auto Bump Package Version + uses: FragileTech/bump-version@main + with: + current_version: "${{ env.current_version }}" + files: setup.py + part: patch + commit_name: bot-edgepi + commit_email: bot@edgepi.com + login: bot-edgepi + token: "${{ secrets.ACTIONS_BOT_TOKEN }}" - name: Set up Python uses: actions/setup-python@v3 with: @@ -22,9 +42,6 @@ jobs: run: | python -m pip install --upgrade pip if [ -f requirements_build.txt ]; then python -m pip install -r requirements_build.txt; fi - - name: Bump Patch Number - run: | - if [ -f bump_patch.py ]; then python bump_patch.py; fi - name: Build Package run: | python -m build diff --git a/.github/workflows/create-release-tag.yml b/.github/workflows/create-release-tag.yml new file mode 100644 index 00000000..cd833808 --- /dev/null +++ b/.github/workflows/create-release-tag.yml @@ -0,0 +1,31 @@ +# This workflow will create a new tag based on latest commit to branch + +name: Create Release Tag + +on: + push: + branches: + - 'main' + +jobs: + build-and-publish: + name: Create Release Tag + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + token: ${{ secrets.ACTIONS_BOT_TOKEN }} + # cut assumes version number is surrounded by double-quotes. + - name: Get Current Version + run: echo "current_version=$(grep "version" setup.py | cut -d '"' -f2)" >> $GITHUB_ENV + - name: Create Release Tag + env: + commit_name: bot-edgepi + commit_email: bot@edgepi.com + username: bot-edgepi + run: | + git config user.name ${{ env.commit_name }} + git config user.email ${{ env.commit_email }} + git tag -a release/v${{ env.current_version }} -m "tag release version ${{ env.current_version }}" + git push origin release/v${{ env.current_version }} diff --git a/.github/workflows/python-integration-test.yml b/.github/workflows/python-integration-test.yml deleted file mode 100644 index 2beccade..00000000 --- a/.github/workflows/python-integration-test.yml +++ /dev/null @@ -1,35 +0,0 @@ -# This workflow will install Python dependencies, run tests using PyTest. - -name: PyTest Integration Test - -on: - push: - branches: - - 'staging' - pull_request: - branches: - - 'staging' - -jobs: - test: - name: Self-Hosted Integration Test - runs-on: self-hosted - strategy: - fail-fast: false - matrix: - python-version: ["3.9"] - - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Install Dependencies - run: | - python -m pip install --upgrade pip - python -m venv venv_test - source venv_test/bin/activate - python -m pip install pytest - if [ -f requirements_test.txt ]; then pip install -r requirements_test.txt; fi - - name: Test with pytest - run: | - source venv_test/bin/activate - pytest ./src/tests/integration_tests diff --git a/bump_patch.py b/bump_patch.py deleted file mode 100644 index 991be7d7..00000000 --- a/bump_patch.py +++ /dev/null @@ -1,35 +0,0 @@ -"""increment patch number for publishing to TestPyPi""" - -import sys -import fileinput - - -SEARCH_TEXT = "version" -TEST_PYPI_VER_NUM = "TEST_PYPI_VER_NUM" - - -def bump_version_patch(vers_line: str) -> str: - """ - Increments patch number of a version line taking the format - major.minor.patch - """ - version = vers_line.split('"')[1] - semantic_list = version.split(".") - patch_num = int(semantic_list[2]) + 1 - new_ver = semantic_list[0] + "." + semantic_list[1] + "." + str(patch_num) - return line.replace(version, new_ver) - - -if __name__ == "__main__": - # get current version number - with fileinput.input("./setup.py", inplace=True) as file: - for line in file: - if SEARCH_TEXT in line: - # replace line containing version number - new_line = bump_version_patch(line) - sys.stdout.write(new_line) - else: - # do not modify line - sys.stdout.write(line) - - file.close() diff --git a/setup.py b/setup.py index c79c65b2..8eef7dc7 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.7", + version="1.1.10", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 473d6f613a679977b7cd5c41e35ecbadb0c39a06 Mon Sep 17 00:00:00 2001 From: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri, 16 Dec 2022 17:51:16 -0800 Subject: [PATCH 03/49] Single Staging Job (#218) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update Dev Package Version (#201) * enable workflow * bump version for next staging run * Update README.md (#203) * refactor merge to dev workflow (#205) * Cherry Pick Bump Commit (#210) * add test cherry pick workflow * re-remove merge action (#212) * refactor staging workflow (#213) * fix syntax error (#215) * Bump version: 1.1.13 → 1.1.14 * refactor to single job (#217) * refactor to single job * rename job Co-authored-by: bot-edgepi --- .../workflows/build-and-publish-TestPyPI.yml | 50 +++++++------------ .github/workflows/update-dev-version.yml | 27 ---------- 2 files changed, 18 insertions(+), 59 deletions(-) delete mode 100644 .github/workflows/update-dev-version.yml diff --git a/.github/workflows/build-and-publish-TestPyPI.yml b/.github/workflows/build-and-publish-TestPyPI.yml index 8df6ec62..49392e36 100644 --- a/.github/workflows/build-and-publish-TestPyPI.yml +++ b/.github/workflows/build-and-publish-TestPyPI.yml @@ -13,8 +13,8 @@ on: - .bumpversion.cfg jobs: - auto-bump: - name: Bump Version + publish: + name: Staging Publish runs-on: ubuntu-latest steps: - name: Checkout @@ -34,12 +34,22 @@ jobs: commit_email: bot@edgepi.com login: bot-edgepi token: "${{ secrets.ACTIONS_BOT_TOKEN }}" - - cherry-pick: - name: Cherry Pick - runs-on: ubuntu-latest - needs: auto-bump - steps: + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.10' + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements_build.txt ]; then python -m pip install -r requirements_build.txt; fi + - name: Build Package + run: | + python -m build + - name: Publish Distribution to TestPyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ - name: Checkout Dev uses: actions/checkout@v3 with: @@ -59,27 +69,3 @@ jobs: git config user.email ${{ env.commit_email }} git cherry-pick ${{ env.bump_commit }} git push origin dev - - build-and-publish: - name: Build and Publish to TestPyPI - runs-on: ubuntu-latest - needs: cherry-pick - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: '3.10' - - name: Install Dependencies - run: | - python -m pip install --upgrade pip - if [ -f requirements_build.txt ]; then python -m pip install -r requirements_build.txt; fi - - name: Build Package - run: | - python -m build - - name: Publish Distribution to TestPyPI - uses: pypa/gh-action-pypi-publish@master - with: - password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository_url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/update-dev-version.yml b/.github/workflows/update-dev-version.yml deleted file mode 100644 index 22ac25e9..00000000 --- a/.github/workflows/update-dev-version.yml +++ /dev/null @@ -1,27 +0,0 @@ -# This workflow will merge staging to dev, on auto-bump completed, in order -# to apply auto bumped package version on staging to dev - -name: Merge Staging to Dev - -on: - workflow_run: - workflows: ["Build and Publish to TestPyPI"] - types: - - completed - branches: [staging] - -jobs: - on-success: - name: Merge Staging to Dev - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Merge Staging to Dev - uses: devmasx/merge-branch@master - with: - type: now - from_branch: staging - target_branch: dev - github_token: ${{ secrets.ACTIONS_BOT_TOKEN }} - message: "apply auto bumped package version" From d5043423902ad84f50d4d14434b5460c7a24ec10 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Sat, 17 Dec 2022 01:51:58 +0000 Subject: [PATCH 04/49] =?UTF-8?q?Bump=20version:=201.1.14=20=E2=86=92=201.?= =?UTF-8?q?1.15?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 28f53b98..9ba19940 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = "rc/v{new_version}" -current_version = 1.1.14 +current_version = 1.1.15 diff --git a/setup.py b/setup.py index d155b648..3ee154ea 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.14", + version="1.1.15", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From f0a51550f876b026dc84a4df9200d3be5d88ccf4 Mon Sep 17 00:00:00 2001 From: flavius Date: Fri, 16 Dec 2022 18:02:36 -0800 Subject: [PATCH 05/49] Merge branch 'staging' --- .bumpversion.cfg | 2 +- .../workflows/build-and-publish-TestPyPI.yml | 29 +++++++++++++++---- README.md | 12 ++++---- setup.py | 2 +- 4 files changed, 32 insertions(+), 13 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index dfebd998..9ba19940 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = "rc/v{new_version}" -current_version = 1.1.10 +current_version = 1.1.15 diff --git a/.github/workflows/build-and-publish-TestPyPI.yml b/.github/workflows/build-and-publish-TestPyPI.yml index a097c5a0..49392e36 100644 --- a/.github/workflows/build-and-publish-TestPyPI.yml +++ b/.github/workflows/build-and-publish-TestPyPI.yml @@ -1,7 +1,7 @@ -# This workflow will increment version patch number, and build and publish -# the python package to TestPyPI upon push or merge to staging branch +# This workflow will increment version patch number, cherry pick this new version to dev, +# and build and publish the package to TestPyPI upon push or merge to staging branch -name: Build and Publish to TestPyPI +name: Staging Publish on: push: @@ -13,8 +13,8 @@ on: - .bumpversion.cfg jobs: - build-and-publish: - name: Build and publish Package to TestPyPI + publish: + name: Staging Publish runs-on: ubuntu-latest steps: - name: Checkout @@ -50,3 +50,22 @@ jobs: with: password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository_url: https://test.pypi.org/legacy/ + - name: Checkout Dev + uses: actions/checkout@v3 + with: + ref: dev + token: ${{ secrets.ACTIONS_BOT_TOKEN }} + fetch-depth: 0 + - name: Auto Bump Commit SHA + run: | + echo "bump_commit=$(git log -n 1 origin/staging --pretty=format:'%H')" >> $GITHUB_ENV + - name: Cherry Pick + env: + commit_name: bot-edgepi + commit_email: bot@edgepi.com + run: | + echo ${{ env.bump_commit }} + git config user.name ${{ env.commit_name }} + git config user.email ${{ env.commit_email }} + git cherry-pick ${{ env.bump_commit }} + git push origin dev diff --git a/README.md b/README.md index 81f57ef5..e5e46a3a 100644 --- a/README.md +++ b/README.md @@ -43,12 +43,12 @@ edgepi_adc.stop_conversions(ADCNum.ADC_1) For further details on this and other modules, please refer to each module's documentation by following the links provided in the `Implemented Modules` section below. # Implemented Modules The EdgePi SDK contains modules intended to represent each connected peripheral device onboard the EdgePi. Below is a directory of the currently available modules. -* [Thermocouple](src/edgepi/tc) -* [Digital to Analog Converter (DAC)](src/edgepi/dac) -* [Analog to Digital Converter (ADC)](src/edgepi/adc) -* [LED Array](src/edgepi/led) -* [Digital Input (DIN)](src/edgepi/digital_input) -* [Digital Output (DOUT)](src/edgepi/digital_output) +* [Thermocouple](https://github.com/EdgePi-Cloud/edgepi-python-sdk/tree/main/src/edgepi/tc) +* [Digital to Analog Converter (DAC)](https://github.com/EdgePi-Cloud/edgepi-python-sdk/tree/main/src/edgepi/dac) +* [Analog to Digital Converter (ADC)](https://github.com/EdgePi-Cloud/edgepi-python-sdk/tree/main/src/edgepi/adc) +* [LED Array](https://github.com/EdgePi-Cloud/edgepi-python-sdk/tree/main/src/edgepi/led) +* [Digital Input (DIN)](https://github.com/EdgePi-Cloud/edgepi-python-sdk/tree/main/src/edgepi/digital_input) +* [Digital Output (DOUT)](https://github.com/EdgePi-Cloud/edgepi-python-sdk/tree/main/src/edgepi/digital_output) # Development Active development SDK versions can be accessed from the following resources: ## Installing from TestPyPi diff --git a/setup.py b/setup.py index 8eef7dc7..3ee154ea 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.10", + version="1.1.15", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From ac309d8840188fab8b643f5fe11c511172d26929 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Thu, 29 Dec 2022 23:33:29 +0000 Subject: [PATCH 06/49] =?UTF-8?q?Bump=20version:=201.1.15=20=E2=86=92=201.?= =?UTF-8?q?1.16?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 9ba19940..aefea5dd 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = "rc/v{new_version}" -current_version = 1.1.15 +current_version = 1.1.16 diff --git a/setup.py b/setup.py index 3ee154ea..62a454e6 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.15", + version="1.1.16", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From f80eefc0873a0016f9f3ff73f9347741747968ef Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Fri, 30 Dec 2022 00:14:58 +0000 Subject: [PATCH 07/49] =?UTF-8?q?Bump=20version:=201.1.16=20=E2=86=92=201.?= =?UTF-8?q?1.17?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index b10778f2..b47eb4ab 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.16 +current_version = 1.1.17 diff --git a/setup.py b/setup.py index 62a454e6..3678b5ff 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.16", + version="1.1.17", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From cf93a5901b7e13d86aa51b81a067e31d713fb733 Mon Sep 17 00:00:00 2001 From: sjpark608 Date: Thu, 29 Dec 2022 16:41:05 -0800 Subject: [PATCH 08/49] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit f80eefc0873a0016f9f3ff73f9347741747968ef Author: bot-edgepi Date: Fri Dec 30 00:14:58 2022 +0000 Bump version: 1.1.16 → 1.1.17 commit f81e27eb686b2951df3c96876ec86386f258fa67 Merge: bff88db bf8304c Author: sjpark608 Date: Thu Dec 29 16:14:08 2022 -0800 Merge branch 'dev' into staging commit bf8304c7b1b7c6e9256bff2c01dc18040b80fe60 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Thu Dec 29 16:13:17 2022 -0800 Digital out integration test (#228) * creating integration test * Update test_digital_out.py want to test state not direction * Update test_digital_out.py lint fix commit bff88db446af57362bbca761ca737d1f64e80886 Merge: ac309d8 d51186d Author: sjpark608 Date: Thu Dec 29 15:54:53 2022 -0800 Merge branch 'dev' into staging commit d51186da8e7be63a0fa23012b1619e376da59560 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Thu Dec 29 15:53:43 2022 -0800 Update .bumpversion.cfg (#227) bump version config with quotation causes an issue when fetching the updated version of dev after the staging is merged. The config file is changed to remove the quotation. commit feae067061d5497f4f9ed4f766220a5b19e19f10 Author: bot-edgepi Date: Thu Dec 29 23:33:29 2022 +0000 Bump version: 1.1.15 → 1.1.16 commit ac309d8840188fab8b643f5fe11c511172d26929 Author: bot-edgepi Date: Thu Dec 29 23:33:29 2022 +0000 Bump version: 1.1.15 → 1.1.16 commit 7586072dfede6203f9478303074eac9a96f82bf2 Merge: d504342 f777fca Author: sjpark608 Date: Thu Dec 29 15:31:58 2022 -0800 Merge branch 'dev' into staging commit f777fca324989be696245333faffd0745efcd7d9 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Thu Dec 29 15:22:56 2022 -0800 Digital_output module issue fix (#225) * Update edgepi_gpio_expander.py print statement * re-name gpio close function * Update gpio_configs.py #224 * Readme edit #222 commit e79fa2d7e65725ad4b84201427b858b2ca0c7802 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Thu Dec 22 10:45:34 2022 -0800 Eeprom todo added (#208) * todos * handling todos * Protobuf mapping class created to convert the data class into a regular class * Update test_edgepi_dac.py DAC unittest passing * added updated pb file - added serialized pb for testing - added hw component in tc and rtd - added diff calib for adc - changed pb mapping dataclass to a standalone class - modified edgepi_dac to accommodate the importing - edgepi_adc to accommodate the importing * fixed no-name-in-module * added link to the issue related to protobuf and pylint, added more logging * fix linting * Update edgepi_eeprom.py linting fix commit 1adb982afc5b61ffa44459ffb2f3efc3f8cf7bb5 Author: bot-edgepi Date: Sat Dec 17 01:51:58 2022 +0000 Bump version: 1.1.14 → 1.1.15 commit d5043423902ad84f50d4d14434b5460c7a24ec10 Author: bot-edgepi Date: Sat Dec 17 01:51:58 2022 +0000 Bump version: 1.1.14 → 1.1.15 commit 473d6f613a679977b7cd5c41e35ecbadb0c39a06 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Dec 16 17:51:16 2022 -0800 Single Staging Job (#218) * Update Dev Package Version (#201) * enable workflow * bump version for next staging run * Update README.md (#203) * refactor merge to dev workflow (#205) * Cherry Pick Bump Commit (#210) * add test cherry pick workflow * re-remove merge action (#212) * refactor staging workflow (#213) * fix syntax error (#215) * Bump version: 1.1.13 → 1.1.14 * refactor to single job (#217) * refactor to single job * rename job Co-authored-by: bot-edgepi commit f162a17063f714942f210fcd39f033a97038c9c5 Merge: 8545e00 231b313 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Dec 16 17:50:09 2022 -0800 Merge branch 'staging' into dev commit 8545e009def9a952c3e016aae79ec7a987b87177 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Dec 16 17:46:22 2022 -0800 refactor to single job (#217) * refactor to single job * rename job commit 2520c06b0fb2c704c9252316091fd812be6f85b1 Author: bot-edgepi Date: Sat Dec 17 01:23:55 2022 +0000 Bump version: 1.1.13 → 1.1.14 commit 231b313b7eb7bcf0198aff74cd06420bb4f3a2a2 Author: bot-edgepi Date: Sat Dec 17 01:23:55 2022 +0000 Bump version: 1.1.13 → 1.1.14 commit 07ecf0d9fa64c49db12b349165397395dddd0831 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Dec 16 17:23:35 2022 -0800 Fix Workflow Syntax (#216) * Update Dev Package Version (#201) * enable workflow * bump version for next staging run * Update README.md (#203) * refactor merge to dev workflow (#205) * Cherry Pick Bump Commit (#210) * add test cherry pick workflow * re-remove merge action (#212) * refactor staging workflow (#213) * fix syntax error (#215) commit 3b4fca9c06486f3708fb623a3464e5613fad8903 Merge: 620ba08 355b9f5 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Dec 16 17:22:00 2022 -0800 Merge branch 'staging' into dev commit 620ba084c27752ff468b2c81a0ac66f0a472f0db Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Dec 16 17:19:14 2022 -0800 fix syntax error (#215) commit 355b9f5008bca1bfcdbd5b18d25b12375aa97efe Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Dec 16 17:00:15 2022 -0800 Refactor Staging Workflow (#214) * Update Dev Package Version (#201) * enable workflow * bump version for next staging run * Update README.md (#203) * refactor merge to dev workflow (#205) * Cherry Pick Bump Commit (#210) * add test cherry pick workflow * re-remove merge action (#212) * refactor staging workflow (#213) commit 89c4f1429eee51764e97c76317ab094ae83a7131 Merge: cb2dc70 0c9d509 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Dec 16 16:58:30 2022 -0800 Merge branch 'staging' into dev commit cb2dc7056e2fb7f7298471ae3661728b06b2641a Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Dec 16 16:55:28 2022 -0800 refactor staging workflow (#213) commit 0c9d5094250b4d367a5ff113e1fe518251f82e82 Author: bot-edgepi Date: Sat Dec 17 00:19:02 2022 +0000 Bump version: 1.1.12 → 1.1.13 commit 0c7a0d364dc40078a58fcef8440979c58de2933e Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Dec 16 16:18:08 2022 -0800 Cherry Pick Bump Commit (#211) * Cherry Pick Bump Commit (#210) commit 475eb5dbb40628fcff74a093f6a62e6ff6655134 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Dec 16 16:16:25 2022 -0800 re-remove merge action (#212) commit 197a29fe3a13604565e5c4bdaab35212274e197c Merge: 6080e59 157cf13 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Dec 16 16:04:39 2022 -0800 Merge branch 'staging' into dev commit 6080e59fddaafc95beed0f857b7d77b8969d339a Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Dec 16 16:02:41 2022 -0800 Cherry Pick Bump Commit (#210) * add test cherry pick workflow commit 157cf130fc80f52bd0f6169563394055b8a3790e Author: bot-edgepi Date: Fri Dec 16 20:40:57 2022 +0000 Bump version: 1.1.11 → 1.1.12 commit 68fa696b957f14bd268a0c4ce2b5db9d99dd276b Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Dec 16 12:40:07 2022 -0800 Refactor Merge to Dev Workflow (#206) * refactor merge to dev workflow (#205) commit f36d91a5eccc80ef080f31f23c099158c6be29b0 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Dec 16 12:37:29 2022 -0800 refactor merge to dev workflow (#205) commit 812fb04e178b5ce4f72d1e40461db9844ee5c628 Author: bot-edgepi Date: Fri Dec 16 19:48:26 2022 +0000 Bump version: 1.1.10 → 1.1.11 commit 2e8e22a5f24293ec4f24e7f232b800479afb037c Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Dec 16 11:47:44 2022 -0800 Merge Staging to Dev Workflow (#204) * Update Dev Package Version (#201) * enable workflow * bump version for next staging run * Update README.md (#203) commit 653782b023a78afb19451fd472690280cd1ee5ba Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Dec 16 11:17:21 2022 -0800 Update README.md (#203) commit 3ca3dadf2630e63eb69e2e78a86f4dd27547e957 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Dec 16 10:42:02 2022 -0800 Update Dev Package Version (#201) * enable workflow * bump version for next staging run commit 8f13aef6680180cef8afa2b80859061e56127726 Author: bot-edgepi Date: Thu Dec 15 23:22:09 2022 +0000 Bump version: 1.1.9 → 1.1.10 commit 1ba5f5606e07db62c53bcd4b46cc914be97a479a Merge: b9f816e 9700835 Author: flavius Date: Thu Dec 15 15:20:47 2022 -0800 Merge branch 'dev' into staging commit 970083563304a1b444aaa2dbf9b058c55f3275dd Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Thu Dec 15 15:17:57 2022 -0800 remove integration test workflow (#197) * remove integration test workflow * bump versions due to failed staging run commit b9f816e831225f36bc9015e90fe4b285e3b8ec88 Author: bot-edgepi Date: Thu Dec 15 23:08:00 2022 +0000 Bump version: 1.1.8 → 1.1.9 commit d4f9b30c5ebc7b89669a34d24bdb54f332ef16a6 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Thu Dec 15 15:07:06 2022 -0800 Publishing Workflow Fixes (#196) * Fix Publishing Workflows (#192) * new auto bump method * add release workflow * re-add package build dependencies (#193) * Disable Integration Test Workflow (#195) * change python to python3 * update test path * disable integration test workflow Co-authored-by: bot-edgepi commit 7a444d8993e276356e0f51e00a45e175df5fd2de Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Thu Dec 15 15:01:36 2022 -0800 Disable Integration Test Workflow (#195) * change python to python3 * update test path * disable integration test workflow commit 8e3307220f6472f0ac1f970ae198917b2dc7acaf Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Thu Dec 15 15:00:03 2022 -0800 re-add package build dependencies (#193) commit 5112119c88cc64e16ac3b36cc977c0e65d84ab2d Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Thu Dec 15 14:12:49 2022 -0800 Fix Publishing Workflows (#192) * new auto bump method * add release workflow Co-authored-by: bot-edgepi commit 823931c1efdaa942c28ff67fcdcacea42db9f1eb Merge: 79b70d3 6fc38f4 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Tue Dec 13 18:10:55 2022 -0800 Merge branch 'main' into staging commit 79b70d301f92338aed4c5484ace96725350fccc9 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Tue Dec 13 18:08:49 2022 -0800 Fix README (#187) * update README * remove install info from tc readme * TC merge for housekeeping (#44) * add fault status reading * add fault mask configuration * tc module restructuring * update documentation * update decimal bit constants * Tc dev fixes (#36) * refactor fault reading * add human readable Fault printing * add option for less verbose fault reading * filter out normal status Faults * refactor fault masking to set individual masks * Gpio merge for house keeping (#42) * gpio periphery being added * gpio periphery being added * rebase gpio branch * created gpio folder and files and tests * Feature branch git action added, gpio command and constants are added * github action yml changed * testing GPIO * gpio bias keyword takenout * path typeError troubleshooting * gpio in progress #20 * disable push test until fixing the bug * Update gpio.py add all keyword args * Update gpio.py passing arguments without keyword * Update gpio.py * gpio test issue resolved #20 * working on constants * Adc rebased and merge to dev (#43) * added constants #17 * adding Methods to ADCCommand class #17 * added write_register method, testing exception as well #17 * added dataclasses for register configurations, tests are added for testing immutable class #17 * added more registers and tests, #17 * added workflow for CI, #17 * modifying linting requirements * testing * changed global user and email * user name testing * added constants #17 * adding Methods to ADCCommand class #17 * added write_register method, testing exception as well #17 * added dataclasses for register configurations, tests are added for testing immutable class #17 * added more registers and tests, #17 * modifying linting requirements * testing * changed global user and email * user name testing * modified readme back to original state Co-authored-by: SJ Park * Update README module links (#45) Adding module link to ADC now that it is merged to dev, and updating other links to use relative link (so it links to folders on the same branch as top-level readme they're being accessed from) * refactor utilities to support non Enum set_config args (#47) * refactor utilities to support non Enum set_config args * added gpio_cofings.py to add configuration data class for dac #40 (#46) * added gpio_cofings.py to add configuration data class for dac #40 * changed function description * PR #46 fixes * steven can't write :( * filter_dict by value (#53) * add names to test and lint workflows (#56) * add names to test and lint workflows * remove pytest-gpio workflow * Pytest fix (#57) * Update adc_commands.py updated adc_command to fix the pytest issue * Update adc_commands.py updated adc_command to fix the pytest issue * Edgepi gpio dac config (#55) * gpio-dac-config being implemented #20, #48, #49, #51, #16 * testing I2C * 1. Added gpio config #48 2. edgepi_gpio init method: instantiate super class when I2C gpio group selected and generate pin list #48 #51 #52 3. I2C mocking class for window and Linux environment, #16 * gpio module configurations packed as enum using enum to check configuration by iterating through the enum class * filter_dict by value (#53) * add names to test and lint workflows (#56) * add names to test and lint workflows * remove pytest-gpio workflow * added mock for testing I2C * gpio-dac-config being implemented #20, #48, #49, #51, #16 * testing I2C * 1. Added gpio config #48 2. edgepi_gpio init method: instantiate super class when I2C gpio group selected and generate pin list #48 #51 #52 3. I2C mocking class for window and Linux environment, #16 * gpio module configurations packed as enum using enum to check configuration by iterating through the enum class * added mock for testing I2C * combined repetitive dataclass fixed a problem with circular dependency * fixing pytest failures Co-authored-by: flavius-t <77416463+flavius-t@users.noreply.github.com> Co-authored-by: flavius-t * TC Open Circuit (#59) * add open fault detection mode config * Fix Linting (#65) * Fix TestPyPi (#66) * TC Compute Conversion Time (#63) * add compute conversion time * refactor single_sample for time delay computation * update time conv docstrings * inflate time delays * TC Set Temperatures (#60) * add temperature setting to set_config * add cold junction temp override method * add temperature input validation * add update_registers_from_dict and test * add temperature range validation by tc type * add custom exceptions, expand tempcode testing * add convert from DecBits to float * add cold-junction overwrite error * TC Integration Tests (#70) * separate tests to unit and integration * add thermocouple integration tests * refactoring to support tc integration testing * Edgepi gpio transfer (#62) * fixed I2C.Message Mocking * tested transfer function and it is working * set default in progress #51, #52, #50, #48 * more commands being added added more gpio state parameter in I2C info dataclass * Update edgepi_gpio.py added todo notes * set default in progress * Set default in progress another GPIO config added to I2CpinInfo dataclass adding helper methods read register and map register to dictionary * added reg helper class to generate the register dictionary. added another function to split pin list into two separate lists to check whether the gpio group uses two separate I2C expander * set-default need testing * set default tested * fixed I2C.Message Mocking * tested transfer function and it is working * set default in progress #51, #52, #50, #48 * more commands being added added more gpio state parameter in I2C info dataclass * Update edgepi_gpio.py added todo notes * set default in progress * Set default in progress another GPIO config added to I2CpinInfo dataclass adding helper methods read register and map register to dictionary * added reg helper class to generate the register dictionary. added another function to split pin list into two separate lists to check whether the gpio group uses two separate I2C expander * set-default need testing * set default tested * Update edgepi_tc.py the __ was deleted by accident * tests not passing * testing fixed * Update test_edgepi_gpio.py fixed tests * requested changed from Farzad * Todos added * working on todos, changed pin list to be self-explanatory, need to work on __generate_default_reg_dict to be more intuitie * changed naming conventions and using dictionary instead of list for describing pins * fixing pylint * fixing linting issue * fix I2C test and pylint on linux * disabled E1101 to go work around the error from mock class * fixed lint and testing mock * Unit Test Fixes (#74) * separate peripherals testing to unit/integration * testing workflow changes * Edgepi gpio toggle (#75) * adding set_gpio function modified set_default and dgenerate default reg dict -instead of using list of dictionary, using dictionary format - set expander pin uses pin_name to set corresponding gpio #49 * clear expander pin * Toggle gpio pin added #49 * pylint passed" * adding set_gpio function modified set_default and dgenerate default reg dict -instead of using list of dictionary, using dictionary format - set expander pin uses pin_name to set corresponding gpio #49 * clear expander pin * Toggle gpio pin added #49 * pylint passed" * refactored for-loop test for __write_changed_values is not added since the function doesn't return any value and only execute the transaction * Readme added while working on the readme, i realized the order of AO_ENx pins were reversed. the order is fixed now * Update edgepi_gpio.py for loop replaced with a write change value method * Add Test Coverage (#79) * add code coverage to unit test workflow * add workflow status badges * DAC Interface (#77) * add set channel power mode * add set_gain_mode * add software reset * add readback * add code to voltage * integrate with gpio module * Dac calibration (#84) * refactoring calibration parameter dataclass #9 * changed test fixture for dac_command * calibration parameter refactored * dac calibration refactored * Update test_edgepi_dac.py linter fix * added and edited suggested comments * Calibration module (#92) * #83 creating files * adding unittest * Update test_access_eeprom.py * added unittest & i2c transfer return change * adding calibration mapping and class * Update edgepi_calibration.py todo notes added * pylint fix * code review suggestions * Requested PR fixes - Nomenclature files - Reg address name change -> mem_addr - Device address is a constant now - EEPROM class * ADC Interface (#97) * Adding functions to calibration class (#98) * adding helper class for calibration process * adding functions to generate necessary dictionaries * pylint fixes * Update test_adc_state.py (#100) #99 * Get/Set Individual Pin States (#105) * LED Module (#106) * Individual channel modification (#108) * Individual channel modification #103 - Only single pins gets accessed - simplified code calculate for now, calibration to be added * fixed voltage_to_code and code_to_voltage calculation * applying suggested fix * Issue102 dac (#109) * Individual channel modification #103 - Only single pins gets accessed - simplified code calculate for now, calibration to be added * adding get_state() dac #102 dac get_state is being added * fixed voltage_to_code and code_to_voltage calculation * passing pytest * changed the key from string name to number * changed get_state function #102 osensa/edgepi-device-manager/issues/3 * pylint fix * Issue103 adc (#110) * adc testing being added * added test * Individual channel modification (#108) * Individual channel modification #103 - Only single pins gets accessed - simplified code calculate for now, calibration to be added * fixed voltage_to_code and code_to_voltage calculation * applying suggested fix * added todo and fixed pylint * used enums for pin names * Update edgepi_adc.py removed clear exapnder to avoid resetting of Ground reference when a new object is instantiated * Update edgepi_adc.py (#115) * Update edgepi_adc.py To Do added * Update edgepi_adc.py have a ruler set for pylint, and still fails on line-too-long :( * Gpio delete set default (#116) * deleting obsolete function * added unit tests for functions changed gpio pin ordering of DAC module * Loading DAC related Calibration parameter from the EEPROM (#114) * dummy functions added for calibration added logger added generate calib dictionary functions , logics to be implemented * unpacking packing added unpacking: from list of parameter that read from eeprom to a single value packing : from a value to a list of bytes to load to the eeprom * calib dictionary generation for dac * loading calib param added and tested * Update test_edgepi_calibration.py updated the unit test for get_calibration_dict. Other module test cases are deleted for now * PR#114 fix - added a dictionary of functions - added more description to the address constants * Remove ADC Init Configs (#119) * remove configs from adc init * rename to private method * Calibration dac (#120) * Update edgepi_dac.py adding calibration classes, need to check dictionary structure. implement DAC_GAIN parameter maybe needed * DAC calibration updated #111 - loading of calibration parameter from eeprom - generation and get calibration dictionary - check dac_gain state before code2voltage or voltage 2code conversion - conversion formula edited to accommodate the calibration param and dac gain state * set/clear internal DAC gain #76 * Update edgepi_dac.py PR #120 suggested fix * constant name change PR #120 suggested fix * ADC Differential Reads, RTD Mode (#118) * remove unused duplicate channel assignment code * fix pytest discovery error * add SPI debugging logs * change rtd_enabled check logic * diff read constants * rtd property check, set diff mode * unit test validate_no_rtd_conflict * unit test select_differential * ignore local test scripts * documentation additions * opcodes for RTD mode * doc updates, pytest config * unit test IDACMUX opcodes * unit test IDACMAG opcodes * fix IDACMAG opcode bug * fix REFMUX opcode bug * expand REFMUX opcode unit tests, renaming * uncomment adc config integration tests * integration test IDACMUX opcodes * integration test IDACMAG opcodes * integration test REFMUX opcodes * integration test select_differential * add idac channel 9 * fix opcode name, failing unit test * add rtd mode enums * add rtd_mode, todos for get_state with caching * rename __get_rtd_en_status * fix rtd_mode logic, unit test * integration test rtd_mode, fix bug * Remap ADC Multiplexers (#122) * mux mapping set mux_n to AINCOM * refactor mux arg handling in __config * refactor None checking, update docstring * remove temporary test fix * remove unnecessary test cases * I2C set_msg function takes list of addresses (#128) * #127 added another type for addr parameter of set_read_msg and set_write_msg to accomodate a list of addresses * | was introduced in python 3.10 but the test automation is using python 3.9 * Calibration suggestion (#129) * Nov1 code review suggestions * refactoring eeprom access module to accomodate the hardware change * EEPROM class is refactored to accomodate the larger memory size #125 * pylint fix * Eeprom protobuf (#131) * protobuf implementation #126 #124 * test added * pylint fix and update dependencies * Update requirements_test.txt * delete Todos * suggested fixes * suggested name fix * generate_calib_param dictionary added (#134) * generate_calib_param dictionary added * pytest fix * suggested fix - calib_params nomenclature - better description for docstring * suggest fix - calib param dataclass formation done in eeprom class - removed redundant methods and tests * ADC Get State (#132) * refactor get_state to EdgePiADC * refactor ADCModes * add get_register_map * use get_register_map for internal register reads * refactor ADCState * use new ADCState for getting state internally * add get mux states * refactor state query constants to module * ADC Calibration (#138) * added eeprom reading to load calibration parameter * diff/individual voltage read calibration handling #133 Co-authored-by: sjpark608 * fixed typing issue (#136) #135 added test cases for checking the type * Add ADC2 (#139) * add adc-2 to voltage reads, set_config * dac conversion formula change (#146) * dac conversion formula change #143 #144 - added updated serialized file for testing - updated formula for voltage2code code2voltage - updated unittest - added serialized read helper file - deleted outdated dac_calibration files * pylint fix * DAC Enum Args (#152) * refactor user interface to enum channel args * GPIO refactoring in progress (#156) * gpio module refactored #153 * adding test cases fixing typos * gpio module refactor adding edgpi gpio test * fix suggestions * RTD Sampling (#160) * Hardware Tests (#162) * voltage read-write test * add test report to gitignore * custom approx comparator * move adc conversion time tests * update hardware test instructions * move integration tests to new folder * diff voltage tests * add adc_2 diff test * add rtd tests * bypass rtd validation in mux mapping * fix rtd temp calculation bug * GPIO module refactoring intermediate PR (#161) * refactoring generating pin dictionary to have generic dictionary #154 #155 * generic object instantiation #154 #155 * Update test_dac.py dict_pin changed to expander_pin_dict after refactor * lint fix * Gpio refactor 154 (#167) * added gpio exception, gpio write, need some testing on the hardware #166 #154 #155 * added set direction in out function, get direction function * edgepi gpio methods gets enum values typed string * changed function name used in different modules * fixed pytest and pylint issues * added toggle pin * deleted unused module * PR #167 suggested fix - added __pin_name_check() - added more tests * GPIO DOUT pin list re-order (#169) * Update gpio_configs.py Forgotten change * fixed LED integration test * Get State Override Cache (#175) * add override cache to get state * Fix Read Voltage Validation (#176) * fix conv mode validation in read_voltage * Digital input module (#173) * adding din module and tests * Digital input reading #170 * Added test parameters * added exception and testing * digital out module #171 (#172) * Main README Update (#181) * Update README.md * update sdk package naming * update version num * added README and re-naming module (#182) * LED Module README (#183) * Create README.md * Update README.md * Fix README (#186) Co-authored-by: sjpark608 <78987042+sjpark608@users.noreply.github.com> Co-authored-by: SJ Park Co-authored-by: sjpark608 commit dcce9d8a95f9a8d14ad7894c7f38c72aee460e24 Merge: f64498e 00b0630 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Tue Dec 13 18:07:36 2022 -0800 Merge branch 'staging' into dev commit f64498ee080cdb2c25bd9c280ec6a1b5f2832f02 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Tue Dec 13 18:05:29 2022 -0800 Fix README (#186) commit 00b063000ef39950df224b770117a2f42fa80d16 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Tue Dec 13 17:43:12 2022 -0800 Publish SDK (#184) * update README * remove install info from tc readme * TC merge for housekeeping (#44) * add fault status reading * add fault mask configuration * tc module restructuring * update documentation * update decimal bit constants * Tc dev fixes (#36) * refactor fault reading * add human readable Fault printing * add option for less verbose fault reading * filter out normal status Faults * refactor fault masking to set individual masks * Gpio merge for house keeping (#42) * gpio periphery being added * gpio periphery being added * rebase gpio branch * created gpio folder and files and tests * Feature branch git action added, gpio command and constants are added * github action yml changed * testing GPIO * gpio bias keyword takenout * path typeError troubleshooting * gpio in progress #20 * disable push test until fixing the bug * Update gpio.py add all keyword args * Update gpio.py passing arguments without keyword * Update gpio.py * gpio test issue resolved #20 * working on constants * Adc rebased and merge to dev (#43) * added constants #17 * adding Methods to ADCCommand class #17 * added write_register method, testing exception as well #17 * added dataclasses for register configurations, tests are added for testing immutable class #17 * added more registers and tests, #17 * added workflow for CI, #17 * modifying linting requirements * testing * changed global user and email * user name testing * added constants #17 * adding Methods to ADCCommand class #17 * added write_register method, testing exception as well #17 * added dataclasses for register configurations, tests are added for testing immutable class #17 * added more registers and tests, #17 * modifying linting requirements * testing * changed global user and email * user name testing * modified readme back to original state Co-authored-by: SJ Park * Update README module links (#45) Adding module link to ADC now that it is merged to dev, and updating other links to use relative link (so it links to folders on the same branch as top-level readme they're being accessed from) * refactor utilities to support non Enum set_config args (#47) * refactor utilities to support non Enum set_config args * added gpio_cofings.py to add configuration data class for dac #40 (#46) * added gpio_cofings.py to add configuration data class for dac #40 * changed function description * PR #46 fixes * steven can't write :( * filter_dict by value (#53) * add names to test and lint workflows (#56) * add names to test and lint workflows * remove pytest-gpio workflow * Pytest fix (#57) * Update adc_commands.py updated adc_command to fix the pytest issue * Update adc_commands.py updated adc_command to fix the pytest issue * Edgepi gpio dac config (#55) * gpio-dac-config being implemented #20, #48, #49, #51, #16 * testing I2C * 1. Added gpio config #48 2. edgepi_gpio init method: instantiate super class when I2C gpio group selected and generate pin list #48 #51 #52 3. I2C mocking class for window and Linux environment, #16 * gpio module configurations packed as enum using enum to check configuration by iterating through the enum class * filter_dict by value (#53) * add names to test and lint workflows (#56) * add names to test and lint workflows * remove pytest-gpio workflow * added mock for testing I2C * gpio-dac-config being implemented #20, #48, #49, #51, #16 * testing I2C * 1. Added gpio config #48 2. edgepi_gpio init method: instantiate super class when I2C gpio group selected and generate pin list #48 #51 #52 3. I2C mocking class for window and Linux environment, #16 * gpio module configurations packed as enum using enum to check configuration by iterating through the enum class * added mock for testing I2C * combined repetitive dataclass fixed a problem with circular dependency * fixing pytest failures Co-authored-by: flavius-t <77416463+flavius-t@users.noreply.github.com> Co-authored-by: flavius-t * TC Open Circuit (#59) * add open fault detection mode config * Fix Linting (#65) * Fix TestPyPi (#66) * TC Compute Conversion Time (#63) * add compute conversion time * refactor single_sample for time delay computation * update time conv docstrings * inflate time delays * TC Set Temperatures (#60) * add temperature setting to set_config * add cold junction temp override method * add temperature input validation * add update_registers_from_dict and test * add temperature range validation by tc type * add custom exceptions, expand tempcode testing * add convert from DecBits to float * add cold-junction overwrite error * TC Integration Tests (#70) * separate tests to unit and integration * add thermocouple integration tests * refactoring to support tc integration testing * Edgepi gpio transfer (#62) * fixed I2C.Message Mocking * tested transfer function and it is working * set default in progress #51, #52, #50, #48 * more commands being added added more gpio state parameter in I2C info dataclass * Update edgepi_gpio.py added todo notes * set default in progress * Set default in progress another GPIO config added to I2CpinInfo dataclass adding helper methods read register and map register to dictionary * added reg helper class to generate the register dictionary. added another function to split pin list into two separate lists to check whether the gpio group uses two separate I2C expander * set-default need testing * set default tested * fixed I2C.Message Mocking * tested transfer function and it is working * set default in progress #51, #52, #50, #48 * more commands being added added more gpio state parameter in I2C info dataclass * Update edgepi_gpio.py added todo notes * set default in progress * Set default in progress another GPIO config added to I2CpinInfo dataclass adding helper methods read register and map register to dictionary * added reg helper class to generate the register dictionary. added another function to split pin list into two separate lists to check whether the gpio group uses two separate I2C expander * set-default need testing * set default tested * Update edgepi_tc.py the __ was deleted by accident * tests not passing * testing fixed * Update test_edgepi_gpio.py fixed tests * requested changed from Farzad * Todos added * working on todos, changed pin list to be self-explanatory, need to work on __generate_default_reg_dict to be more intuitie * changed naming conventions and using dictionary instead of list for describing pins * fixing pylint * fixing linting issue * fix I2C test and pylint on linux * disabled E1101 to go work around the error from mock class * fixed lint and testing mock * Unit Test Fixes (#74) * separate peripherals testing to unit/integration * testing workflow changes * Edgepi gpio toggle (#75) * adding set_gpio function modified set_default and dgenerate default reg dict -instead of using list of dictionary, using dictionary format - set expander pin uses pin_name to set corresponding gpio #49 * clear expander pin * Toggle gpio pin added #49 * pylint passed" * adding set_gpio function modified set_default and dgenerate default reg dict -instead of using list of dictionary, using dictionary format - set expander pin uses pin_name to set corresponding gpio #49 * clear expander pin * Toggle gpio pin added #49 * pylint passed" * refactored for-loop test for __write_changed_values is not added since the function doesn't return any value and only execute the transaction * Readme added while working on the readme, i realized the order of AO_ENx pins were reversed. the order is fixed now * Update edgepi_gpio.py for loop replaced with a write change value method * Add Test Coverage (#79) * add code coverage to unit test workflow * add workflow status badges * DAC Interface (#77) * add set channel power mode * add set_gain_mode * add software reset * add readback * add code to voltage * integrate with gpio module * Dac calibration (#84) * refactoring calibration parameter dataclass #9 * changed test fixture for dac_command * calibration parameter refactored * dac calibration refactored * Update test_edgepi_dac.py linter fix * added and edited suggested comments * Calibration module (#92) * #83 creating files * adding unittest * Update test_access_eeprom.py * added unittest & i2c transfer return change * adding calibration mapping and class * Update edgepi_calibration.py todo notes added * pylint fix * code review suggestions * Requested PR fixes - Nomenclature files - Reg address name change -> mem_addr - Device address is a constant now - EEPROM class * ADC Interface (#97) * Adding functions to calibration class (#98) * adding helper class for calibration process * adding functions to generate necessary dictionaries * pylint fixes * Update test_adc_state.py (#100) #99 * Get/Set Individual Pin States (#105) * LED Module (#106) * Individual channel modification (#108) * Individual channel modification #103 - Only single pins gets accessed - simplified code calculate for now, calibration to be added * fixed voltage_to_code and code_to_voltage calculation * applying suggested fix * Issue102 dac (#109) * Individual channel modification #103 - Only single pins gets accessed - simplified code calculate for now, calibration to be added * adding get_state() dac #102 dac get_state is being added * fixed voltage_to_code and code_to_voltage calculation * passing pytest * changed the key from string name to number * changed get_state function #102 osensa/edgepi-device-manager/issues/3 * pylint fix * Issue103 adc (#110) * adc testing being added * added test * Individual channel modification (#108) * Individual channel modification #103 - Only single pins gets accessed - simplified code calculate for now, calibration to be added * fixed voltage_to_code and code_to_voltage calculation * applying suggested fix * added todo and fixed pylint * used enums for pin names * Update edgepi_adc.py removed clear exapnder to avoid resetting of Ground reference when a new object is instantiated * Update edgepi_adc.py (#115) * Update edgepi_adc.py To Do added * Update edgepi_adc.py have a ruler set for pylint, and still fails on line-too-long :( * Gpio delete set default (#116) * deleting obsolete function * added unit tests for functions changed gpio pin ordering of DAC module * Loading DAC related Calibration parameter from the EEPROM (#114) * dummy functions added for calibration added logger added generate calib dictionary functions , logics to be implemented * unpacking packing added unpacking: from list of parameter that read from eeprom to a single value packing : from a value to a list of bytes to load to the eeprom * calib dictionary generation for dac * loading calib param added and tested * Update test_edgepi_calibration.py updated the unit test for get_calibration_dict. Other module test cases are deleted for now * PR#114 fix - added a dictionary of functions - added more description to the address constants * Remove ADC Init Configs (#119) * remove configs from adc init * rename to private method * Calibration dac (#120) * Update edgepi_dac.py adding calibration classes, need to check dictionary structure. implement DAC_GAIN parameter maybe needed * DAC calibration updated #111 - loading of calibration parameter from eeprom - generation and get calibration dictionary - check dac_gain state before code2voltage or voltage 2code conversion - conversion formula edited to accommodate the calibration param and dac gain state * set/clear internal DAC gain #76 * Update edgepi_dac.py PR #120 suggested fix * constant name change PR #120 suggested fix * ADC Differential Reads, RTD Mode (#118) * remove unused duplicate channel assignment code * fix pytest discovery error * add SPI debugging logs * change rtd_enabled check logic * diff read constants * rtd property check, set diff mode * unit test validate_no_rtd_conflict * unit test select_differential * ignore local test scripts * documentation additions * opcodes for RTD mode * doc updates, pytest config * unit test IDACMUX opcodes * unit test IDACMAG opcodes * fix IDACMAG opcode bug * fix REFMUX opcode bug * expand REFMUX opcode unit tests, renaming * uncomment adc config integration tests * integration test IDACMUX opcodes * integration test IDACMAG opcodes * integration test REFMUX opcodes * integration test select_differential * add idac channel 9 * fix opcode name, failing unit test * add rtd mode enums * add rtd_mode, todos for get_state with caching * rename __get_rtd_en_status * fix rtd_mode logic, unit test * integration test rtd_mode, fix bug * Remap ADC Multiplexers (#122) * mux mapping set mux_n to AINCOM * refactor mux arg handling in __config * refactor None checking, update docstring * remove temporary test fix * remove unnecessary test cases * I2C set_msg function takes list of addresses (#128) * #127 added another type for addr parameter of set_read_msg and set_write_msg to accomodate a list of addresses * | was introduced in python 3.10 but the test automation is using python 3.9 * Calibration suggestion (#129) * Nov1 code review suggestions * refactoring eeprom access module to accomodate the hardware change * EEPROM class is refactored to accomodate the larger memory size #125 * pylint fix * Eeprom protobuf (#131) * protobuf implementation #126 #124 * test added * pylint fix and update dependencies * Update requirements_test.txt * delete Todos * suggested fixes * suggested name fix * generate_calib_param dictionary added (#134) * generate_calib_param dictionary added * pytest fix * suggested fix - calib_params nomenclature - better description for docstring * suggest fix - calib param dataclass formation done in eeprom class - removed redundant methods and tests * ADC Get State (#132) * refactor get_state to EdgePiADC * refactor ADCModes * add get_register_map * use get_register_map for internal register reads * refactor ADCState * use new ADCState for getting state internally * add get mux states * refactor state query constants to module * ADC Calibration (#138) * added eeprom reading to load calibration parameter * diff/individual voltage read calibration handling #133 Co-authored-by: sjpark608 * fixed typing issue (#136) #135 added test cases for checking the type * Add ADC2 (#139) * add adc-2 to voltage reads, set_config * dac conversion formula change (#146) * dac conversion formula change #143 #144 - added updated serialized file for testing - updated formula for voltage2code code2voltage - updated unittest - added serialized read helper file - deleted outdated dac_calibration files * pylint fix * DAC Enum Args (#152) * refactor user interface to enum channel args * GPIO refactoring in progress (#156) * gpio module refactored #153 * adding test cases fixing typos * gpio module refactor adding edgpi gpio test * fix suggestions * RTD Sampling (#160) * Hardware Tests (#162) * voltage read-write test * add test report to gitignore * custom approx comparator * move adc conversion time tests * update hardware test instructions * move integration tests to new folder * diff voltage tests * add adc_2 diff test * add rtd tests * bypass rtd validation in mux mapping * fix rtd temp calculation bug * GPIO module refactoring intermediate PR (#161) * refactoring generating pin dictionary to have generic dictionary #154 #155 * generic object instantiation #154 #155 * Update test_dac.py dict_pin changed to expander_pin_dict after refactor * lint fix * Gpio refactor 154 (#167) * added gpio exception, gpio write, need some testing on the hardware #166 #154 #155 * added set direction in out function, get direction function * edgepi gpio methods gets enum values typed string * changed function name used in different modules * fixed pytest and pylint issues * added toggle pin * deleted unused module * PR #167 suggested fix - added __pin_name_check() - added more tests * GPIO DOUT pin list re-order (#169) * Update gpio_configs.py Forgotten change * fixed LED integration test * Get State Override Cache (#175) * add override cache to get state * Fix Read Voltage Validation (#176) * fix conv mode validation in read_voltage * Digital input module (#173) * adding din module and tests * Digital input reading #170 * Added test parameters * added exception and testing * digital out module #171 (#172) * Main README Update (#181) * Update README.md * update sdk package naming * update version num * added README and re-naming module (#182) * LED Module README (#183) * Create README.md * Update README.md Co-authored-by: sjpark608 <78987042+sjpark608@users.noreply.github.com> Co-authored-by: SJ Park Co-authored-by: sjpark608 commit 8e28a18f2475c2c60b198f3868f7b5b44a342e30 Merge: 521ab5a 5e10ef2 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Tue Dec 13 17:39:10 2022 -0800 Merge branch 'staging' into dev commit 521ab5aa8195db27f9abfa4bde059fcab4c0f82c Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Tue Dec 13 17:32:54 2022 -0800 LED Module README (#183) * Create README.md * Update README.md commit 5c4521b6b018e3381ca081e011adef229a09659d Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Tue Dec 13 17:31:54 2022 -0800 added README and re-naming module (#182) commit d569548bcf4d7f0c96a1929f8a94a395b70ab520 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Tue Dec 13 15:48:29 2022 -0800 Main README Update (#181) * Update README.md * update sdk package naming * update version num commit 8abe121ec609643d52ad47739d1608f27c520edb Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Tue Dec 13 15:14:57 2022 -0800 digital out module #171 (#172) commit 7d41626b475cf37fab374819370ce885a12b0a84 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Tue Dec 13 15:14:34 2022 -0800 Digital input module (#173) * adding din module and tests * Digital input reading #170 * Added test parameters * added exception and testing commit 903d86cf40d94c633c58c04ea0d25e71d5fd1255 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Tue Dec 13 14:50:37 2022 -0800 Fix Read Voltage Validation (#176) * fix conv mode validation in read_voltage commit 7992c80f507878b662ecabd1f71de0fbc18bbe7c Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Mon Dec 12 13:01:38 2022 -0800 Get State Override Cache (#175) * add override cache to get state commit be9ed27582c5865240410bb3c51f207ac81b5bf7 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Thu Dec 8 14:50:43 2022 -0800 GPIO DOUT pin list re-order (#169) * Update gpio_configs.py Forgotten change * fixed LED integration test commit 7c5cd6a6e7ed91a2c4525ae93727f2433c5c4576 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Thu Dec 8 11:34:25 2022 -0800 Gpio refactor 154 (#167) * added gpio exception, gpio write, need some testing on the hardware #166 #154 #155 * added set direction in out function, get direction function * edgepi gpio methods gets enum values typed string * changed function name used in different modules * fixed pytest and pylint issues * added toggle pin * deleted unused module * PR #167 suggested fix - added __pin_name_check() - added more tests commit c18b9630a78a1a11e611ad406a53c2b3ced1c759 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Fri Dec 2 17:20:40 2022 -0800 GPIO module refactoring intermediate PR (#161) * refactoring generating pin dictionary to have generic dictionary #154 #155 * generic object instantiation #154 #155 * Update test_dac.py dict_pin changed to expander_pin_dict after refactor * lint fix commit 4ac13b02a2db24b5336c3e7dc32ce9a08ae6c7a0 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Dec 2 11:29:13 2022 -0800 Hardware Tests (#162) * voltage read-write test * add test report to gitignore * custom approx comparator * move adc conversion time tests * update hardware test instructions * move integration tests to new folder * diff voltage tests * add adc_2 diff test * add rtd tests * bypass rtd validation in mux mapping * fix rtd temp calculation bug commit e2538aa44c17d931a5d30a3b4266c3c2209d3b11 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Thu Dec 1 10:32:43 2022 -0800 RTD Sampling (#160) commit 199f8442fa76303968857737fce5e9aedee27398 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Mon Nov 28 21:14:23 2022 -0800 GPIO refactoring in progress (#156) * gpio module refactored #153 * adding test cases fixing typos * gpio module refactor adding edgpi gpio test * fix suggestions commit 7530956e70b92b6f610145f2b5226f5e165adf60 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Wed Nov 23 11:18:18 2022 -0800 DAC Enum Args (#152) * refactor user interface to enum channel args commit 96a98f8812056e94e9aa40873a0b2193b3a885af Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Wed Nov 23 09:51:14 2022 -0800 dac conversion formula change (#146) * dac conversion formula change #143 #144 - added updated serialized file for testing - updated formula for voltage2code code2voltage - updated unittest - added serialized read helper file - deleted outdated dac_calibration files * pylint fix commit 5404dc25082f111b4dabfeb6ea7d3b5435290918 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Tue Nov 22 12:58:14 2022 -0800 Add ADC2 (#139) * add adc-2 to voltage reads, set_config commit 6ae2a20aced1cf99401e5af27cbf09bd5ad04ebc Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Tue Nov 22 11:26:58 2022 -0800 fixed typing issue (#136) #135 added test cases for checking the type commit 880165345a7a409a03db4a53cce9194897c6461d Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Tue Nov 22 11:25:02 2022 -0800 ADC Calibration (#138) * added eeprom reading to load calibration parameter * diff/individual voltage read calibration handling #133 Co-authored-by: sjpark608 commit ce617cadc6f599b6e707d13a9f2e34c8b8278092 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Nov 18 16:50:12 2022 -0800 ADC Get State (#132) * refactor get_state to EdgePiADC * refactor ADCModes * add get_register_map * use get_register_map for internal register reads * refactor ADCState * use new ADCState for getting state internally * add get mux states * refactor state query constants to module commit 84e38fff33996933cd65c215b97d3b93924ac9a7 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Thu Nov 17 18:13:58 2022 -0800 generate_calib_param dictionary added (#134) * generate_calib_param dictionary added * pytest fix * suggested fix - calib_params nomenclature - better description for docstring * suggest fix - calib param dataclass formation done in eeprom class - removed redundant methods and tests commit 0cd8d59de2de19def005b57a2554d89acf314e48 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Wed Nov 16 15:21:10 2022 -0800 Eeprom protobuf (#131) * protobuf implementation #126 #124 * test added * pylint fix and update dependencies * Update requirements_test.txt * delete Todos * suggested fixes * suggested name fix commit 1864d83e6b9d5ae7d27f068481fa21ffdb69af34 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Thu Nov 10 14:42:02 2022 -0800 Calibration suggestion (#129) * Nov1 code review suggestions * refactoring eeprom access module to accomodate the hardware change * EEPROM class is refactored to accomodate the larger memory size #125 * pylint fix commit 029d8e05e743f0dad45212e1295983314c20628a Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Thu Nov 10 10:42:44 2022 -0800 I2C set_msg function takes list of addresses (#128) * #127 added another type for addr parameter of set_read_msg and set_write_msg to accomodate a list of addresses * | was introduced in python 3.10 but the test automation is using python 3.9 commit 53bc029d9bc49d08691fb6a2a7c9e25672912176 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Tue Nov 8 15:44:26 2022 -0800 Remap ADC Multiplexers (#122) * mux mapping set mux_n to AINCOM * refactor mux arg handling in __config * refactor None checking, update docstring * remove temporary test fix * remove unnecessary test cases commit b494d979b77c81aeb0cff82cea7c53519dfc08ba Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Mon Nov 7 10:05:28 2022 -0800 ADC Differential Reads, RTD Mode (#118) * remove unused duplicate channel assignment code * fix pytest discovery error * add SPI debugging logs * change rtd_enabled check logic * diff read constants * rtd property check, set diff mode * unit test validate_no_rtd_conflict * unit test select_differential * ignore local test scripts * documentation additions * opcodes for RTD mode * doc updates, pytest config * unit test IDACMUX opcodes * unit test IDACMAG opcodes * fix IDACMAG opcode bug * fix REFMUX opcode bug * expand REFMUX opcode unit tests, renaming * uncomment adc config integration tests * integration test IDACMUX opcodes * integration test IDACMAG opcodes * integration test REFMUX opcodes * integration test select_differential * add idac channel 9 * fix opcode name, failing unit test * add rtd mode enums * add rtd_mode, todos for get_state with caching * rename __get_rtd_en_status * fix rtd_mode logic, unit test * integration test rtd_mode, fix bug commit 3b7bd1425bb7e5c4a4c3af63d7e69db44f5df22a Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Fri Nov 4 13:48:04 2022 -0700 Calibration dac (#120) * Update edgepi_dac.py adding calibration classes, need to check dictionary structure. implement DAC_GAIN parameter maybe needed * DAC calibration updated #111 - loading of calibration parameter from eeprom - generation and get calibration dictionary - check dac_gain state before code2voltage or voltage 2code conversion - conversion formula edited to accommodate the calibration param and dac gain state * set/clear internal DAC gain #76 * Update edgepi_dac.py PR #120 suggested fix * constant name change PR #120 suggested fix commit 9307713e49986d25835126c7da162d9ee10b7c29 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Nov 4 11:27:30 2022 -0700 Remove ADC Init Configs (#119) * remove configs from adc init * rename to private method commit 574f7ae7ab42b0fd83cec32559f3b6c7846ffb53 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Mon Oct 31 12:50:12 2022 -0700 Loading DAC related Calibration parameter from the EEPROM (#114) * dummy functions added for calibration added logger added generate calib dictionary functions , logics to be implemented * unpacking packing added unpacking: from list of parameter that read from eeprom to a single value packing : from a value to a list of bytes to load to the eeprom * calib dictionary generation for dac * loading calib param added and tested * Update test_edgepi_calibration.py updated the unit test for get_calibration_dict. Other module test cases are deleted for now * PR#114 fix - added a dictionary of functions - added more description to the address constants commit c8c02d7277c87746b00d86035416e02963af5ded Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Mon Oct 31 10:48:12 2022 -0700 Gpio delete set default (#116) * deleting obsolete function * added unit tests for functions changed gpio pin ordering of DAC module commit 620ff9b5bfa783e28cdd6e11ae47e6d74d4bcfb7 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Fri Oct 28 15:46:39 2022 -0700 Update edgepi_adc.py (#115) * Update edgepi_adc.py To Do added * Update edgepi_adc.py have a ruler set for pylint, and still fails on line-too-long :( commit ec507bf1d544dcd68ced027a7ca6819fd2ccb4d9 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Fri Oct 28 11:57:00 2022 -0700 Issue103 adc (#110) * adc testing being added * added test * Individual channel modification (#108) * Individual channel modification #103 - Only single pins gets accessed - simplified code calculate for now, calibration to be added * fixed voltage_to_code and code_to_voltage calculation * applying suggested fix * added todo and fixed pylint * used enums for pin names * Update edgepi_adc.py removed clear exapnder to avoid resetting of Ground reference when a new object is instantiated commit 12b6d7948b2f0049dcbabd9731bbd9d952a44547 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Thu Oct 27 11:08:43 2022 -0700 Issue102 dac (#109) * Individual channel modification #103 - Only single pins gets accessed - simplified code calculate for now, calibration to be added * adding get_state() dac #102 dac get_state is being added * fixed voltage_to_code and code_to_voltage calculation * passing pytest * changed the key from string name to number * changed get_state function #102 osensa/edgepi-device-manager/issues/3 * pylint fix commit 05e4f6f7184a42208bc8c436254d5770f8c40dc4 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Wed Oct 26 10:37:18 2022 -0700 Individual channel modification (#108) * Individual channel modification #103 - Only single pins gets accessed - simplified code calculate for now, calibration to be added * fixed voltage_to_code and code_to_voltage calculation * applying suggested fix commit bde0f95539ded9c794f3015eaa88432e2f2b7f8f Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Wed Oct 19 15:46:01 2022 -0700 LED Module (#106) commit f3efa759f6dee78689a74a99f11b1f96656b3709 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Wed Oct 19 12:41:47 2022 -0700 Get/Set Individual Pin States (#105) commit 0f01e33167fcee27958159190c55428c683fbf10 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Wed Oct 5 15:38:37 2022 -0700 Update test_adc_state.py (#100) #99 commit ab02437422b6341932cdb9b778190f8b86c3e834 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Wed Oct 5 11:41:11 2022 -0700 Adding functions to calibration class (#98) * adding helper class for calibration process * adding functions to generate necessary dictionaries * pylint fixes commit 5c60766fe8d1f105d91fc00ccf800fb911425ba6 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Mon Oct 3 14:18:03 2022 -0700 ADC Interface (#97) commit be0834dbc1d9e33ebe644e70f5d7bb87e4229796 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Fri Sep 30 16:05:41 2022 -0700 Calibration module (#92) * #83 creating files * adding unittest * Update test_access_eeprom.py * added unittest & i2c transfer return change * adding calibration mapping and class * Update edgepi_calibration.py todo notes added * pylint fix * code review suggestions * Requested PR fixes - Nomenclature files - Reg address name change -> mem_addr - Device address is a constant now - EEPROM class commit cbdf1e3fed30f959a7a727475ebfaedf6af17c57 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Wed Aug 3 17:44:46 2022 -0700 Dac calibration (#84) * refactoring calibration parameter dataclass #9 * changed test fixture for dac_command * calibration parameter refactored * dac calibration refactored * Update test_edgepi_dac.py linter fix * added and edited suggested comments commit 0c1753f8c263082c129fbace74ffdc68460b39b9 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Thu Jul 28 17:00:14 2022 -0700 DAC Interface (#77) * add set channel power mode * add set_gain_mode * add software reset * add readback * add code to voltage * integrate with gpio module commit 669f85df5cee14eace388136f5c94e286d05a86f Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Tue Jul 26 14:57:44 2022 -0700 Add Test Coverage (#79) * add code coverage to unit test workflow * add workflow status badges commit 38592b88647f695a79d7da5b6d30467222382d1c Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Mon Jul 25 09:14:53 2022 -0700 Edgepi gpio toggle (#75) * adding set_gpio function modified set_default and dgenerate default reg dict -instead of using list of dictionary, using dictionary format - set expander pin uses pin_name to set corresponding gpio #49 * clear expander pin * Toggle gpio pin added #49 * pylint passed" * adding set_gpio function modified set_default and dgenerate default reg dict -instead of using list of dictionary, using dictionary format - set expander pin uses pin_name to set corresponding gpio #49 * clear expander pin * Toggle gpio pin added #49 * pylint passed" * refactored for-loop test for __write_changed_values is not added since the function doesn't return any value and only execute the transaction * Readme added while working on the readme, i realized the order of AO_ENx pins were reversed. the order is fixed now * Update edgepi_gpio.py for loop replaced with a write change value method commit 6654a162a240bb43d85d627b814bb2b98bfac074 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Jul 22 14:36:30 2022 -0700 Unit Test Fixes (#74) * separate peripherals testing to unit/integration * testing workflow changes commit f4e458789d71f9bb6305083e988e5f95362b4651 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Fri Jul 22 10:31:50 2022 -0700 Edgepi gpio transfer (#62) * fixed I2C.Message Mocking * tested transfer function and it is working * set default in progress #51, #52, #50, #48 * more commands being added added more gpio state parameter in I2C info dataclass * Update edgepi_gpio.py added todo notes * set default in progress * Set default in progress another GPIO config added to I2CpinInfo dataclass adding helper methods read register and map register to dictionary * added reg helper class to generate the register dictionary. added another function to split pin list into two separate lists to check whether the gpio group uses two separate I2C expander * set-default need testing * set default tested * fixed I2C.Message Mocking * tested transfer function and it is working * set default in progress #51, #52, #50, #48 * more commands being added added more gpio state parameter in I2C info dataclass * Update edgepi_gpio.py added todo notes * set default in progress * Set default in progress another GPIO config added to I2CpinInfo dataclass adding helper methods read register and map register to dictionary * added reg helper class to generate the register dictionary. added another function to split pin list into two separate lists to check whether the gpio group uses two separate I2C expander * set-default need testing * set default tested * Update edgepi_tc.py the __ was deleted by accident * tests not passing * testing fixed * Update test_edgepi_gpio.py fixed tests * requested changed from Farzad * Todos added * working on todos, changed pin list to be self-explanatory, need to work on __generate_default_reg_dict to be more intuitie * changed naming conventions and using dictionary instead of list for describing pins * fixing pylint * fixing linting issue * fix I2C test and pylint on linux * disabled E1101 to go work around the error from mock class * fixed lint and testing mock commit 413752671fc183d91ed12a3f71dcad4bc4c5d79a Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Wed Jul 20 14:14:29 2022 -0700 TC Integration Tests (#70) * separate tests to unit and integration * add thermocouple integration tests * refactoring to support tc integration testing commit 030dedc8fca5dfc3d1f486dc502faa47239bbe74 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Mon Jul 11 16:25:14 2022 -0700 TC Set Temperatures (#60) * add temperature setting to set_config * add cold junction temp override method * add temperature input validation * add update_registers_from_dict and test * add temperature range validation by tc type * add custom exceptions, expand tempcode testing * add convert from DecBits to float * add cold-junction overwrite error commit c61240b8d36a1b7b6ec5771f951f1b39d3157eb8 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Mon Jul 11 09:51:15 2022 -0700 TC Compute Conversion Time (#63) * add compute conversion time * refactor single_sample for time delay computation * update time conv docstrings * inflate time delays commit 53716ac67a24fdad6755b2680ab821a892f7acc4 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Jul 8 17:17:42 2022 -0700 Fix TestPyPi (#66) commit c87a019af1fddfdf81efa26986eaef461b81d61d Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Thu Jul 7 15:31:40 2022 -0700 Fix Linting (#65) commit a3162e34576ecc8d92597ef1d0ebb1e01961bd93 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Thu Jun 30 10:55:51 2022 -0700 TC Open Circuit (#59) * add open fault detection mode config commit df3a8748641e4cd224c93f70b9956372678c14a8 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Tue Jun 28 09:55:25 2022 -0700 Edgepi gpio dac config (#55) * gpio-dac-config being implemented #20, #48, #49, #51, #16 * testing I2C * 1. Added gpio config #48 2. edgepi_gpio init method: instantiate super class when I2C gpio group selected and generate pin list #48 #51 #52 3. I2C mocking class for window and Linux environment, #16 * gpio module configurations packed as enum using enum to check configuration by iterating through the enum class * filter_dict by value (#53) * add names to test and lint workflows (#56) * add names to test and lint workflows * remove pytest-gpio workflow * added mock for testing I2C * gpio-dac-config being implemented #20, #48, #49, #51, #16 * testing I2C * 1. Added gpio config #48 2. edgepi_gpio init method: instantiate super class when I2C gpio group selected and generate pin list #48 #51 #52 3. I2C mocking class for window and Linux environment, #16 * gpio module configurations packed as enum using enum to check configuration by iterating through the enum class * added mock for testing I2C * combined repetitive dataclass fixed a problem with circular dependency * fixing pytest failures Co-authored-by: flavius-t <77416463+flavius-t@users.noreply.github.com> Co-authored-by: flavius-t commit 2658848a34608600336c71bcd20151677cee3e7a Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Mon Jun 27 16:50:57 2022 -0700 Pytest fix (#57) * Update adc_commands.py updated adc_command to fix the pytest issue * Update adc_commands.py updated adc_command to fix the pytest issue commit 2214dfade2c92e1f272f5989f7788c3fcf9651d5 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Mon Jun 27 16:06:54 2022 -0700 add names to test and lint workflows (#56) * add names to test and lint workflows * remove pytest-gpio workflow commit c1f4d7de41989ccc215778203824ae6ab669ab9b Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Mon Jun 27 15:38:50 2022 -0700 filter_dict by value (#53) commit 3aa534e4a5c529e82a9335c7d4e802108d4f0628 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Fri Jun 24 13:50:01 2022 -0700 added gpio_cofings.py to add configuration data class for dac #40 (#46) * added gpio_cofings.py to add configuration data class for dac #40 * changed function description * PR #46 fixes * steven can't write :( commit 95c81c68cd954e2aa6bb06b616a1fdd279769d23 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Jun 24 13:49:28 2022 -0700 refactor utilities to support non Enum set_config args (#47) * refactor utilities to support non Enum set_config args commit be55cbc6c2c5d829f661ee248de325bd001c37b0 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Thu Jun 23 15:24:28 2022 -0700 Update README module links (#45) Adding module link to ADC now that it is merged to dev, and updating other links to use relative link (so it links to folders on the same branch as top-level readme they're being accessed from) commit 7ef3c892a4fb93b2ba4919da646a7c9d808103b7 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Thu Jun 23 14:12:03 2022 -0700 Adc rebased and merge to dev (#43) * added constants #17 * adding Methods to ADCCommand class #17 * added write_register method, testing exception as well #17 * added dataclasses for register configurations, tests are added for testing immutable class #17 * added more registers and tests, #17 * added workflow for CI, #17 * modifying linting requirements * testing * changed global user and email * user name testing * added constants #17 * adding Methods to ADCCommand class #17 * added write_register method, testing exception as well #17 * added dataclasses for register configurations, tests are added for testing immutable class #17 * added more registers and tests, #17 * modifying linting requirements * testing * changed global user and email * user name testing * modified readme back to original state Co-authored-by: SJ Park commit 9f9c874a2c1efd5e0b69967c7fabc8dc5d790e31 Author: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Thu Jun 23 14:11:46 2022 -0700 Gpio merge for house keeping (#42) * gpio periphery being added * gpio periphery being added * rebase gpio branch * created gpio folder and files and tests * Feature branch git action added, gpio command and constants are added * github action yml changed * testing GPIO * gpio bias keyword takenout * path typeError troubleshooting * gpio in progress #20 * disable push test until fixing the bug * Update gpio.py add all keyword args * Update gpio.py passing arguments without keyword * Update gpio.py * gpio test issue resolved #20 * working on constants commit 454c8a5d1152d3b1d799de13a07470132bb81c71 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Thu Jun 23 14:11:15 2022 -0700 TC merge for housekeeping (#44) * add fault status reading * add fault mask configuration * tc module restructuring * update documentation * update decimal bit constants * Tc dev fixes (#36) * refactor fault reading * add human readable Fault printing * add option for less verbose fault reading * filter out normal status Faults * refactor fault masking to set individual masks commit 088be2c38b767141773da677bbd5feb4748d148e Merge: 0aaf792 6ee4ec6 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Tue Jun 21 14:28:22 2022 -0700 Merge pull request #35 from osensa/readme-fixes update README commit 6ee4ec63bc705758ae84659b85bd52dc6dfb9252 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Tue Jun 21 14:14:18 2022 -0700 remove install info from tc readme commit e13cfb360d2d0fbcc031d2fb568674adab721b3d Author: flavius-t Date: Tue Jun 21 20:41:19 2022 +0100 update README commit 5e10ef2c5a2c7627baadbf8859fa1d23b21f0c79 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Mon Jun 20 13:18:53 2022 -0700 Update README.md commit e832a847e2689ff41c5f32fc0bc4e611ba8802f5 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Mon Jun 20 13:18:27 2022 -0700 Update README.md commit 1f10130d9468e4aee869af7e790dd54f7313203d Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Mon Jun 20 13:09:04 2022 -0700 Update README.md commit ff8b06a3e4dc0aa1a20f5c9ba110e4bec003d07d Author: flavius-t Date: Mon Jun 20 19:16:50 2022 +0100 update package version commit cc3c0620b0b28735c5cba6c969ce6ea54cff4194 Author: flavius-t Date: Mon Jun 20 17:47:45 2022 +0100 update README commit 0aaf792ad417c6ca1d01b30eb137e0a12e8c190c Merge: e04099f 4ce46f7 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri Jun 17 17:47:20 2022 -0700 Merge pull request #28 from osensa/dev-fixes Dev fixes commit 4ce46f78d500aee244e5d51f6104930460cd1602 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Thu Jun 16 16:52:29 2022 -0700 Update README.md commit 110aecb22dc7e8536594b25f5511f290daff5ef2 Author: flavius-t Date: Fri Jun 17 00:48:29 2022 +0100 update requirements commit b01af9def90772ac2ab967fab4b6a1ce9b57f355 Author: flavius-t Date: Fri Jun 17 00:48:06 2022 +0100 abstract out hardware from edgepi_tc tests commit 0752a8e0783f6fddc64cc7fc2894de424325b3b8 Merge: 0f2897e e04099f Author: flavius-t Date: Thu Jun 16 20:39:31 2022 +0100 Merge branch 'dev' of github.com:osensa/edgepi-python-sdk into TC commit 0f2897e7380140270421ce1bd20bb0a7a45cf6f8 Author: flavius-t Date: Sat Jun 4 00:44:18 2022 +0100 add temperature sampling commit 0028994c25004d59aa5824a80353f074bcfd8462 Author: flavius-t Date: Fri Jun 3 18:07:12 2022 +0100 change workflows to dev branch only commit f5cefe0a5e23f16205d09a5ca832bf0b2161c472 Author: flavius-t Date: Fri Jun 3 17:41:08 2022 +0100 refactor unit testing workflow commit 9c7ab987f20c52902a10844e98b37c051c5f90fb Author: flavius-t Date: Fri Jun 3 01:00:20 2022 +0100 add update code generation for cr1 commit 2a4a4a7a3ee1adcd192a64432b2bca1a31a277e5 Author: flavius-t Date: Thu Jun 2 19:55:42 2022 +0100 refactor set_config with helper methods commit c7de215b4115cf313280536111c54f4d8cbe0b58 Author: flavius-t Date: Thu Jun 2 00:53:10 2022 +0100 refactor register reading commit 061c89bef6dad9f421489ae972ccb38ede6da640 Author: flavius-t Date: Wed Jun 1 23:41:44 2022 +0100 add gpiozero requirement until spi transfer fixed commit f7dc2abcf544aa81019cad6c324e75c5e2eb8297 Author: flavius-t Date: Wed Jun 1 23:40:11 2022 +0100 refactor mock spi transfer to library commit b4ed79d9f73772a2b0091d05a91f89ca60af75f5 Author: flavius-t Date: Wed Jun 1 23:23:38 2022 +0100 spi transfer issue debugging, and mock transfer commit a7a7f4d1251cb1c01e77d74ed5cd2fa9d953db40 Author: flavius-t Date: Mon May 30 23:52:56 2022 +0100 debug refactoring commit 90d3f48661a916b46bfd8fc0685b2c05ecc7969f Author: flavius-t Date: Mon May 30 18:46:19 2022 +0100 refactor update code generate methods commit d4bc2a08ed7b668f5fe28ea80be68b6a0b7da0a6 Author: flavius-t Date: Sat May 28 01:16:02 2022 +0100 add method for generating cr0 write command commit b5cc1ad42ddd7ee09333d3ee3d5faf583a3fe725 Author: flavius-t Date: Fri May 27 23:04:04 2022 +0100 add collective configuration method commit 1016f7e51df6d4f7c001c9ef69bfb2a32a78594c Author: flavius-t Date: Fri May 27 19:45:42 2022 +0100 add opcode to register mapping commit 78d5b33c1db58fb4eacb221e54016ad639e5aac1 Author: flavius-t Date: Fri May 27 01:00:02 2022 +0100 tc module structure update commit cccfb323d93a8b5ce76c650b9591ae06a5c5655a Author: flavius-t Date: Tue May 24 18:32:48 2022 +0100 update docstrings commit 155cdc8fc95e209276cf24943277cf5fecbea885 Author: flavius-t Date: Tue May 24 18:17:55 2022 +0100 fix lint errors commit c2189c947d61507512ee5c20686efce2483c6d23 Author: flavius-t Date: Tue May 24 18:02:35 2022 +0100 add pylint ignores commit 259d59833d169bc7f3e8f1f3fcd1e43df15bda23 Author: flavius-t Date: Tue May 24 17:59:44 2022 +0100 ignore trailing-whitespace commit 870715393ec48a9ce469e37b1c1e9543197be3d7 Author: flavius-t Date: Tue May 24 17:57:16 2022 +0100 refactor pylint workflow commit b1a96ded2b1d79d774829fc049414dc003781937 Author: flavius-t Date: Sat May 21 01:01:01 2022 +0100 initial tc module structure commit 237358192d66188b8d5323058f384b84b8642abc Author: flavius-t Date: Fri May 20 23:06:42 2022 +0100 activate virtual env commit 1651fc8c0389a812bd10e32e4748c0202aee80cb Author: flavius-t Date: Fri May 20 23:04:54 2022 +0100 fix workflow import errors commit 80c8866bb9ffa01ebcefdda397b0299ca1df8c0b Author: flavius-t Date: Fri May 20 20:02:20 2022 +0100 remove setup-python from self-hosted workflow commit 7035b89714405b1f650969f1fbb0c25ac7705029 Author: flavius-t Date: Fri May 20 19:43:52 2022 +0100 add self-hosted workflow runner commit e04099f2238d9e4353fbe63fc342d95692b92905 Merge: af3d655 b8043fd Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Thu Jun 16 11:42:30 2022 -0700 Merge pull request #23 from osensa/abstract-config Add utility module for generic register value updates commit b8043fd60c6c9995b13312fcf8396b6eaf698cd9 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Thu Jun 16 11:36:49 2022 -0700 Update README.md commit 4706d34c9dd569b5aac43bc6774f31b913108cde Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Wed Jun 15 16:37:16 2022 -0700 Update README.md commit 6ccd7de4f279fd17bba1c70beac68a29c344804b Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Wed Jun 15 16:32:43 2022 -0700 Update README.md commit 6abeafe2592945386daef340fd2fa1b3d7718f0d Author: flavius-t Date: Wed Jun 15 22:20:36 2022 +0100 add publishing workflows commit 82e0a65707ab50d797d4a9d918446733d72cc5ad Author: flavius-t Date: Wed Jun 15 20:19:56 2022 +0100 rename read_temps commit 6014098aba3c70d564a350f3037ab64b1aab183b Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Wed Jun 15 12:18:05 2022 -0700 Update and rename thermocouple.md to README.md commit 7810fda72d3cf702a2382fe10a33c30534f7cbe8 Author: flavius-t Date: Wed Jun 15 18:25:08 2022 +0100 move filter_dict to utilities module commit 31c4396a27f6fcef4598d0b48a618a85c3ca0473 Author: flavius-t Date: Wed Jun 15 18:09:52 2022 +0100 refactor register value map formatting commit e40e5fd1f449d5522e717a5ed49ad2fb0c4a37ef Author: flavius-t Date: Tue Jun 14 20:12:18 2022 +0100 update documentation commit f656b0d349de33980c7a48a7d85800af8c90f5e7 Author: flavius-t Date: Tue Jun 14 19:54:48 2022 +0100 closes #25 commit 360e41263e587e0d3a950d03826c77df1047c4b6 Author: flavius-t Date: Tue Jun 14 19:08:25 2022 +0100 update documentation commit 3d9791a57732be0d76450d95e9f81613f88398c8 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Tue Jun 14 11:06:14 2022 -0700 Update thermocouple.md commit 3356a414bc9aef218e74dc8efb664ec80f4b0b29 Author: flavius-t Date: Tue Jun 14 00:34:33 2022 +0100 cleanup outdated comments commit 72bdc18583f84f91082f54b75e2190bcb76241d1 Author: flavius-t Date: Mon Jun 13 23:11:17 2022 +0100 unit test negative_temp_check commit afb0d9725414fa4ba5ad2af6bfde52248101c78f Author: flavius-t Date: Mon Jun 13 22:46:39 2022 +0100 update documentation commit 6d4dc5671493e09d3b1a6288f4cb62254264e455 Author: flavius-t Date: Mon Jun 13 22:39:06 2022 +0100 unit test filter_dict commit 200f423de1c5fc81b2b7d18033d7a086f13deb52 Author: flavius-t Date: Mon Jun 13 22:28:03 2022 +0100 refactor filter utility function commit 1e228a754e23d8ce4b874c811f34b3f36e423de8 Author: flavius-t Date: Mon Jun 13 21:57:06 2022 +0100 input validation, unit testing for apply_opcodes commit 3434afa140b77d43d6bc9890f1f7e67b7afee5b1 Author: flavius-t Date: Mon Jun 13 20:20:07 2022 +0100 add_change_flags unit tests commit 1151edd2d4037f4315ad45efba9793ed2c3066c8 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Mon Jun 13 11:35:55 2022 -0700 Update thermocouple.md commit 54750d0d6879025b4e06c9f6ff9f62c814f0551c Author: flavius-t Date: Mon Jun 13 19:17:43 2022 +0100 add edge-cases to code_to_temp unit testing commit ddf69b4e5d74098bbc9aa4b9b3d285f4f2835a6b Author: flavius-t Date: Mon Jun 13 17:57:53 2022 +0100 add exceptions testing for code_to_temp commit 554f30b3d9d81357d634cbfbd66548bc2de35bd9 Author: flavius-t Date: Sat Jun 11 01:05:29 2022 +0100 add package install documentation commit 8702ba89d96ea723ed5a952c2e1797916b9f2e5c Author: flavius-t Date: Sat Jun 11 00:56:01 2022 +0100 add bitstring to package dependencies commit c41d45d31dcd3696952c88d4e25fd4daf5c39f9b Author: flavius-t Date: Sat Jun 11 00:46:46 2022 +0100 Revert "add bitstring to requirements" This reverts commit 3375cc622aad956238d5e821a3c06a08bd1fb374. commit 3375cc622aad956238d5e821a3c06a08bd1fb374 Author: flavius-t Date: Sat Jun 11 00:43:46 2022 +0100 add bitstring to requirements commit a627801e8bfe533c02cd1f871187e9d8edc4c573 Author: flavius-t Date: Fri Jun 10 23:41:17 2022 +0100 replace bitwise ops with bitstring pack commit 21aa2585f484edff6900470f02237f6657fcb9ce Author: flavius-t Date: Fri Jun 10 20:43:28 2022 +0100 pull request fixes commit 9f8e352089581b4426ff395c4fd444b4620c215a Author: flavius-t Date: Fri Jun 10 17:43:12 2022 +0100 fix incompatible mask checking bug commit 8409093d7c37e46f2d4966d183ff838470cd92df Author: flavius-t Date: Fri Jun 10 00:51:53 2022 +0100 remove redundant dictionary assignment commit 44cd3971d0414f4955f505698fccee045c5a943b Author: flavius-t Date: Fri Jun 10 00:07:52 2022 +0100 expand apply_opcode unit testing commit 83eef2456ce201b3acdc44f95259ce784778da31 Author: flavius-t Date: Thu Jun 9 22:57:05 2022 +0100 clean up comments commit f692845b1cf9e2ca1bad753c2f9c1879a7c71717 Author: flavius-t Date: Thu Jun 9 22:42:04 2022 +0100 add debug message to custom error commit 08009d2df5a34662ab48273d259b6356ad3d8135 Author: flavius-t Date: Thu Jun 9 20:55:13 2022 +0100 add unit test documentation commit 67c3e5098f3f3a69c668a60c00d89c2d1c73e76b Author: flavius-t Date: Thu Jun 9 20:32:39 2022 +0100 expand opcode unit tests commit 3503dff9bdb8dad66fc9995f813f66a99e2a561f Author: flavius-t Date: Thu Jun 9 19:59:32 2022 +0100 refactor temperature conversion commit 194214d101b309234f130eb6dcf4895779940cd9 Author: flavius-t Date: Thu Jun 9 19:18:06 2022 +0100 remove magic numbers commit 37d6dda5664d8df5d91e355ebc1fea6befa9174a Author: flavius-t Date: Thu Jun 9 19:01:50 2022 +0100 add change flags for register updates commit 1bcf9d22f60380934ecc1a664027b8be546dfe9e Author: flavius-t Date: Thu Jun 9 18:25:50 2022 +0100 add incompatible opcode mask check commit 5310cefe7e8eb1cc2f1fa73ab7b4061ac16f6b1c Author: flavius-t Date: Thu Jun 9 01:48:32 2022 +0100 unit tests, negative temperature sampling bug fix commit 0ef31b4312c3463c2c5af84b96715ebccf0a33e5 Author: flavius-t Date: Wed Jun 8 23:14:30 2022 +0100 abstract out register value updates commit ff5e7244b475e82198e62d8230404265c3abb443 Author: flavius-t Date: Sat Jun 4 00:44:18 2022 +0100 add temperature sampling commit 92e9c5e7e691e2319b643e93b304f7154189d215 Author: flavius-t Date: Fri Jun 3 18:07:12 2022 +0100 change workflows to dev branch only commit ca9601f1230edb7784e5d846c21ac3f6e39e0ff3 Author: flavius-t Date: Fri Jun 3 17:41:08 2022 +0100 refactor unit testing workflow commit eae6e3f25ab5ec2835ca566e5047eb608618b6e8 Author: flavius-t Date: Fri Jun 3 01:00:20 2022 +0100 add update code generation for cr1 commit 145ac0fdb55f6bad3c855a1999f0460bd1f722e4 Author: flavius-t Date: Thu Jun 2 19:55:42 2022 +0100 refactor set_config with helper methods commit a2a650ce41385390510e8497e9b5996237d700f2 Author: flavius-t Date: Thu Jun 2 00:53:10 2022 +0100 refactor register reading commit 986762b69c876f455ee3834144216574cc90a02b Author: flavius-t Date: Wed Jun 1 23:41:44 2022 +0100 add gpiozero requirement until spi transfer fixed commit ddfd0846c30506d230664366a1fe4ca2756dd212 Author: flavius-t Date: Wed Jun 1 23:40:11 2022 +0100 refactor mock spi transfer to library commit 16a9b1cd01d2fe0d2b2589e48eadc0f695acc5a9 Author: flavius-t Date: Wed Jun 1 23:23:38 2022 +0100 spi transfer issue debugging, and mock transfer commit 3b92b17608d4b7d98a4092c508920453c14464eb Author: flavius-t Date: Mon May 30 23:52:56 2022 +0100 debug refactoring commit 1393b3ce6530e67d8c569523e7685b2cd8a01485 Author: flavius-t Date: Mon May 30 18:46:19 2022 +0100 refactor update code generate methods commit 0af7d50b7455b3e0d29b9ce91094bd6fa077f539 Author: flavius-t Date: Sat May 28 01:16:02 2022 +0100 add method for generating cr0 write command commit 4d5b01c6bba29cd3151efd8dcfccef73ed299e86 Author: flavius-t Date: Fri May 27 23:04:04 2022 +0100 add collective configuration method commit 09a2694d359b768889a0e33e9ceae9f6c3719c40 Author: flavius-t Date: Fri May 27 19:45:42 2022 +0100 add opcode to register mapping commit af3d6553e059f1982e17ec731215f7d9498f7b8d Merge: 4440f31 b871a29 Author: flavius-t <77416463+flavius-t@users.noreply.github.com> Date: Fri May 27 10:00:44 2022 -0700 Merge pull request #19 from osensa/DAC fix update command opcodes commit b871a29eb32207424085c9745232f72df7518bbb Author: flavius-t Date: Fri May 27 17:50:28 2022 +0100 fix update command opcodes commit 3e9be2e66c438dce398fd9f7d2993e30fab43cca Author: flavius-t Date: Fri May 27 01:00:02 2022 +0100 tc module structure update commit 693c65016ce95b5c161132320067eefe0379f2ae Author: flavius-t Date: Tue May 24 18:32:48 2022 +0100 update docstrings commit 81a77a4b0ea20c9693f6f3fc64017b29e93b7741 Author: flavius-t Date: Tue May 24 18:17:55 2022 +0100 fix lint errors commit 9b177afc1c25a28d8c1802bc8124e030675c0e6f Author: flavius-t Date: Tue May 24 18:02:35 2022 +0100 add pylint ignores commit 3d8bda72ad8bc67da12276b7e2a1d8b07a990cff Author: flavius-t Date: Tue May 24 17:59:44 2022 +0100 ignore trailing-whitespace commit 35e19735bf4e3d21636bd0bc0dfc25ad2cf054fd Author: flavius-t Date: Tue May 24 17:57:16 2022 +0100 refactor pylint workflow commit c5ff8191337c70eef66caec63892e705ea03cba2 Author: flavius-t Date: Sat May 21 01:01:01 2022 +0100 initial tc module structure commit a7413d6fe354087b3afaf938d60c03b8cc39d3df Author: flavius-t Date: Fri May 20 23:06:42 2022 +0100 activate virtual env commit bec60bc370027348d4b0af7d0673115ed4db12f2 Author: flavius-t Date: Fri May 20 23:04:54 2022 +0100 fix workflow import errors commit fc1e715266e06d04120c037730171401f3a5dd19 Merge: 56fd203 e717c0f Author: flavius-t Date: Fri May 20 22:52:32 2022 +0100 Merge branch 'TC' of github.com:osensa/edgepi-python-sdk into TC commit 56fd203a7f9bf1889f8d30a6fbecd1d5e59f0515 Author: flavius-t Date: Fri May 20 22:51:52 2022 +0100 linting stringency changes commit e717c0f9ad0acf45b2e5d3b89360041d772d3d4c Author: flavius-t Date: Fri May 20 20:02:20 2022 +0100 remove setup-python from self-hosted workflow commit 4b215134ab0ce6b169e610c3af185d0427f332d5 Author: flavius-t Date: Fri May 20 19:43:52 2022 +0100 add self-hosted workflow runner commit 860adeb60a8049ea04e5e69029ea555aa5025645 Author: flavius-t Date: Thu May 19 00:53:15 2022 +0100 workflow fix commit 5afb0a24d202405c2cc70e54d8fbbdf18af1e244 Author: flavius-t Date: Thu May 19 00:02:34 2022 +0100 workflow fix commit 39c654f662abaef15d206dd447c3e4fa8fe97d21 Author: flavius-t Date: Wed May 18 23:58:57 2022 +0100 update workflow commit 8146e3f4c27ffce0be4c7bee0d568ea226431200 Author: flavius-t Date: Wed May 18 23:45:29 2022 +0100 initial tc module commit commit 1ecd1a6feab0625bafc378ba1a6fc09bf459865a Author: flavius-t Date: Wed May 18 23:01:33 2022 +0100 add venv activation between steps commit fb460d2932a7732a4ffd5585cb194c32e16c0652 Author: flavius-t Date: Wed May 18 22:56:47 2022 +0100 workflow fix commit 5cbe640430d6806f3556144b15dbd9b2cb87c9d5 Author: flavius-t Date: Wed May 18 22:51:59 2022 +0100 added linting and unit testing workflow --- .bumpversion.cfg | 4 +- setup.py | 2 +- src/edgepi/adc/edgepi_adc.py | 2 +- src/edgepi/calibration/edgepi_eeprom.py | 24 +- src/edgepi/calibration/eeprom_constants.py | 62 +--- src/edgepi/calibration/eeprom_mapping.proto | 6 +- src/edgepi/calibration/eeprom_mapping_pb2.py | 286 ++---------------- src/edgepi/calibration/protobuf_mapping.py | 80 +++++ src/edgepi/dac/edgepi_dac.py | 2 +- src/edgepi/digital_output/README.md | 57 ++-- src/edgepi/gpio/edgepi_gpio_chip.py | 8 +- src/edgepi/gpio/gpio_configs.py | 4 +- src/edgepi/peripherals/gpio.py | 2 +- src/edgepi/peripherals/i2c.py | 6 +- .../test_calibration/serializedFile | Bin 7003 -> 7174 bytes .../test_calibration/test_access_eeprom.py | 86 +++++- .../test_calibration/test_eeprom_constants.py | 53 ---- .../test_calibration/test_protobuf_mapping.py | 96 ++++++ .../unit_tests/test_dac/test_dac_commands.py | 8 +- .../unit_tests/test_dac/test_edgepi_dac.py | 37 ++- .../test_gpio/test_edgpepi_gpio_chip.py | 4 +- .../test_digital_out/__init__.py | 0 .../test_digital_out/test_digital_out.py | 36 +++ 23 files changed, 415 insertions(+), 450 deletions(-) create mode 100644 src/edgepi/calibration/protobuf_mapping.py delete mode 100644 src/test_edgepi/unit_tests/test_calibration/test_eeprom_constants.py create mode 100644 src/test_edgepi/unit_tests/test_calibration/test_protobuf_mapping.py create mode 100644 tests/integration_tests/test_digital_out/__init__.py create mode 100644 tests/integration_tests/test_digital_out/test_digital_out.py diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 9ba19940..b47eb4ab 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] -tag_name = "rc/v{new_version}" -current_version = 1.1.15 +tag_name = rc/v{new_version} +current_version = 1.1.17 diff --git a/setup.py b/setup.py index 3ee154ea..3678b5ff 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.15", + version="1.1.17", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", diff --git a/src/edgepi/adc/edgepi_adc.py b/src/edgepi/adc/edgepi_adc.py index 1a62fe73..d4e70950 100644 --- a/src/edgepi/adc/edgepi_adc.py +++ b/src/edgepi/adc/edgepi_adc.py @@ -223,7 +223,7 @@ def __init__( # Load eeprom data and generate dictionary of calibration dataclass eeprom = EdgePiEEPROM() eeprom_data = eeprom.get_edgepi_reserved_data() - self.adc_calib_params = eeprom_data.adc_calib_parms + self.adc_calib_params = eeprom_data.adc_calib_params self.adc_ops = ADCCommands() self.gpio = EdgePiGPIO() diff --git a/src/edgepi/calibration/edgepi_eeprom.py b/src/edgepi/calibration/edgepi_eeprom.py index ff7574aa..b5a427a8 100644 --- a/src/edgepi/calibration/edgepi_eeprom.py +++ b/src/edgepi/calibration/edgepi_eeprom.py @@ -1,13 +1,17 @@ '''Helper class to access on board eeprom''' +# pylint: disable=no-name-in-module +# https://github.com/protocolbuffers/protobuf/issues/10372 + import logging import math from edgepi.calibration.eeprom_constants import ( EEPROMInfo, EdgePiMemoryInfo, - MessageFieldNumber, - EdgePiEEPROMData) + MessageFieldNumber + ) +from edgepi.calibration.protobuf_mapping import EdgePiEEPROMData from edgepi.calibration.eeprom_mapping_pb2 import EepromLayout from edgepi.peripherals.i2c import I2CDevice @@ -20,6 +24,7 @@ class EdgePiEEPROM(I2CDevice): def __init__(self): self.log = logging.getLogger(__name__) + self.log.info("Initializing EEPROM Access") self.eeprom_layout = EepromLayout() super().__init__(self.__dev_path) @@ -98,16 +103,7 @@ def get_edgepi_reserved_data(self): """ # pylint: disable=no-member self.eeprom_layout.ParseFromString(self.__read_edgepi_reserved_memory()) - eeprom_data = EdgePiEEPROMData() - eeprom_data.dac_calib_parms=eeprom_data.message_to_dict(self.eeprom_layout.dac) - eeprom_data.adc_calib_parms=eeprom_data.message_to_dict(self.eeprom_layout.adc) - eeprom_data.rtd_calib_parms=eeprom_data.message_to_dict(self.eeprom_layout.rtd) - eeprom_data.tc_calib_parms=eeprom_data.message_to_dict(self.eeprom_layout.tc) - eeprom_data.config_key=eeprom_data.keys_to_str(self.eeprom_layout.config_key) - eeprom_data.data_key=eeprom_data.keys_to_str(self.eeprom_layout.data_key) - eeprom_data.serial= self.eeprom_layout.serial_number - eeprom_data.model= self.eeprom_layout.model - eeprom_data.client_id= self.eeprom_layout.client_id + eeprom_data = EdgePiEEPROMData(self.eeprom_layout) return eeprom_data def sequential_read(self, mem_addr: int = None, length: int = None): @@ -124,9 +120,9 @@ def sequential_read(self, mem_addr: int = None, length: int = None): page_addr, byte_addr = self.__byte_address_generation(mem_addr) mem_addr_list = self.__pack_mem_address(page_addr, byte_addr) msg = self.set_read_msg(mem_addr_list, [0x00]*length) - self.log.debug(f'Reading Address {mem_addr}, {length} bytes, {msg[1].data}') + self.log.debug(f'Reading Address {mem_addr}, {length} bytes') read_result = self.transfer(EEPROMInfo.DEV_ADDR.value, msg) - self.log.debug(f'Read data: {msg[1].data}') + self.log.debug(f'Read data: {len(msg[1].data)}') return read_result diff --git a/src/edgepi/calibration/eeprom_constants.py b/src/edgepi/calibration/eeprom_constants.py index 76c52d23..aabb9821 100644 --- a/src/edgepi/calibration/eeprom_constants.py +++ b/src/edgepi/calibration/eeprom_constants.py @@ -1,9 +1,6 @@ '''Address map of eeprom''' from enum import Enum -from dataclasses import dataclass -from edgepi.calibration.eeprom_mapping_pb2 import EepromLayout -from edgepi.calibration.calibration_constants import CalibParam class EEPROMInfo(Enum): """ @@ -28,6 +25,8 @@ class EdgePiMemoryInfo(Enum): """ USED_SPACE = 0x00 BUFF_START = 0x02 + USER_SPACE_START = 0x100 + USER_SPACE_END = 0x1FF class MessageFieldNumber(Enum): """ @@ -43,60 +42,3 @@ class MessageFieldNumber(Enum): SERIAL=7 MODEL=8 CLIENT_ID=9 - -@dataclass -class Keys: - """ - Dataclass to store key strings - """ - certificate: str = None - private: str = None - -@dataclass -class EdgePiEEPROMData: - # pylint: disable=too-many-instance-attributes - """ - Dataclass to store edgepi reserved values - dac_calib_parms (dict): list of calibration parameters - adc_calib_parms (dict): list of calibration parameters - rtd_calib_parms (dict): list of calibration parameters - tc_calib_parms (dict): list of calibration parameters - config_key (Keys): dataclass - data_key (Keys): dataclass - serial (str) - model (str) - client_id (str) - """ - dac_calib_parms: dict = None - adc_calib_parms: dict = None - rtd_calib_parms: dict = None - tc_calib_parms: dict = None - config_key: Keys = None - data_key: Keys = None - serial: str = None - model: str = None - client_id: str = None - - def message_to_dict(self, data_to_unpack: EepromLayout = None): - """ - Function to unpack message to list - Args: - data_to_unpack: EepromLayout message modules - Returns: - calib_list: 1-D array - """ - calib_dict={} - for indx, ch in enumerate(data_to_unpack.calibs): - calib_dict[indx] = CalibParam(gain=ch.gain, - offset=ch.offset) - return calib_dict - - def keys_to_str(self, data_to_unpack: EepromLayout = None): - """ - Function to unpack message to string - Args: - data_to_unpack: EepromLayout message keys - Returns: - Keys (dataclass): keys values - """ - return Keys(certificate = data_to_unpack.certificate, private = data_to_unpack.private_key) diff --git a/src/edgepi/calibration/eeprom_mapping.proto b/src/edgepi/calibration/eeprom_mapping.proto index 3c5dd1a1..c11f4b52 100644 --- a/src/edgepi/calibration/eeprom_mapping.proto +++ b/src/edgepi/calibration/eeprom_mapping.proto @@ -2,11 +2,15 @@ syntax = "proto3"; message EepromLayout{ message ModuleCalibParams{ - message ChannelCalib { + message ChannelCalib{ optional float gain = 1; optional float offset = 2; } + message HardwareValue{ + optional float ref_resistor = 1; + } repeated ChannelCalib calibs = 1; + repeated HardwareValue hw_val = 2; } message AwsKey{ string private_key = 1; diff --git a/src/edgepi/calibration/eeprom_mapping_pb2.py b/src/edgepi/calibration/eeprom_mapping_pb2.py index f5fac852..fa74c91b 100644 --- a/src/edgepi/calibration/eeprom_mapping_pb2.py +++ b/src/edgepi/calibration/eeprom_mapping_pb2.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: eeprom_mapping.proto - +"""Generated protocol buffer code.""" # pylint: skip-file +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection +from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) @@ -14,271 +14,21 @@ -DESCRIPTOR = _descriptor.FileDescriptor( - name='eeprom_mapping.proto', - package='', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x14\x65\x65prom_mapping.proto\"\xa4\x04\n\x0c\x45\x65promLayout\x12,\n\x03\x64\x61\x63\x18\x01 \x01(\x0b\x32\x1f.EepromLayout.ModuleCalibParams\x12,\n\x03\x61\x64\x63\x18\x02 \x01(\x0b\x32\x1f.EepromLayout.ModuleCalibParams\x12,\n\x03rtd\x18\x03 \x01(\x0b\x32\x1f.EepromLayout.ModuleCalibParams\x12+\n\x02tc\x18\x04 \x01(\x0b\x32\x1f.EepromLayout.ModuleCalibParams\x12(\n\nconfig_key\x18\x05 \x01(\x0b\x32\x14.EepromLayout.AwsKey\x12&\n\x08\x64\x61ta_key\x18\x06 \x01(\x0b\x32\x14.EepromLayout.AwsKey\x12\x15\n\rserial_number\x18\x07 \x01(\t\x12\r\n\x05model\x18\x08 \x01(\t\x12\x11\n\tclient_id\x18\t \x01(\t\x1a\x9d\x01\n\x11ModuleCalibParams\x12<\n\x06\x63\x61libs\x18\x01 \x03(\x0b\x32,.EepromLayout.ModuleCalibParams.ChannelCalib\x1aJ\n\x0c\x43hannelCalib\x12\x11\n\x04gain\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x13\n\x06offset\x18\x02 \x01(\x02H\x01\x88\x01\x01\x42\x07\n\x05_gainB\t\n\x07_offset\x1a\x32\n\x06\x41wsKey\x12\x13\n\x0bprivate_key\x18\x01 \x01(\t\x12\x13\n\x0b\x63\x65rtificate\x18\x02 \x01(\tb\x06proto3' -) - - - - -_EEPROMLAYOUT_MODULECALIBPARAMS_CHANNELCALIB = _descriptor.Descriptor( - name='ChannelCalib', - full_name='EepromLayout.ModuleCalibParams.ChannelCalib', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='gain', full_name='EepromLayout.ModuleCalibParams.ChannelCalib.gain', index=0, - number=1, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='offset', full_name='EepromLayout.ModuleCalibParams.ChannelCalib.offset', index=1, - number=2, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_gain', full_name='EepromLayout.ModuleCalibParams.ChannelCalib._gain', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_offset', full_name='EepromLayout.ModuleCalibParams.ChannelCalib._offset', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=447, - serialized_end=521, -) - -_EEPROMLAYOUT_MODULECALIBPARAMS = _descriptor.Descriptor( - name='ModuleCalibParams', - full_name='EepromLayout.ModuleCalibParams', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='calibs', full_name='EepromLayout.ModuleCalibParams.calibs', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_EEPROMLAYOUT_MODULECALIBPARAMS_CHANNELCALIB, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=364, - serialized_end=521, -) - -_EEPROMLAYOUT_AWSKEY = _descriptor.Descriptor( - name='AwsKey', - full_name='EepromLayout.AwsKey', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='private_key', full_name='EepromLayout.AwsKey.private_key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='certificate', full_name='EepromLayout.AwsKey.certificate', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=523, - serialized_end=573, -) - -_EEPROMLAYOUT = _descriptor.Descriptor( - name='EepromLayout', - full_name='EepromLayout', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='dac', full_name='EepromLayout.dac', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='adc', full_name='EepromLayout.adc', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='rtd', full_name='EepromLayout.rtd', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='tc', full_name='EepromLayout.tc', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='config_key', full_name='EepromLayout.config_key', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='data_key', full_name='EepromLayout.data_key', index=5, - number=6, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='serial_number', full_name='EepromLayout.serial_number', index=6, - number=7, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='model', full_name='EepromLayout.model', index=7, - number=8, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='client_id', full_name='EepromLayout.client_id', index=8, - number=9, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_EEPROMLAYOUT_MODULECALIBPARAMS, _EEPROMLAYOUT_AWSKEY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=25, - serialized_end=573, -) - -_EEPROMLAYOUT_MODULECALIBPARAMS_CHANNELCALIB.containing_type = _EEPROMLAYOUT_MODULECALIBPARAMS -_EEPROMLAYOUT_MODULECALIBPARAMS_CHANNELCALIB.oneofs_by_name['_gain'].fields.append( - _EEPROMLAYOUT_MODULECALIBPARAMS_CHANNELCALIB.fields_by_name['gain']) -_EEPROMLAYOUT_MODULECALIBPARAMS_CHANNELCALIB.fields_by_name['gain'].containing_oneof = _EEPROMLAYOUT_MODULECALIBPARAMS_CHANNELCALIB.oneofs_by_name['_gain'] -_EEPROMLAYOUT_MODULECALIBPARAMS_CHANNELCALIB.oneofs_by_name['_offset'].fields.append( - _EEPROMLAYOUT_MODULECALIBPARAMS_CHANNELCALIB.fields_by_name['offset']) -_EEPROMLAYOUT_MODULECALIBPARAMS_CHANNELCALIB.fields_by_name['offset'].containing_oneof = _EEPROMLAYOUT_MODULECALIBPARAMS_CHANNELCALIB.oneofs_by_name['_offset'] -_EEPROMLAYOUT_MODULECALIBPARAMS.fields_by_name['calibs'].message_type = _EEPROMLAYOUT_MODULECALIBPARAMS_CHANNELCALIB -_EEPROMLAYOUT_MODULECALIBPARAMS.containing_type = _EEPROMLAYOUT -_EEPROMLAYOUT_AWSKEY.containing_type = _EEPROMLAYOUT -_EEPROMLAYOUT.fields_by_name['dac'].message_type = _EEPROMLAYOUT_MODULECALIBPARAMS -_EEPROMLAYOUT.fields_by_name['adc'].message_type = _EEPROMLAYOUT_MODULECALIBPARAMS -_EEPROMLAYOUT.fields_by_name['rtd'].message_type = _EEPROMLAYOUT_MODULECALIBPARAMS -_EEPROMLAYOUT.fields_by_name['tc'].message_type = _EEPROMLAYOUT_MODULECALIBPARAMS -_EEPROMLAYOUT.fields_by_name['config_key'].message_type = _EEPROMLAYOUT_AWSKEY -_EEPROMLAYOUT.fields_by_name['data_key'].message_type = _EEPROMLAYOUT_AWSKEY -DESCRIPTOR.message_types_by_name['EepromLayout'] = _EEPROMLAYOUT -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -EepromLayout = _reflection.GeneratedProtocolMessageType('EepromLayout', (_message.Message,), { - - 'ModuleCalibParams' : _reflection.GeneratedProtocolMessageType('ModuleCalibParams', (_message.Message,), { - - 'ChannelCalib' : _reflection.GeneratedProtocolMessageType('ChannelCalib', (_message.Message,), { - 'DESCRIPTOR' : _EEPROMLAYOUT_MODULECALIBPARAMS_CHANNELCALIB, - '__module__' : 'eeprom_mapping_pb2' - # @@protoc_insertion_point(class_scope:EepromLayout.ModuleCalibParams.ChannelCalib) - }) - , - 'DESCRIPTOR' : _EEPROMLAYOUT_MODULECALIBPARAMS, - '__module__' : 'eeprom_mapping_pb2' - # @@protoc_insertion_point(class_scope:EepromLayout.ModuleCalibParams) - }) - , - - 'AwsKey' : _reflection.GeneratedProtocolMessageType('AwsKey', (_message.Message,), { - 'DESCRIPTOR' : _EEPROMLAYOUT_AWSKEY, - '__module__' : 'eeprom_mapping_pb2' - # @@protoc_insertion_point(class_scope:EepromLayout.AwsKey) - }) - , - 'DESCRIPTOR' : _EEPROMLAYOUT, - '__module__' : 'eeprom_mapping_pb2' - # @@protoc_insertion_point(class_scope:EepromLayout) - }) -_sym_db.RegisterMessage(EepromLayout) -_sym_db.RegisterMessage(EepromLayout.ModuleCalibParams) -_sym_db.RegisterMessage(EepromLayout.ModuleCalibParams.ChannelCalib) -_sym_db.RegisterMessage(EepromLayout.AwsKey) +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x65\x65prom_mapping.proto\"\xa0\x05\n\x0c\x45\x65promLayout\x12,\n\x03\x64\x61\x63\x18\x01 \x01(\x0b\x32\x1f.EepromLayout.ModuleCalibParams\x12,\n\x03\x61\x64\x63\x18\x02 \x01(\x0b\x32\x1f.EepromLayout.ModuleCalibParams\x12,\n\x03rtd\x18\x03 \x01(\x0b\x32\x1f.EepromLayout.ModuleCalibParams\x12+\n\x02tc\x18\x04 \x01(\x0b\x32\x1f.EepromLayout.ModuleCalibParams\x12(\n\nconfig_key\x18\x05 \x01(\x0b\x32\x14.EepromLayout.AwsKey\x12&\n\x08\x64\x61ta_key\x18\x06 \x01(\x0b\x32\x14.EepromLayout.AwsKey\x12\x15\n\rserial_number\x18\x07 \x01(\t\x12\r\n\x05model\x18\x08 \x01(\t\x12\x11\n\tclient_id\x18\t \x01(\t\x1a\x99\x02\n\x11ModuleCalibParams\x12<\n\x06\x63\x61libs\x18\x01 \x03(\x0b\x32,.EepromLayout.ModuleCalibParams.ChannelCalib\x12=\n\x06hw_val\x18\x02 \x03(\x0b\x32-.EepromLayout.ModuleCalibParams.HardwareValue\x1aJ\n\x0c\x43hannelCalib\x12\x11\n\x04gain\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x13\n\x06offset\x18\x02 \x01(\x02H\x01\x88\x01\x01\x42\x07\n\x05_gainB\t\n\x07_offset\x1a;\n\rHardwareValue\x12\x19\n\x0cref_resistor\x18\x01 \x01(\x02H\x00\x88\x01\x01\x42\x0f\n\r_ref_resistor\x1a\x32\n\x06\x41wsKey\x12\x13\n\x0bprivate_key\x18\x01 \x01(\t\x12\x13\n\x0b\x63\x65rtificate\x18\x02 \x01(\tb\x06proto3') +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'eeprom_mapping_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _EEPROMLAYOUT._serialized_start=25 + _EEPROMLAYOUT._serialized_end=697 + _EEPROMLAYOUT_MODULECALIBPARAMS._serialized_start=364 + _EEPROMLAYOUT_MODULECALIBPARAMS._serialized_end=645 + _EEPROMLAYOUT_MODULECALIBPARAMS_CHANNELCALIB._serialized_start=510 + _EEPROMLAYOUT_MODULECALIBPARAMS_CHANNELCALIB._serialized_end=584 + _EEPROMLAYOUT_MODULECALIBPARAMS_HARDWAREVALUE._serialized_start=586 + _EEPROMLAYOUT_MODULECALIBPARAMS_HARDWAREVALUE._serialized_end=645 + _EEPROMLAYOUT_AWSKEY._serialized_start=647 + _EEPROMLAYOUT_AWSKEY._serialized_end=697 # @@protoc_insertion_point(module_scope) diff --git a/src/edgepi/calibration/protobuf_mapping.py b/src/edgepi/calibration/protobuf_mapping.py new file mode 100644 index 00000000..4446cbc2 --- /dev/null +++ b/src/edgepi/calibration/protobuf_mapping.py @@ -0,0 +1,80 @@ +"""module to map protobuf data to a class""" + +# pylint: disable=no-name-in-module +# https://github.com/protocolbuffers/protobuf/issues/10372 +from dataclasses import dataclass +from edgepi.calibration.eeprom_mapping_pb2 import EepromLayout +from edgepi.calibration.calibration_constants import CalibParam + +@dataclass +class Keys: + """ + Dataclass to store key strings + """ + certificate: str = None + private: str = None + + +class EdgePiEEPROMData: + # pylint: disable=too-many-instance-attributes + """ + Dataclass to store edgepi reserved values + dac_calib_parms (dict): list of calibration parameters + adc_calib_parms (dict): list of calibration parameters + rtd_calib_parms (dict): list of calibration parameters + tc_calib_parms (dict): list of calibration parameters + config_key (Keys): dataclass + data_key (Keys): dataclass + serial (str) + model (str) + client_id (str) + """ + def __init__(self, data_to_unpack: EepromLayout = None): + self.dac_calib_params = self.calib_message_to_dict(data_to_unpack.dac) + self.adc_calib_params = self.calib_message_to_dict(data_to_unpack.adc) + self.rtd_calib_params = self.calib_message_to_dict(data_to_unpack.rtd) + self.rtd_hw_params = self.hw_message_to_dict(data_to_unpack.rtd) + self.tc_calib_params = self.calib_message_to_dict(data_to_unpack.tc) + self.tc_hw_params = self.hw_message_to_dict(data_to_unpack.tc) + self.config_key = self.keys_to_dataclass(data_to_unpack.config_key) + self.data_key = self.keys_to_dataclass(data_to_unpack.data_key) + self.serial = data_to_unpack.serial_number + self.model = data_to_unpack.model + self.client_id = data_to_unpack.client_id + + def calib_message_to_dict(self, data_to_unpack: EepromLayout = None): + """ + Function to unpack message to list + Args: + data_to_unpack: EepromLayout message modules + Returns: + calib_dict: calib param to dictionary + """ + calib_dict={} + for indx, ch in enumerate(data_to_unpack.calibs): + calib_dict[indx] = CalibParam(gain=ch.gain, + offset=ch.offset) + return calib_dict + + def hw_message_to_dict(self, data_to_unpack: EepromLayout = None): + """ + Function to unpack message to list + Args: + data_to_unpack: EepromLayout message modules + Returns: + hw_params: hardware param to dictionary + """ + hw_dict={} + for indx, ch in enumerate(data_to_unpack.hw_val): + hw_dict[indx] = ch.ref_resistor + return hw_dict + + def keys_to_dataclass(self, data_to_unpack: EepromLayout = None): + """ + Function to unpack message and populate into Keys dataclass in string format + Args: + data_to_unpack: EepromLayout message keys + Returns: + Keys (dataclass): keys values + """ + return Keys(certificate = data_to_unpack.certificate, private = data_to_unpack.private_key) diff --git a/src/edgepi/dac/edgepi_dac.py b/src/edgepi/dac/edgepi_dac.py index 1d6c145b..4038cbda 100644 --- a/src/edgepi/dac/edgepi_dac.py +++ b/src/edgepi/dac/edgepi_dac.py @@ -44,7 +44,7 @@ def __init__(self): # Read edgepi reserved data and generate calibration parameter dictionary eeprom = EdgePiEEPROM() eeprom_data = eeprom.get_edgepi_reserved_data() - dac_calib_params = eeprom_data.dac_calib_parms + dac_calib_params = eeprom_data.dac_calib_params self.dac_ops = DACCommands(dac_calib_params) self.gpio = EdgePiGPIO() diff --git a/src/edgepi/digital_output/README.md b/src/edgepi/digital_output/README.md index 0ef0e533..de67a40f 100644 --- a/src/edgepi/digital_output/README.md +++ b/src/edgepi/digital_output/README.md @@ -11,24 +11,35 @@ from edgepi.digital_output.edgepi_digital_output import EdgePiDigitalOutput digital_output = EdgePiDigitalOutput() -pin_1_state = digital_output.digital_output_direction(GpioPins.DIN1, True) -pin_2_state = digital_output.digital_output_direction(GpioPins.DIN2, True) -pin_3_state = digital_output.digital_output_direction(GpioPins.DIN3, True) -pin_4_state = digital_output.digital_output_direction(GpioPins.DIN4, True) -pin_5_state = digital_output.digital_output_direction(GpioPins.DIN5, True) -pin_6_state = digital_output.digital_output_direction(GpioPins.DIN6, True) -pin_7_state = digital_output.digital_output_direction(GpioPins.DIN7, True) -pin_8_state = digital_output.digital_output_direction(GpioPins.DIN8, True) - -pin_1_state = digital_output.digital_output_state(GpioPins.DIN1, True) -pin_2_state = digital_output.digital_output_state(GpioPins.DIN2, True) -pin_3_state = digital_output.digital_output_state(GpioPins.DIN3, True) -pin_4_state = digital_output.digital_output_state(GpioPins.DIN4, True) -pin_5_state = digital_output.digital_output_state(GpioPins.DIN5, True) -pin_6_state = digital_output.digital_output_state(GpioPins.DIN6, True) -pin_7_state = digital_output.digital_output_state(GpioPins.DIN7, True) -pin_8_state = digital_output.digital_output_state(GpioPins.DIN8, True) +# setting corresponding GpioPin to Output direction +digital_output.digital_output_direction(GpioPins.DOUT1, False) +digital_output.digital_output_direction(GpioPins.DOUT2, False) +digital_output.digital_output_direction(GpioPins.DOUT3, False) +digital_output.digital_output_direction(GpioPins.DOUT4, False) +digital_output.digital_output_direction(GpioPins.DOUT5, False) +digital_output.digital_output_direction(GpioPins.DOUT6, False) +digital_output.digital_output_direction(GpioPins.DOUT7, False) +digital_output.digital_output_direction(GpioPins.DOUT8, False) +# setting corresponding GpioPin to output High/On +digital_output.digital_output_state(GpioPins.DOUT1, True) +digital_output.digital_output_state(GpioPins.DOUT2, True) +digital_output.digital_output_state(GpioPins.DOUT3, True) +digital_output.digital_output_state(GpioPins.DOUT4, True) +digital_output.digital_output_state(GpioPins.DOUT5, True) +digital_output.digital_output_state(GpioPins.DOUT6, True) +digital_output.digital_output_state(GpioPins.DOUT7, True) +digital_output.digital_output_state(GpioPins.DOUT8, True) + +# setting corresponding GpioPin to output Low/Off +digital_output.digital_output_state(GpioPins.DOUT1, False) +digital_output.digital_output_state(GpioPins.DOUT2, False) +digital_output.digital_output_state(GpioPins.DOUT3, False) +digital_output.digital_output_state(GpioPins.DOUT4, False) +digital_output.digital_output_state(GpioPins.DOUT5, False) +digital_output.digital_output_state(GpioPins.DOUT6, False) +digital_output.digital_output_state(GpioPins.DOUT7, False) +digital_output.digital_output_state(GpioPins.DOUT8, False) ``` @@ -36,10 +47,22 @@ pin_8_state = digital_output.digital_output_state(GpioPins.DIN8, True) ```python def digital_output_state(self, pin_name: GpioPins = None, state: bool = None) + """ + change the output state of the pin to the state passed as argument + Args: + pin_name (GpioPins): GpioPin enums + state (bool): True = output high, False, output low + """ ``` Take `pin_name` and `state` as a parameter and sets the output state of the corresponding pin with the state passed. ```python def digital_output_direction(self, pin_name: GpioPins = None, direction: bool = None): + """ + change the output state of the pin to the state passed as argument + Args: + pin_name (GpioPins): GpioPin enums + state (bool): True = direction input, False = direction output + """ ``` Take `pin_name` and `direction` as a parameter and sets the direction of the corresponding pin with the state passed. diff --git a/src/edgepi/gpio/edgepi_gpio_chip.py b/src/edgepi/gpio/edgepi_gpio_chip.py index b010d27d..c99771d7 100644 --- a/src/edgepi/gpio/edgepi_gpio_chip.py +++ b/src/edgepi/gpio/edgepi_gpio_chip.py @@ -44,7 +44,7 @@ def read_gpio_pin_state(self, pin_name: str = None): pin_dir=self.gpiochip_pins_dict[pin_name].dir, pin_bias=self.gpiochip_pins_dict[pin_name].bias) state = self.read_state() - self.close() + self.close_gpio() return state def write_gpio_pin_state(self, pin_name: str = None, state: bool = None): @@ -61,7 +61,7 @@ def write_gpio_pin_state(self, pin_name: str = None, state: bool = None): pin_bias=self.gpiochip_pins_dict[pin_name].bias) self.write_state(state) read_back = self.read_state() - self.close() + self.close_gpio() return read_back def set_gpio_pin_dir(self, pin_name: str = None, direction: bool = None): @@ -74,7 +74,7 @@ def set_gpio_pin_dir(self, pin_name: str = None, direction: bool = None): self.open_gpio(pin_num=self.__pin_name_dict[pin_name], pin_dir="in" if direction else "out", pin_bias=self.gpiochip_pins_dict[pin_name].bias) - self.close() + self.close_gpio() def toggle_gpio_pin_state(self, pin_name: str = None): """ @@ -92,4 +92,4 @@ def toggle_gpio_pin_state(self, pin_name: str = None): self.write_state(False) else: self.write_state(True) - self.close() + self.close_gpio() diff --git a/src/edgepi/gpio/gpio_configs.py b/src/edgepi/gpio/gpio_configs.py index be0ab4a1..94b3bdee 100644 --- a/src/edgepi/gpio/gpio_configs.py +++ b/src/edgepi/gpio/gpio_configs.py @@ -232,6 +232,7 @@ class DOUTPins(Enum): ] _list_of_DOUT_expander_gpios =[ + None, None, DOUTPins.DOUT8.value, DOUTPins.DOUT7.value, DOUTPins.DOUT6.value, DOUTPins.DOUT5.value, DOUTPins.DOUT4.value, DOUTPins.DOUT3.value] @@ -349,7 +350,8 @@ def _generate_DOUT_expander_pins(): #pylint: disable=C0103 pin_dict = {} for pin, set_code, clear_code, dir_out_code, dir_in_code in \ zip(_list_of_DOUT_expander_gpios,GpioAOutputSet,GpioAOutputClear,GpioAPinDirOut,GpioAPinDirIn): - + if pin is None: + continue pin_dict.update({pin : I2cPinInfo(set_code.value, clear_code.value, dir_out_code.value, diff --git a/src/edgepi/peripherals/gpio.py b/src/edgepi/peripherals/gpio.py index 6038f330..65d01e66 100644 --- a/src/edgepi/peripherals/gpio.py +++ b/src/edgepi/peripherals/gpio.py @@ -43,6 +43,6 @@ def write_state(self, state: bool = None): """ self.gpio.write(state) - def close(self): + def close_gpio(self): """Close GPIO connection""" self.gpio.close() diff --git a/src/edgepi/peripherals/i2c.py b/src/edgepi/peripherals/i2c.py index 3b2b1450..e3b77887 100644 --- a/src/edgepi/peripherals/i2c.py +++ b/src/edgepi/peripherals/i2c.py @@ -4,17 +4,21 @@ Classes: I2CDevice """ +import logging from typing import Union from periphery import I2C +_logger = logging.getLogger(__name__) + class I2CDevice(): ''' I2C Device class ''' def __init__(self, fd: str = None): self.fd = fd - self.i2cdev = I2C(fd) + _logger.debug(f"Initialized I2C device with path '{self.fd}'") + self.i2cdev = I2C(devpath=fd) def set_read_msg(self, addr:Union[int,list] = None, msg:list = None): ''' diff --git a/src/test_edgepi/unit_tests/test_calibration/serializedFile b/src/test_edgepi/unit_tests/test_calibration/serializedFile index 492c80d22268a40835889aecde8784f16aac9ed9..95e386893ba8a1ee0d69a6b764fdd1234a9101e8 100644 GIT binary patch delta 963 zcmca@)@D)9mB7WtE6m$$FUs?yZ4Z#G`liWV)H`A}h}{(q6fYO90kQw91KI1Prh?cL zqk-()h{+)Ks$w8}rcpPDeNz|6KGd`T#ICvkG$+||@*bfHj6m*_nf3Of>2|`lK(@d_ zAba9wCLp_>SH8W$Uew=Ac`s1nEE`Z_`=St#q6k5tIK!J#Yam^LwvA51;~lZsp*@e9l#Qji5ia!Y_nA28VqCeMLMeo2sc z0GONzCLM%9B8^~Dmlwp&1C#4{ErD!)X*m{NE}=p1NOoQ>qtU>mQj7!RT~}HU0L>fj A#sB~S delta 686 zcmZp(xNTO?mB7WtE0Eh{FY4;uxChAo^AO0cINS$f8~*~b^N!B~v2$C2Y%kqf5PRZ9 zAUkk>H(1SlAiK%E6U6=z2U5dW0%CLK1KCR$O7;kWY^eNMZ!gMe;$Z`1H(#!^7yY;F zBuG`-995u1pqnR%!`%gBGZ_A~2C}Wnf$V=5Cxh5woelP)(}Ne=0@*D8ftnRAfSp&b z2voBn&}okp4^SpSy4hZ|(rDTqB@~|45-G0!$rsrbCi{yzPM!$FCm9_lb2B+k_66d8 zAifC12RI!k$BR2oUI@fDnH?ufvp7zU1>*TY{1AvQa63-Umvo%G5r|*1I!@MRbDW$D m#Os0hBM?8}b(~x;Z8>>8yBsr@5MAwK<1!lVUYvYGS`Pr0hU?k@ diff --git a/src/test_edgepi/unit_tests/test_calibration/test_access_eeprom.py b/src/test_edgepi/unit_tests/test_calibration/test_access_eeprom.py index 44cbbbc9..f4058cad 100644 --- a/src/test_edgepi/unit_tests/test_calibration/test_access_eeprom.py +++ b/src/test_edgepi/unit_tests/test_calibration/test_access_eeprom.py @@ -1,7 +1,8 @@ '''unit test for access eeprom''' # pylint: disable=C0413 - +# pylint: disable=no-name-in-module +# https://github.com/protocolbuffers/protobuf/issues/10372 from unittest import mock import os @@ -12,6 +13,7 @@ import pytest from edgepi.calibration.eeprom_constants import MessageFieldNumber from edgepi.calibration.edgepi_eeprom import EdgePiEEPROM +from edgepi.calibration.calibration_constants import CalibParam from edgepi.calibration.eeprom_mapping_pb2 import EepromLayout @pytest.fixture(name="eeprom") @@ -107,6 +109,54 @@ def test_get_message_of_interest(mocker, msg, eeprom): msg_of_interest = eeprom.get_message_of_interest(msg) assert msg_of_interest == memory_contents.ListFields()[msg.value -1][1] + +dac_dict_calib = {0:CalibParam(gain = 1.02383653, offset=-0.0164757), + 1:CalibParam(gain = 1.02283154, offset=-0.018963), + 2:CalibParam(gain = 1.02610898, offset=-0.0153855), + 3:CalibParam(gain = 1.02465811, offset=-0.0182012), + 4:CalibParam(gain = 1.02623188, offset=-0.0179865), + 5:CalibParam(gain = 1.02696733, offset=-0.0169919), + 6:CalibParam(gain = 1.0248366, offset=-0.0195936), + 7:CalibParam(gain = 1.02198715, offset=-0.0179717)} + +adc_dict_calib = {0:CalibParam(gain = 0.998441907, offset=0.035948182), + 1:CalibParam(gain = 0.998551392, offset=0.03190953), + 2:CalibParam(gain = 1.004123580, offset=-0.039846713), + 3:CalibParam(gain = 0.996197528, offset=0.05191299), + 4:CalibParam(gain = 1.000529260, offset=0.00375247), + 5:CalibParam(gain = 0.995760365, offset=0.05806301), + 6:CalibParam(gain = 0.993060022, offset=0.09193925), + 7:CalibParam(gain = 0.997010247, offset=0.04080028), + 8:CalibParam(gain = 0.998583581, offset=-0.004391864), + 9:CalibParam(gain = 0.996344494, offset=0.09228059), + 10:CalibParam(gain = 0.995856966, offset=0.05618589), + 11:CalibParam(gain = 0.997157199, offset=-0.049672102)} + +rtd_dict_calib = {0:CalibParam(gain = 1, offset=0)} +rtd_dict_hw= {0:1985.60} +tc_dict_calib = {0:CalibParam(gain = 1.024272873, offset=-0.018334615)} +tc_dict_hw = {0:1} + + +KEYS = '-----BEGIN RSA PRIVATE KEY-----\r\nMIIEpQIBAAKCAQEAnwu+S/OI3Hl0BCNQASv0HU5Jc4KUT2X4/tLykG+T\ +mZQcd6pE\r\nv7fji6ZoW/dl8dKwwdi/cfSS/J5Iv+5FwQU4KGNBbhVAnmJeLd+PMUT4bQTf9rVF\r\nHsDoIPoQLDH7jmBu8ai\ +7jQ0hY5SqPbynPGELFrk/vEpHwg/8fO4lbw1YxwgGc0SR\r\n8k1tFdi4On7NymBiv88HOsrrziAPGCd7Hc07s+SdFQF+nDPidy\ +M1pMqvUC25c5Sk\r\ncsrBlMgmcSRY8y6MJFPObg0ahLsI/YT+jT2G6AioQOz9ZJ89DSzjEfoFK9KlIzq1\r\n46THPR8Tdc9qu\ +chsqfX1zvxKdrQPbdtC7ZnMhQIDAQABAoIBAQCccv3PUpGXZzVz\r\neJUTgfwQ89iW8qUXcVS8vh7za35CvYo/QFN+T9JapefU\ +R4mVlk5fcOnpm88XBlDD\r\n1AvzskGqoPBU7DzzUAoaj+YYbiL9gqUY1vlWJiZxgep0vvoX9M5Nk1BikL7+aNgK\r\nANB1OXS\ +h9ro2as8pm3YgIlbaZcOli7doqtDM4kzxpKOhSAwtQqAS15GwMsKyhs1q\r\nvN6BqTBQE7XjdO5k1GCT4+vWEnptKMlLxi/zj1\ +uAXuAmujKHf3FcNqnrmNQ2v5+g\r\nNmuFCiknrtK5p5va67g6JgWqy45EG5CJLupIpM31xmewFXtlsfh3/fYSzkZqK9jX\r\nH\ +g/Wq7ShAoGBAMqzZTr2kjxtP0UjN4S5L0da7k4UX+4GEJRrQgG6RUgrL5eq4tfc\r\nT4DU7mp7SAb7FVwZmJ5kXZ33aQBF6UYR\ +uIpzUWRT+QOfzeTeJSQGAR8Ng/STNaUt\r\nD9XalRJSYn49LMGTgFebKJakIUC7lZ0ZZxpP1yFZbmYtJN1xFB/jhfGdAoGBAMj\ +d\r\nwuzc5VPJV5fQte6lTcnTzkqnPXnSvpf4sK+22i/1xGi0kbdimQiXHPj2xnwQmygN\r\n3a+l2ysChimOx2qqVdeFQbAveK\ +wYYSk41R10PmsQE14CgREN3r1XcXGz4mqXpL8l\r\n7Ry2HOIDQjTRVye2YdRO0zu3+egdFz4UTnxE8yYJAoGBAIM5+MNfdfTg1\ +SExV3P5\r\nX35WhAjQb/psurcbaTQtH0VFkB4kZ49P9bh2IZOWFF9Qldd2SrPgTitCTRv8JrVS\r\nK6KWXY8SPhf2kRkmJ+1W\ +ZctwuIjR9Nzme2X7iJ6/7zvC5wK7N0+AB5rezxhVWNrH\r\n41PJdIEGoM5NU5x45IpwhfqRAoGANpYdbOUy5SwoQ7eSWYJOu3R\ +18U+1oy+kYART\r\nb80PSk1NzO6VUvLWh8EZPIdDtV+F6sKp5hv6jZun/g8xHkmf/mvWSBz+fDY74Uny\r\nkIiQlePOf5PKo2\ +nTiD0FNVMfSrxfJxsVbuIGw10DVvs05jPoLhwlx2rd3ThaoqI+\r\nGgNa2JECgYEAwEEEq7dxGXYmlIhTs5IiEleLjBydQ9B1P\ +8zIIApLJdHuu50K7ifq\r\nVYWC0QMrAr4lWmJ3ZAmewtrgDh4/6JBWKdpKfX6qm88MpID0arS+jJkQBuMNIafI\r\nGqnLR1sn\ +5N91UjPItE3NPhYX5LvQMjIuHt8AiyNepTxS32VzVTx2z+A=\r\n-----END RSA PRIVATE KEY-----\r\n' + def test_get_edgepi_reserved_data(mocker, eeprom): # pylint: disable=protected-access mocker.patch( @@ -114,13 +164,27 @@ def test_get_edgepi_reserved_data(mocker, eeprom): return_value = read_binfile()) memory_contents = EepromLayout() memory_contents.ParseFromString(read_binfile()) - edgepi_eeprom_dataclass = eeprom.get_edgepi_reserved_data() - assert edgepi_eeprom_dataclass.dac_calib_parms is not None - assert edgepi_eeprom_dataclass.adc_calib_parms is not None - assert edgepi_eeprom_dataclass.rtd_calib_parms is not None - assert edgepi_eeprom_dataclass.tc_calib_parms is not None - assert edgepi_eeprom_dataclass.config_key is not None - assert edgepi_eeprom_dataclass.data_key is not None - assert edgepi_eeprom_dataclass.serial is not None - assert edgepi_eeprom_dataclass.model is not None - assert edgepi_eeprom_dataclass.client_id is not None + eeprom_data = eeprom.get_edgepi_reserved_data() + for key, value in eeprom_data.dac_calib_params.items(): + assert value.gain == pytest.approx(dac_dict_calib[key].gain) + assert value.offset == pytest.approx(dac_dict_calib[key].offset) + for key, value in eeprom_data.adc_calib_params.items(): + assert value.gain == pytest.approx(adc_dict_calib[key].gain) + assert value.offset == pytest.approx(adc_dict_calib[key].offset) + for key, value in eeprom_data.tc_calib_params.items(): + assert value.gain == pytest.approx(tc_dict_calib[key].gain) + assert value.offset == pytest.approx(tc_dict_calib[key].offset) + for key, value in eeprom_data.tc_hw_params.items(): + assert value == pytest.approx(tc_dict_hw[key]) + for key, value in eeprom_data.rtd_calib_params.items(): + assert value.gain == pytest.approx(rtd_dict_calib[key].gain) + assert value.offset == pytest.approx(rtd_dict_calib[key].offset) + for key, value in eeprom_data.rtd_hw_params.items(): + assert value == pytest.approx(rtd_dict_hw[key]) + assert eeprom_data.serial == '20221110-021' + assert eeprom_data.model == 'EdgePi-Bearbone' + assert eeprom_data.client_id == 'SO-2022-1023' + assert eeprom_data.config_key.certificate == KEYS + assert eeprom_data.config_key.private == KEYS + assert eeprom_data.data_key.certificate == KEYS + assert eeprom_data.data_key.certificate == KEYS diff --git a/src/test_edgepi/unit_tests/test_calibration/test_eeprom_constants.py b/src/test_edgepi/unit_tests/test_calibration/test_eeprom_constants.py deleted file mode 100644 index 3d693060..00000000 --- a/src/test_edgepi/unit_tests/test_calibration/test_eeprom_constants.py +++ /dev/null @@ -1,53 +0,0 @@ -'''unit test for access eeprom''' -# pylint: disable=C0413 -# pylint: disable=no-member -from unittest import mock -import os -PATH = os.path.dirname(os.path.abspath(__file__)) -import sys -sys.modules['periphery'] = mock.MagicMock() - -from edgepi.calibration.eeprom_constants import EdgePiEEPROMData, Keys -from edgepi.calibration.eeprom_mapping_pb2 import EepromLayout - -def read_binfile(): - """Read the dummy serializedFile and return byte string""" - with open(PATH+"/serializedFile","rb") as fd: - b_string = fd.read() - return b_string - -def test_edgepi_eeprom_data(): - memory_map = EepromLayout() - memory_map.ParseFromString(read_binfile()) - eeprom_data = EdgePiEEPROMData() - eeprom_data.dac_calib_parms=eeprom_data.message_to_dict(memory_map.dac) - eeprom_data.adc_calib_parms=eeprom_data.message_to_dict(memory_map.adc) - eeprom_data.rtd_calib_parms=eeprom_data.message_to_dict(memory_map.rtd) - eeprom_data.tc_calib_parms=eeprom_data.message_to_dict(memory_map.tc) - eeprom_data.config_key=eeprom_data.keys_to_str(memory_map.config_key) - eeprom_data.data_key=eeprom_data.keys_to_str(memory_map.data_key) - eeprom_data.serial=memory_map.serial_number - eeprom_data.model=memory_map.model - eeprom_data.client_id=memory_map.client_id - assert isinstance(eeprom_data.dac_calib_parms, dict) - assert isinstance(eeprom_data.adc_calib_parms, dict) - assert isinstance(eeprom_data.rtd_calib_parms, dict) - assert isinstance(eeprom_data.tc_calib_parms, dict) - assert isinstance(eeprom_data.config_key, Keys) - assert isinstance(eeprom_data.config_key, Keys) - assert isinstance(eeprom_data.data_key, Keys) - assert isinstance(eeprom_data.data_key, Keys) - assert isinstance(eeprom_data.serial, str) - assert isinstance(eeprom_data.model, str) - assert isinstance(eeprom_data.client_id, str) - assert eeprom_data.dac_calib_parms == eeprom_data.message_to_dict(memory_map.dac) - assert eeprom_data.adc_calib_parms==eeprom_data.message_to_dict(memory_map.adc) - assert eeprom_data.rtd_calib_parms==eeprom_data.message_to_dict(memory_map.rtd) - assert eeprom_data.tc_calib_parms==eeprom_data.message_to_dict(memory_map.tc) - assert eeprom_data.config_key.certificate == memory_map.config_key.certificate - assert eeprom_data.config_key.private == memory_map.config_key.private_key - assert eeprom_data.data_key.certificate == memory_map.data_key.certificate - assert eeprom_data.data_key.private == memory_map.data_key.private_key - assert eeprom_data.serial == memory_map.serial_number - assert eeprom_data.model == memory_map.model - assert eeprom_data.client_id == memory_map.client_id diff --git a/src/test_edgepi/unit_tests/test_calibration/test_protobuf_mapping.py b/src/test_edgepi/unit_tests/test_calibration/test_protobuf_mapping.py new file mode 100644 index 00000000..8a0d7d52 --- /dev/null +++ b/src/test_edgepi/unit_tests/test_calibration/test_protobuf_mapping.py @@ -0,0 +1,96 @@ +'''unit test for access eeprom''' +# pylint: disable=C0413 +# pylint: disable=no-member +# pylint: disable=no-name-in-module +# https://github.com/protocolbuffers/protobuf/issues/10372 +from unittest import mock +import os +PATH = os.path.dirname(os.path.abspath(__file__)) +import sys +sys.modules['periphery'] = mock.MagicMock() + +import pytest +from edgepi.calibration.protobuf_mapping import EdgePiEEPROMData +from edgepi.calibration.calibration_constants import CalibParam +from edgepi.calibration.eeprom_mapping_pb2 import EepromLayout + +def read_binfile(): + """Read the dummy serializedFile and return byte string""" + with open(PATH+"/serializedFile","rb") as fd: + b_string = fd.read() + return b_string + +dac_dict_calib = {0:CalibParam(gain = 1.02383653, offset=-0.0164757), + 1:CalibParam(gain = 1.02283154, offset=-0.018963), + 2:CalibParam(gain = 1.02610898, offset=-0.0153855), + 3:CalibParam(gain = 1.02465811, offset=-0.0182012), + 4:CalibParam(gain = 1.02623188, offset=-0.0179865), + 5:CalibParam(gain = 1.02696733, offset=-0.0169919), + 6:CalibParam(gain = 1.0248366, offset=-0.0195936), + 7:CalibParam(gain = 1.02198715, offset=-0.0179717)} + +adc_dict_calib = {0:CalibParam(gain = 0.998441907, offset=0.035948182), + 1:CalibParam(gain = 0.998551392, offset=0.03190953), + 2:CalibParam(gain = 1.004123580, offset=-0.039846713), + 3:CalibParam(gain = 0.996197528, offset=0.05191299), + 4:CalibParam(gain = 1.000529260, offset=0.00375247), + 5:CalibParam(gain = 0.995760365, offset=0.05806301), + 6:CalibParam(gain = 0.993060022, offset=0.09193925), + 7:CalibParam(gain = 0.997010247, offset=0.04080028), + 8:CalibParam(gain = 0.998583581, offset=-0.004391864), + 9:CalibParam(gain = 0.996344494, offset=0.09228059), + 10:CalibParam(gain = 0.995856966, offset=0.05618589), + 11:CalibParam(gain = 0.997157199, offset=-0.049672102)} + +rtd_dict_calib = {0:CalibParam(gain = 1, offset=0)} +rtd_dict_hw= {0:1985.60} +tc_dict_calib = {0:CalibParam(gain = 1.024272873, offset=-0.018334615)} +tc_dict_hw = {0:1} + + +KEYS = '-----BEGIN RSA PRIVATE KEY-----\r\nMIIEpQIBAAKCAQEAnwu+S/OI3Hl0BCNQASv0HU5Jc4KUT2X4/tLykG+T\ +mZQcd6pE\r\nv7fji6ZoW/dl8dKwwdi/cfSS/J5Iv+5FwQU4KGNBbhVAnmJeLd+PMUT4bQTf9rVF\r\nHsDoIPoQLDH7jmBu8ai\ +7jQ0hY5SqPbynPGELFrk/vEpHwg/8fO4lbw1YxwgGc0SR\r\n8k1tFdi4On7NymBiv88HOsrrziAPGCd7Hc07s+SdFQF+nDPidy\ +M1pMqvUC25c5Sk\r\ncsrBlMgmcSRY8y6MJFPObg0ahLsI/YT+jT2G6AioQOz9ZJ89DSzjEfoFK9KlIzq1\r\n46THPR8Tdc9qu\ +chsqfX1zvxKdrQPbdtC7ZnMhQIDAQABAoIBAQCccv3PUpGXZzVz\r\neJUTgfwQ89iW8qUXcVS8vh7za35CvYo/QFN+T9JapefU\ +R4mVlk5fcOnpm88XBlDD\r\n1AvzskGqoPBU7DzzUAoaj+YYbiL9gqUY1vlWJiZxgep0vvoX9M5Nk1BikL7+aNgK\r\nANB1OXS\ +h9ro2as8pm3YgIlbaZcOli7doqtDM4kzxpKOhSAwtQqAS15GwMsKyhs1q\r\nvN6BqTBQE7XjdO5k1GCT4+vWEnptKMlLxi/zj1\ +uAXuAmujKHf3FcNqnrmNQ2v5+g\r\nNmuFCiknrtK5p5va67g6JgWqy45EG5CJLupIpM31xmewFXtlsfh3/fYSzkZqK9jX\r\nH\ +g/Wq7ShAoGBAMqzZTr2kjxtP0UjN4S5L0da7k4UX+4GEJRrQgG6RUgrL5eq4tfc\r\nT4DU7mp7SAb7FVwZmJ5kXZ33aQBF6UYR\ +uIpzUWRT+QOfzeTeJSQGAR8Ng/STNaUt\r\nD9XalRJSYn49LMGTgFebKJakIUC7lZ0ZZxpP1yFZbmYtJN1xFB/jhfGdAoGBAMj\ +d\r\nwuzc5VPJV5fQte6lTcnTzkqnPXnSvpf4sK+22i/1xGi0kbdimQiXHPj2xnwQmygN\r\n3a+l2ysChimOx2qqVdeFQbAveK\ +wYYSk41R10PmsQE14CgREN3r1XcXGz4mqXpL8l\r\n7Ry2HOIDQjTRVye2YdRO0zu3+egdFz4UTnxE8yYJAoGBAIM5+MNfdfTg1\ +SExV3P5\r\nX35WhAjQb/psurcbaTQtH0VFkB4kZ49P9bh2IZOWFF9Qldd2SrPgTitCTRv8JrVS\r\nK6KWXY8SPhf2kRkmJ+1W\ +ZctwuIjR9Nzme2X7iJ6/7zvC5wK7N0+AB5rezxhVWNrH\r\n41PJdIEGoM5NU5x45IpwhfqRAoGANpYdbOUy5SwoQ7eSWYJOu3R\ +18U+1oy+kYART\r\nb80PSk1NzO6VUvLWh8EZPIdDtV+F6sKp5hv6jZun/g8xHkmf/mvWSBz+fDY74Uny\r\nkIiQlePOf5PKo2\ +nTiD0FNVMfSrxfJxsVbuIGw10DVvs05jPoLhwlx2rd3ThaoqI+\r\nGgNa2JECgYEAwEEEq7dxGXYmlIhTs5IiEleLjBydQ9B1P\ +8zIIApLJdHuu50K7ifq\r\nVYWC0QMrAr4lWmJ3ZAmewtrgDh4/6JBWKdpKfX6qm88MpID0arS+jJkQBuMNIafI\r\nGqnLR1sn\ +5N91UjPItE3NPhYX5LvQMjIuHt8AiyNepTxS32VzVTx2z+A=\r\n-----END RSA PRIVATE KEY-----\r\n' + +def test_edgepi_eeprom_data(): + memory_map = EepromLayout() + memory_map.ParseFromString(read_binfile()) + eeprom_data = EdgePiEEPROMData(memory_map) + for key, value in eeprom_data.dac_calib_params.items(): + assert value.gain == pytest.approx(dac_dict_calib[key].gain) + assert value.offset == pytest.approx(dac_dict_calib[key].offset) + for key, value in eeprom_data.adc_calib_params.items(): + assert value.gain == pytest.approx(adc_dict_calib[key].gain) + assert value.offset == pytest.approx(adc_dict_calib[key].offset) + for key, value in eeprom_data.tc_calib_params.items(): + assert value.gain == pytest.approx(tc_dict_calib[key].gain) + assert value.offset == pytest.approx(tc_dict_calib[key].offset) + for key, value in eeprom_data.tc_hw_params.items(): + assert value == pytest.approx(tc_dict_hw[key]) + for key, value in eeprom_data.rtd_calib_params.items(): + assert value.gain == pytest.approx(rtd_dict_calib[key].gain) + assert value.offset == pytest.approx(rtd_dict_calib[key].offset) + for key, value in eeprom_data.rtd_hw_params.items(): + assert value == pytest.approx(rtd_dict_hw[key]) + assert eeprom_data.serial == '20221110-021' + assert eeprom_data.model == 'EdgePi-Bearbone' + assert eeprom_data.client_id == 'SO-2022-1023' + assert eeprom_data.config_key.certificate == KEYS + assert eeprom_data.config_key.private == KEYS + assert eeprom_data.data_key.certificate == KEYS + assert eeprom_data.data_key.certificate == KEYS diff --git a/src/test_edgepi/unit_tests/test_dac/test_dac_commands.py b/src/test_edgepi/unit_tests/test_dac/test_dac_commands.py index 54cc0e1a..3703839a 100644 --- a/src/test_edgepi/unit_tests/test_dac/test_dac_commands.py +++ b/src/test_edgepi/unit_tests/test_dac/test_dac_commands.py @@ -19,7 +19,7 @@ def fixture_test_dac_ops(mocker): return_value = read_binfile()) eeprom = EdgePiEEPROM() eeprom_data = eeprom.get_edgepi_reserved_data() - dac_calib_params = eeprom_data.dac_calib_parms + dac_calib_params = eeprom_data.dac_calib_params dac_ops = DACCommands(dac_calib_params) return dac_ops @@ -109,7 +109,7 @@ def test_dac_generate_write_and_update_command(a, b, c, dac_ops): @pytest.mark.parametrize("ch, expected, dac_gain, result", - [(1, 2.345, 1, 30282), (0, 2.345, 2, 15285), (3, 2.345, 1, 30341)]) + [(1, 2.345, 1, 30293), (0, 2.345, 2, 15221), (3, 2.345, 1, 30229)]) def test_dac_voltage_to_code(ch, expected, dac_gain, result, dac_ops): assert dac_ops.voltage_to_code(ch, expected, dac_gain) == result @@ -118,8 +118,8 @@ def test_dac_voltage_to_code(ch, expected, dac_gain, result, dac_ops): "ch, code, dac_gain, result", [ (1, 33798, 1, 2.619), - (0, 33798, 2, 5.239), - (3, 33798, 1, 2.614), + (0, 33798, 2, 5.263), + (3, 33798, 1, 2.624), ], ) def test_dac_code_to_voltage(ch, code, dac_gain, result, dac_ops): diff --git a/src/test_edgepi/unit_tests/test_dac/test_edgepi_dac.py b/src/test_edgepi/unit_tests/test_dac/test_edgepi_dac.py index b7ba2e0d..7fa795ac 100644 --- a/src/test_edgepi/unit_tests/test_dac/test_edgepi_dac.py +++ b/src/test_edgepi/unit_tests/test_dac/test_edgepi_dac.py @@ -8,6 +8,8 @@ sys.modules['periphery'] = mock.MagicMock() # pylint: disable=wrong-import-position +# pylint: disable=no-name-in-module +# https://github.com/protocolbuffers/protobuf/issues/10372 # pylint: disable=protected-access import pytest @@ -19,8 +21,10 @@ EdgePiDacCom as COM, ) from edgepi.dac.edgepi_dac import EdgePiDAC -from edgepi.calibration.eeprom_constants import EdgePiEEPROMData from edgepi.calibration.calibration_constants import CalibParam +from edgepi.calibration.protobuf_mapping import EdgePiEEPROMData +from edgepi.calibration.eeprom_mapping_pb2 import EepromLayout +from test_edgepi.unit_tests.test_calibration.read_serialized import read_binfile dummy_calib_param_dict = {0:CalibParam(gain=1,offset=0), 1:CalibParam(gain=1,offset=0), @@ -35,17 +39,25 @@ def fixture_test_dac(mocker): mocker.patch("edgepi.peripherals.spi.SPI") mocker.patch("edgepi.dac.edgepi_dac.EdgePiGPIO") + eelayout= EepromLayout() + eelayout.ParseFromString(read_binfile()) mocker.patch("edgepi.dac.edgepi_dac.EdgePiEEPROM.get_edgepi_reserved_data", - return_value = EdgePiEEPROMData(dac_calib_parms=dummy_calib_param_dict)) - yield EdgePiDAC() + return_value = EdgePiEEPROMData(eelayout)) + dac = EdgePiDAC() + dac.dac_ops.dict_calib_param = dummy_calib_param_dict + yield dac @pytest.fixture(name="dac_mock_periph") def fixture_test_dac_write_voltage(mocker): mocker.patch("edgepi.peripherals.spi.SPI") mocker.patch("edgepi.peripherals.i2c.I2C") + eelayout= EepromLayout() + eelayout.ParseFromString(read_binfile()) mocker.patch("edgepi.dac.edgepi_dac.EdgePiEEPROM.get_edgepi_reserved_data", - return_value = EdgePiEEPROMData(dac_calib_parms=dummy_calib_param_dict)) - yield EdgePiDAC() + return_value = EdgePiEEPROMData(eelayout)) + dac = EdgePiDAC() + dac.dac_ops.dict_calib_param = dummy_calib_param_dict + yield dac _default_power_modes = { @@ -178,9 +190,12 @@ def test_dac_send_to_gpio_pins(mocker, analog_out, pin_name, voltage, mock_name) mocker.patch("edgepi.gpio.edgepi_gpio_expander.I2CDevice") mock_set = mocker.patch("edgepi.dac.edgepi_dac.EdgePiGPIO.set_expander_pin") mock_clear = mocker.patch("edgepi.dac.edgepi_dac.EdgePiGPIO.clear_expander_pin") + eelayout= EepromLayout() + eelayout.ParseFromString(read_binfile()) mocker.patch("edgepi.dac.edgepi_dac.EdgePiEEPROM.get_edgepi_reserved_data", - return_value = EdgePiEEPROMData(dac_calib_parms=dummy_calib_param_dict)) + return_value = EdgePiEEPROMData(eelayout)) dac = EdgePiDAC() + dac.dac_ops.dict_calib_param = dummy_calib_param_dict dac._EdgePiDAC__send_to_gpio_pins(analog_out, voltage) # check correct clause is entered depending on voltage written if voltage > 0: @@ -237,9 +252,12 @@ def test_enable_dac_gain(mocker, enable, result, mocker_values): return_value = (mocker_values[0], mocker_values[1], mocker_values[2])) set_dac_gain = mocker.patch("edgepi.dac.edgepi_dac.EdgePiGPIO.set_expander_pin") clear_dac_gain = mocker.patch("edgepi.dac.edgepi_dac.EdgePiGPIO.clear_expander_pin") + eelayout= EepromLayout() + eelayout.ParseFromString(read_binfile()) mocker.patch("edgepi.dac.edgepi_dac.EdgePiEEPROM.get_edgepi_reserved_data", - return_value = EdgePiEEPROMData(dac_calib_parms=dummy_calib_param_dict)) + return_value = EdgePiEEPROMData(eelayout)) dac = EdgePiDAC() + dac.dac_ops.dict_calib_param = dummy_calib_param_dict # pylint: disable=expression-not-assigned assert dac.enable_dac_gain(enable) == result set_dac_gain.assert_called_once_with("DAC_GAIN") if enable \ @@ -260,9 +278,12 @@ def test_get_state(mocker, analog_out, code, voltage, gain, result, mock_val): mocker.patch("edgepi.gpio.edgepi_gpio_expander.I2CDevice") mocker.patch("edgepi.dac.edgepi_dac.EdgePiGPIO.get_pin_direction", return_value = mock_val[3]) mocker.patch("edgepi.peripherals.spi.SpiDevice.transfer", return_value=mock_val[0:3]) + eelayout= EepromLayout() + eelayout.ParseFromString(read_binfile()) mocker.patch("edgepi.dac.edgepi_dac.EdgePiEEPROM.get_edgepi_reserved_data", - return_value = EdgePiEEPROMData(dac_calib_parms=dummy_calib_param_dict)) + return_value = EdgePiEEPROMData(eelayout)) dac = EdgePiDAC() + dac.dac_ops.dict_calib_param = dummy_calib_param_dict code_val, voltage_val, gain_state = dac.get_state(analog_out, code, voltage, gain) assert code_val == result[0] assert pytest.approx(voltage_val, 1e-3) == voltage_val diff --git a/src/test_edgepi/unit_tests/test_gpio/test_edgpepi_gpio_chip.py b/src/test_edgepi/unit_tests/test_gpio/test_edgpepi_gpio_chip.py index d710789a..866fdc1a 100644 --- a/src/test_edgepi/unit_tests/test_gpio/test_edgpepi_gpio_chip.py +++ b/src/test_edgepi/unit_tests/test_gpio/test_edgpepi_gpio_chip.py @@ -24,7 +24,7 @@ def test_edgepi_gpio_init(): @pytest.mark.parametrize("pin_name, mock_value, result", [("DIN1",[True], True)]) def test_read_gpio_pin_state(mocker, pin_name, mock_value, result): mocker.patch("edgepi.peripherals.gpio.GpioDevice.open_gpio") - mocker.patch("edgepi.peripherals.gpio.GpioDevice.close") + mocker.patch("edgepi.peripherals.gpio.GpioDevice.close_gpio") mocker.patch("edgepi.peripherals.gpio.GpioDevice.read_state", return_value = mock_value[0]) gpio = EdgePiGPIOChip() assert gpio.read_gpio_pin_state(pin_name) == result @@ -33,7 +33,7 @@ def test_read_gpio_pin_state(mocker, pin_name, mock_value, result): ("DIN1",[False], False)]) def test_write_gpio_pin_state(mocker, pin_name, mock_value, result): mocker.patch("edgepi.peripherals.gpio.GpioDevice.open_gpio") - mocker.patch("edgepi.peripherals.gpio.GpioDevice.close") + mocker.patch("edgepi.peripherals.gpio.GpioDevice.close_gpio") mocker.patch("edgepi.peripherals.gpio.GpioDevice.write_state") mocker.patch("edgepi.peripherals.gpio.GpioDevice.read_state", return_value = mock_value[0]) gpio = EdgePiGPIOChip() diff --git a/tests/integration_tests/test_digital_out/__init__.py b/tests/integration_tests/test_digital_out/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/integration_tests/test_digital_out/test_digital_out.py b/tests/integration_tests/test_digital_out/test_digital_out.py new file mode 100644 index 00000000..f1989b4d --- /dev/null +++ b/tests/integration_tests/test_digital_out/test_digital_out.py @@ -0,0 +1,36 @@ +'''Integration tests for edgepi_digital_output.py module''' + +import time +import pytest +from edgepi.digital_output.edgepi_digital_output import EdgePiDigitalOutput +from edgepi.gpio.gpio_constants import GpioPins + +@pytest.mark.parametrize("pin_name", [ + (GpioPins.DOUT1), + (GpioPins.DOUT2), + (GpioPins.DOUT3), + (GpioPins.DOUT4), + (GpioPins.DOUT5), + (GpioPins.DOUT6), + (GpioPins.DOUT7), + (GpioPins.DOUT8), +]) +def test_output_high(pin_name): + dout=EdgePiDigitalOutput() + dout.digital_output_state(pin_name, True) + time.sleep(1) + +@pytest.mark.parametrize("pin_name", [ + (GpioPins.DOUT1), + (GpioPins.DOUT2), + (GpioPins.DOUT3), + (GpioPins.DOUT4), + (GpioPins.DOUT5), + (GpioPins.DOUT6), + (GpioPins.DOUT7), + (GpioPins.DOUT8), +]) +def test_output_low(pin_name): + dout=EdgePiDigitalOutput() + dout.digital_output_state(pin_name, False) + time.sleep(1) From 5657a6ebe341b9a55353f07d430258062cbb42fd Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Fri, 10 Feb 2023 21:35:09 +0000 Subject: [PATCH 09/49] =?UTF-8?q?Bump=20version:=201.1.17=20=E2=86=92=201.?= =?UTF-8?q?1.18?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index b47eb4ab..2e158355 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.17 +current_version = 1.1.18 diff --git a/setup.py b/setup.py index 3678b5ff..519ef560 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.17", + version="1.1.18", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From d0aa9bc56ad6ae40cd4f22b93b1fffc06aa5e753 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Wed, 1 Mar 2023 18:28:50 +0000 Subject: [PATCH 10/49] =?UTF-8?q?Bump=20version:=201.1.18=20=E2=86=92=201.?= =?UTF-8?q?1.19?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 2e158355..05d69d50 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.18 +current_version = 1.1.19 diff --git a/setup.py b/setup.py index 519ef560..c9f600f5 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.18", + version="1.1.19", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 1af0f9283b12afe26f1b62881ce2b3908cea2e1c Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Thu, 2 Mar 2023 21:16:41 +0000 Subject: [PATCH 11/49] =?UTF-8?q?Bump=20version:=201.1.19=20=E2=86=92=201.?= =?UTF-8?q?1.20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 05d69d50..ec0d1746 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.19 +current_version = 1.1.20 diff --git a/setup.py b/setup.py index c9f600f5..cb0208d8 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.19", + version="1.1.20", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 7e25c271519242f866d2800ecb6dd4fe3e61bd06 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Wed, 5 Apr 2023 22:54:33 +0000 Subject: [PATCH 12/49] =?UTF-8?q?Bump=20version:=201.1.20=20=E2=86=92=201.?= =?UTF-8?q?1.21?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index ec0d1746..925361fb 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.20 +current_version = 1.1.21 diff --git a/setup.py b/setup.py index cb0208d8..e38cfcb1 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.20", + version="1.1.21", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 1c6aaef5108313b475a2597c188c4436f0d25184 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Thu, 27 Apr 2023 01:59:10 +0000 Subject: [PATCH 13/49] =?UTF-8?q?Bump=20version:=201.1.21=20=E2=86=92=201.?= =?UTF-8?q?1.22?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 925361fb..c3999728 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.21 +current_version = 1.1.22 diff --git a/setup.py b/setup.py index e38cfcb1..1524b9db 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.21", + version="1.1.22", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From ef3cca9e8dc40c66af031d9a173e7ca7c439673b Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Wed, 3 May 2023 21:52:34 +0000 Subject: [PATCH 14/49] =?UTF-8?q?Bump=20version:=201.1.22=20=E2=86=92=201.?= =?UTF-8?q?1.23?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index c3999728..9224c5b7 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.22 +current_version = 1.1.23 diff --git a/setup.py b/setup.py index 1524b9db..6e4aada1 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.22", + version="1.1.23", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From e50e1823b0edf5d5c632d27f2bbc357fe27bc413 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Wed, 10 May 2023 19:08:03 +0000 Subject: [PATCH 15/49] =?UTF-8?q?Bump=20version:=201.1.23=20=E2=86=92=201.?= =?UTF-8?q?1.24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 9224c5b7..d6ce4c67 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.23 +current_version = 1.1.24 diff --git a/setup.py b/setup.py index 6e4aada1..230486d0 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.23", + version="1.1.24", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From d3f0a14c3497253b42fec7bffb5e633782767e8d Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Tue, 16 May 2023 18:41:49 +0000 Subject: [PATCH 16/49] =?UTF-8?q?Bump=20version:=201.1.24=20=E2=86=92=201.?= =?UTF-8?q?1.25?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index d6ce4c67..cc8d51d4 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.24 +current_version = 1.1.25 diff --git a/setup.py b/setup.py index 230486d0..33fb68a6 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.24", + version="1.1.25", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 435f822bad6a61d59362a4b7ea9b742312713d2e Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Wed, 17 May 2023 20:47:43 +0000 Subject: [PATCH 17/49] =?UTF-8?q?Bump=20version:=201.1.25=20=E2=86=92=201.?= =?UTF-8?q?1.26?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index cc8d51d4..33b8aa38 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.25 +current_version = 1.1.26 diff --git a/setup.py b/setup.py index 33fb68a6..fec58861 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.25", + version="1.1.26", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 8e71823296657986cecd0868a7620193178c94ef Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Wed, 17 May 2023 22:59:01 +0000 Subject: [PATCH 18/49] =?UTF-8?q?Bump=20version:=201.1.26=20=E2=86=92=201.?= =?UTF-8?q?1.27?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 33b8aa38..856f6777 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.26 +current_version = 1.1.27 diff --git a/setup.py b/setup.py index fec58861..a72b3edc 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.26", + version="1.1.27", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From a757048ec5bf60d40041c6a0aff2c755fece42f2 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Thu, 18 May 2023 21:04:19 +0000 Subject: [PATCH 19/49] =?UTF-8?q?Bump=20version:=201.1.27=20=E2=86=92=201.?= =?UTF-8?q?1.28?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 856f6777..7d0795cd 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.27 +current_version = 1.1.28 diff --git a/setup.py b/setup.py index a72b3edc..7caf10ad 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.27", + version="1.1.28", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From d1fb090b34104e5af049d05228107f5851f86d0a Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Fri, 19 May 2023 21:33:40 +0000 Subject: [PATCH 20/49] =?UTF-8?q?Bump=20version:=201.1.28=20=E2=86=92=201.?= =?UTF-8?q?1.29?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 7d0795cd..796564d0 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.28 +current_version = 1.1.29 diff --git a/setup.py b/setup.py index 7caf10ad..893b15a1 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.28", + version="1.1.29", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From e1d08a016794b5b2fb952ec4ba4a571a59854190 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Fri, 19 May 2023 22:11:27 +0000 Subject: [PATCH 21/49] =?UTF-8?q?Bump=20version:=201.1.29=20=E2=86=92=201.?= =?UTF-8?q?1.30?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 796564d0..a17a00f1 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.29 +current_version = 1.1.30 diff --git a/setup.py b/setup.py index 893b15a1..abf9ab25 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.29", + version="1.1.30", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 4dacd8c726070d8408cf13831da55aefb7750cb5 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Fri, 19 May 2023 22:52:11 +0000 Subject: [PATCH 22/49] =?UTF-8?q?Bump=20version:=201.1.30=20=E2=86=92=201.?= =?UTF-8?q?1.31?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index a17a00f1..ac2c5bd9 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.30 +current_version = 1.1.31 diff --git a/setup.py b/setup.py index abf9ab25..20857aff 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.30", + version="1.1.31", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 8e76745b9d2efc54205a16c3f6f2744be109741b Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Wed, 24 May 2023 17:52:52 +0000 Subject: [PATCH 23/49] =?UTF-8?q?Bump=20version:=201.1.31=20=E2=86=92=201.?= =?UTF-8?q?1.32?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index ac2c5bd9..33be30b7 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.31 +current_version = 1.1.32 diff --git a/setup.py b/setup.py index 20857aff..518e2d11 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.31", + version="1.1.32", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From d64bbc3d6a68d8631471009bffd4f4b0ad7b4bb7 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Sat, 17 Jun 2023 00:53:11 +0000 Subject: [PATCH 24/49] =?UTF-8?q?Bump=20version:=201.1.32=20=E2=86=92=201.?= =?UTF-8?q?1.33?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 33be30b7..13f12355 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.32 +current_version = 1.1.33 diff --git a/setup.py b/setup.py index 5e21a30b..b8995d4b 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.32", + version="1.1.33", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From a68c7fedce6fa549402ff554aeb62b3404ac03c5 Mon Sep 17 00:00:00 2001 From: sjpark608 Date: Fri, 16 Jun 2023 18:15:55 -0700 Subject: [PATCH 25/49] modified sdk version number --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c26060f6..eb0c3f56 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.33", + version="1.1.32", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From c12d52e9089a12cd00882036475086f9368e4de9 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Sat, 17 Jun 2023 01:17:11 +0000 Subject: [PATCH 26/49] =?UTF-8?q?Bump=20version:=201.1.32=20=E2=86=92=201.?= =?UTF-8?q?1.33?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index eb0c3f56..c26060f6 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.32", + version="1.1.33", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 2719e3b8649c7c76cb30d2060c2421e7ff9d1e6b Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Wed, 21 Jun 2023 21:52:18 +0000 Subject: [PATCH 27/49] =?UTF-8?q?Bump=20version:=201.1.33=20=E2=86=92=201.?= =?UTF-8?q?1.34?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 13f12355..0166c213 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.33 +current_version = 1.1.34 diff --git a/setup.py b/setup.py index c26060f6..86ed91b0 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.33", + version="1.1.34", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From c54b005f93c5099a841b85475d841498682bcde3 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Wed, 21 Jun 2023 22:17:38 +0000 Subject: [PATCH 28/49] =?UTF-8?q?Bump=20version:=201.1.33=20=E2=86=92=201.?= =?UTF-8?q?1.34?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 13f12355..0166c213 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.33 +current_version = 1.1.34 diff --git a/setup.py b/setup.py index c26060f6..86ed91b0 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.33", + version="1.1.34", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From a8da1887183cffd1549aeafa453cee86ebd902f4 Mon Sep 17 00:00:00 2001 From: sjpark608 Date: Wed, 21 Jun 2023 15:51:51 -0700 Subject: [PATCH 29/49] change pytest.ini --- pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest.ini b/pytest.ini index 94e3436f..73fc10dc 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,6 @@ [pytest] ; faulthandler_timeout=5 -; log_cli=TRUE +log_cli=False log_level=INFO log_format=%(asctime)s %(levelname)s [%(filename)s:%(lineno)d] %(message)s # ********************** From 588b19e47dd3cddcdf659ad4be97859d91cf1a83 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Wed, 21 Jun 2023 22:52:35 +0000 Subject: [PATCH 30/49] =?UTF-8?q?Bump=20version:=201.1.34=20=E2=86=92=201.?= =?UTF-8?q?1.35?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 0166c213..51d0b984 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.34 +current_version = 1.1.35 diff --git a/setup.py b/setup.py index 86ed91b0..059befe8 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.34", + version="1.1.35", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 34326ba7023c5768e11d9b640a1873e5ce5b3998 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Thu, 6 Jul 2023 22:30:52 +0000 Subject: [PATCH 31/49] =?UTF-8?q?Bump=20version:=201.1.35=20=E2=86=92=201.?= =?UTF-8?q?1.36?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 51d0b984..860d0a5b 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.35 +current_version = 1.1.36 diff --git a/setup.py b/setup.py index 059befe8..4105311d 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.1.35", + version="1.1.36", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From cd7f7e09f7e03a1605bafa857156a64bf1abf723 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Thu, 6 Jul 2023 22:59:12 +0000 Subject: [PATCH 32/49] =?UTF-8?q?Bump=20version:=201.2.0=20=E2=86=92=201.2?= =?UTF-8?q?.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 860d0a5b..59bd1c52 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.1.36 +current_version = 1.2.1 diff --git a/setup.py b/setup.py index 57372e15..c29b30c9 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.2.0", + version="1.2.1", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 3d0eef7e7cb0a44e8fbbe13e7e63b08faff87e5a Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Fri, 7 Jul 2023 17:50:44 +0000 Subject: [PATCH 33/49] =?UTF-8?q?Bump=20version:=201.2.1=20=E2=86=92=201.2?= =?UTF-8?q?.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 59bd1c52..9027ec91 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.2.1 +current_version = 1.2.2 diff --git a/setup.py b/setup.py index c29b30c9..c0e8d119 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.2.1", + version="1.2.2", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 98bacdb37f976e26d50902bf062481a364613c79 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Tue, 11 Jul 2023 22:40:52 +0000 Subject: [PATCH 34/49] =?UTF-8?q?Bump=20version:=201.2.2=20=E2=86=92=201.2?= =?UTF-8?q?.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 9027ec91..df7ad265 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.2.2 +current_version = 1.2.3 diff --git a/setup.py b/setup.py index c0e8d119..71db8c98 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.2.2", + version="1.2.3", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 38195ca4e5683de8c816b1167dab508376c60930 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Thu, 20 Jul 2023 20:04:49 +0000 Subject: [PATCH 35/49] =?UTF-8?q?Bump=20version:=201.2.3=20=E2=86=92=201.2?= =?UTF-8?q?.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index df7ad265..e1be5b92 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.2.3 +current_version = 1.2.4 diff --git a/setup.py b/setup.py index 71db8c98..d0054529 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.2.3", + version="1.2.4", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 986f6bb0f01bf20262d4d5ef7ce7812d673adf14 Mon Sep 17 00:00:00 2001 From: sjpark608 Date: Thu, 20 Jul 2023 13:28:30 -0700 Subject: [PATCH 36/49] Update build-and-publish-TestPyPI.yml --- .github/workflows/build-and-publish-TestPyPI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-publish-TestPyPI.yml b/.github/workflows/build-and-publish-TestPyPI.yml index b4f1d42a..f732ea4f 100644 --- a/.github/workflows/build-and-publish-TestPyPI.yml +++ b/.github/workflows/build-and-publish-TestPyPI.yml @@ -83,9 +83,9 @@ jobs: uses: actions/checkout@v3 - name: Install Dependencies run: | - python -m pip install --upgrade pip python -m venv venv_hardware_test source venv_hardware_test/bin/activate + python -m pip install --upgrade pip python -m pip install pytest if [ -f requirements_hw_test.txt ]; then pip install -r requirements_hw_test.txt; fi - name: Test with pytest From b33a138bfb8e0150bfc130ef14c7e52c55662954 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Thu, 20 Jul 2023 20:30:30 +0000 Subject: [PATCH 37/49] =?UTF-8?q?Bump=20version:=201.2.4=20=E2=86=92=201.2?= =?UTF-8?q?.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index e1be5b92..26f49763 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.2.4 +current_version = 1.2.5 diff --git a/setup.py b/setup.py index d0054529..0dbe83c9 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.2.4", + version="1.2.5", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 35893fdd83859729aeab2ad55a3ee051cb2a4116 Mon Sep 17 00:00:00 2001 From: sjpark608 <78987042+sjpark608@users.noreply.github.com> Date: Thu, 20 Jul 2023 17:18:54 -0700 Subject: [PATCH 38/49] Staging (#370) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump version: 1.2.1 → 1.2.2 * Eeprom default (#364) * separating key dataclass in progress * replaced default bin image #363 * key module datalcass created #363 * modified default bin so all string type message are empty by default * fixed key proto file * Bump version: 1.2.2 → 1.2.3 * Bump version: 1.2.2 → 1.2.3 * Dev hardware test (#368) * name of requirements.txt changed, digital io test fixed, eeprom user space test fixed * osensa eeprom test fix * adc, rtd hardware test * delete test_adc_read.py, revised digital io test * added hardware test workflow which requires publish * hardware test passing * pylint fix * label added to route job to the hardware test unit * Dev documentation (#369) * Update eeprom_constants.py * added documentation * added special Note to the PWM readme * suggested fix * frequency type to float * Bump version: 1.2.3 → 1.2.4 * Update build-and-publish-TestPyPI.yml * Bump version: 1.2.4 → 1.2.5 --------- Co-authored-by: bot-edgepi --- .bumpversion.cfg | 2 +- .../workflows/build-and-publish-TestPyPI.yml | 23 +++++ ...ntegration.txt => requirements_hw_test.txt | 0 setup.py | 2 +- src/edgepi/eeprom/edgepi_eeprom_data.py | 52 +++++++---- src/edgepi/eeprom/eeprom_constants.py | 74 ++++++++++++--- .../eeprom_data_classes/eeprom_key_module.py | 28 ++++++ .../protobuf_assets/generated_pb2/keys_pb2.py | 4 +- .../proto_files/edgepi_default_bin | Bin 811 -> 509 bytes .../protobuf_assets/proto_files/keys.proto | 4 +- src/edgepi/pwm/README.md | 7 +- src/edgepi/pwm/edgepi_pwm.py | 2 +- .../test_eeprom/test_eeprom.py | 2 +- .../unit_tests/test_eeprom/edgepi_default_bin | Bin 737 -> 509 bytes .../test_eeprom/test_access_eeprom.py | 2 +- .../test_eeprom/test_edgepi_eeprom_data.py | 36 +++++++- tests/hardware_tests/test_adc_read.py | 86 ------------------ tests/hardware_tests/test_digital_io.py | 14 +-- .../hardware_tests/test_eeprom_osensaspace.py | 10 +- tests/hardware_tests/test_eeprom_userspace.py | 22 +---- tests/hardware_tests/test_rtd_reads.py | 10 +- tests/hardware_tests/test_voltage_rw.py | 60 ++++++------ 22 files changed, 239 insertions(+), 201 deletions(-) rename requirements_integration.txt => requirements_hw_test.txt (100%) create mode 100644 src/edgepi/eeprom/protobuf_assets/eeprom_data_classes/eeprom_key_module.py delete mode 100644 tests/hardware_tests/test_adc_read.py diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 9027ec91..26f49763 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.2.2 +current_version = 1.2.5 diff --git a/.github/workflows/build-and-publish-TestPyPI.yml b/.github/workflows/build-and-publish-TestPyPI.yml index 49392e36..f732ea4f 100644 --- a/.github/workflows/build-and-publish-TestPyPI.yml +++ b/.github/workflows/build-and-publish-TestPyPI.yml @@ -69,3 +69,26 @@ jobs: git config user.email ${{ env.commit_email }} git cherry-pick ${{ env.bump_commit }} git push origin dev + Hardware_Test: + needs: publish + name: Hardware Tests + runs-on: [self-hosted, linux, ARM64, hw-test] + strategy: + fail-fast: false + matrix: + python-version: ["3.9"] + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install Dependencies + run: | + python -m venv venv_hardware_test + source venv_hardware_test/bin/activate + python -m pip install --upgrade pip + python -m pip install pytest + if [ -f requirements_hw_test.txt ]; then pip install -r requirements_hw_test.txt; fi + - name: Test with pytest + run: | + source venv_hardware_test/bin/activate + python -m pytest ./tests/hardware_tests diff --git a/requirements_integration.txt b/requirements_hw_test.txt similarity index 100% rename from requirements_integration.txt rename to requirements_hw_test.txt diff --git a/setup.py b/setup.py index c0e8d119..0dbe83c9 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.2.2", + version="1.2.5", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", diff --git a/src/edgepi/eeprom/edgepi_eeprom_data.py b/src/edgepi/eeprom/edgepi_eeprom_data.py index 35fdca11..8db844e3 100644 --- a/src/edgepi/eeprom/edgepi_eeprom_data.py +++ b/src/edgepi/eeprom/edgepi_eeprom_data.py @@ -6,18 +6,14 @@ dac_module_pb2, adc_module_pb2, rtd_module_pb2, - tc_module_pb2 + tc_module_pb2, + keys_pb2 ) from edgepi.eeprom.protobuf_assets.eeprom_data_classes.eeprom_dac_module import DACModule from edgepi.eeprom.protobuf_assets.eeprom_data_classes.eeprom_adc_module import ADCModule from edgepi.eeprom.protobuf_assets.eeprom_data_classes.eeprom_rtd_module import RTDModule from edgepi.eeprom.protobuf_assets.eeprom_data_classes.eeprom_tc_module import TCModule - -@dataclass -class AwsKeys: - """Key Pair dataclass""" - private_key:str = None - certificate:str = None +from edgepi.eeprom.protobuf_assets.eeprom_data_classes.eeprom_key_module import AwsKeys @dataclass class EepromDataClass: @@ -28,8 +24,8 @@ class EepromDataClass: adc2_calib_params: ADCModule = None rtd_calib_params: RTDModule = None tc_calib_params: TCModule = None - config_key: AwsKeys = None - data_key: AwsKeys = None + config_key: AwsKeys = AwsKeys(None, None) + data_key: AwsKeys = AwsKeys(None, None) serial:str = None model:str = None cm_part_number: str = None @@ -43,13 +39,9 @@ def populate_eeprom_module(self, eeprom_pb:edgepi_module_pb2): self.__populate_adc2_module(eeprom_pb.adc2_module) self.__populate_rtd_module(eeprom_pb.rtd_module) self.__populate_tc_module(eeprom_pb.tc_module) + self.__populate_config_key_module(eeprom_pb.config_keys) + self.__populate_data_key_module(eeprom_pb.data_keys) - if self.config_key is not None: - eeprom_pb.config_keys.certificate = self.config_key.certificate - eeprom_pb.config_keys.private_key = self.config_key.private_key - if self.data_key is not None: - eeprom_pb.data_keys.certificate = self.data_key.certificate - eeprom_pb.data_keys.private_key = self.data_key.private_key if self.serial is not None: eeprom_pb.serial_number = self.serial if self.model is not None: @@ -90,6 +82,18 @@ def __populate_tc_module(self, tc_pb: tc_module_pb2): return self.tc_calib_params.populate_tc_module_pb(tc_pb) + def __populate_config_key_module(self, key_pb: keys_pb2): + """Serialize Config Keys""" + if self.config_key is None: + return + self.config_key.populate_keys_pb(key_pb) + + def __populate_data_key_module(self, key_pb: keys_pb2): + """Serialize Data Keys""" + if self.data_key is None: + return + self.data_key.populate_keys_pb(key_pb) + @staticmethod def extract_eeprom_data(eeprom_pb:edgepi_module_pb2): """De-serialize""" @@ -100,14 +104,14 @@ def extract_eeprom_data(eeprom_pb:edgepi_module_pb2): eeprom_data.rtd_calib_params = EepromDataClass.extract_rtd_data(eeprom_pb.rtd_module) eeprom_data.tc_calib_params = EepromDataClass.extract_tc_data(eeprom_pb.tc_module) + if eeprom_pb.HasField("config_keys"): + eeprom_data.config_key = EepromDataClass.extract_config_key(eeprom_pb.config_keys) + if eeprom_pb.HasField("data_keys"): + eeprom_data.data_key = EepromDataClass.extract_data_key(eeprom_pb.data_keys) if eeprom_pb.HasField("serial_number"): eeprom_data.serial = eeprom_pb.serial_number if eeprom_pb.HasField("model"): eeprom_data.model = eeprom_pb.model - if eeprom_pb.HasField("config_keys"): - eeprom_data.config_key = eeprom_pb.config_keys - if eeprom_pb.HasField("data_keys"): - eeprom_data.data_key = eeprom_pb.data_keys if eeprom_pb.HasField("cm_part_number"): eeprom_data.cm_part_number = eeprom_pb.cm_part_number if eeprom_pb.HasField("tb_part_number"): @@ -145,3 +149,13 @@ def extract_tc_data(tc_pb: tc_module_pb2): if tc_pb is None: return return TCModule.extract_tc_calib_params(tc_pb) + + @staticmethod + def extract_config_key(key_pb: keys_pb2): + """De-serialize Config Keys""" + return AwsKeys.extract_keys(key_pb) + + @staticmethod + def extract_data_key(key_pb: keys_pb2): + """De-serialize Data Keys""" + return AwsKeys.extract_keys(key_pb) diff --git a/src/edgepi/eeprom/eeprom_constants.py b/src/edgepi/eeprom/eeprom_constants.py index 6f6be3ea..09886d7f 100644 --- a/src/edgepi/eeprom/eeprom_constants.py +++ b/src/edgepi/eeprom/eeprom_constants.py @@ -4,19 +4,67 @@ # page write cycle time requirements https://www.onsemi.com/pdf/datasheet/cat24c256-d.pdf PAGE_WRITE_CYCLE_TIME=0.01 -DEFAULT_EEPROM_BIN_B64 = b"CmAKCg0AAIA/FQAAAAASCg0AAIA/FQAAAAAaCg0AAIA/FQAAAAAiCg0AAIA/FQAAAAAqCg0A\ - AIA/FQAAAAAyCg0AAIA/FQAAAAA6Cg0AAIA/FQAAAABCCg0AAIA/FQAAAAASkAEKCg0AAIA/FQAA\ - AAASCg0AAIA/FQAAAAAaCg0AAIA/FQAAAAAiCg0AAIA/FQAAAAAqCg0AAIA/FQAAAAAyCg0AAIA/\ - FQAAAAA6Cg0AAIA/FQAAAABCCg0AAIA/FQAAAABKCg0AAIA/FQAAAABSCg0AAIA/FQAAAABaCg0A\ - AIA/FQAAAABiCg0AAIA/FQAAAAAakAEKCg0AAIA/FQAAAAASCg0AAIA/FQAAAAAaCg0AAIA/FQAA\ - AAAiCg0AAIA/FQAAAAAqCg0AAIA/FQAAAAAyCg0AAIA/FQAAAAA6Cg0AAIA/FQAAAABCCg0AAIA/\ - FQAAAABKCg0AAIA/FQAAAABSCg0AAIA/FQAAAABaCg0AAIA/FQAAAABiCg0AAIA/FQAAAAAiEQoK\ - DQAAgD8VAAAAABUAAPpEKmAKCg0AAIA/FQAAAAASCg0AAIA/FQAAAAAaCg0AAIA/FQAAAAAiCg0A\ - AIA/FQAAAAAqCg0AAIA/FQAAAAAyCg0AAIA/FQAAAAA6Cg0AAIA/FQAAAABCCg0AAIA/FQAAAAAy\ - NAoWVGhpcyBpcyBDb25maWcgUHJpdmF0ZRIaVGhpcyBpcyBDb25maWcgQ2VydGlmaWNhdGU6MAoU\ - VGhpcyBpcyBEYXRhIFByaXZhdGUSGFRoaXMgaXMgRGF0YSBDZXJ0aWZpY2F0ZUIVVGhpcyBpcyBT\ - ZXJpYWwgTnVtYmVyShxUaGlzIGlzIGNtIGJvYXJkIHBhcnQgbnVtYmVyUhZUaGlzIGlzIHRiIHBh\ - cnQgbnVtYmVyWhdUaGlzIGlzIGNtNCBwYXJ0IG51bWJlcmIUVGhpcyBpcyBNb2RlbCBOdW1iZXI=" +DEFAULT_EEPROM_BIN_B64 = b'CmAKCg0AAIA/FQAAAAASCg0AAIA/FQAAAAAaCg0AAIA/FQAAAAAiCg0AAIA/FQAAAAAqCg0A\ +AIA/FQAAAAAyCg0AAIA/FQAAAAA6Cg0AAIA/FQAAAABCCg0AAIA/FQAAAAASkAEKCg0AAIA/FQAAAAASCg0AAIA/FQAAAAAaCg0\ +AAIA/FQAAAAAiCg0AAIA/FQAAAAAqCg0AAIA/FQAAAAAyCg0AAIA/FQAAAAA6Cg0AAIA/FQAAAABCCg0AAIA/FQAAAABKCg0AAI\ +A/FQAAAABSCg0AAIA/FQAAAABaCg0AAIA/FQAAAABiCg0AAIA/FQAAAAAakAEKCg0AAIA/FQAAAAASCg0AAIA/FQAAAAAaCg0AA\ +IA/FQAAAAAiCg0AAIA/FQAAAAAqCg0AAIA/FQAAAAAyCg0AAIA/FQAAAAA6Cg0AAIA/FQAAAABCCg0AAIA/FQAAAABKCg0AAIA/\ +FQAAAABSCg0AAIA/FQAAAABaCg0AAIA/FQAAAABiCg0AAIA/FQAAAAAiEQoKDQAAgD8VAAAAABUAAPpEKmAKCg0AAIA/FQAAAAA\ +SCg0AAIA/FQAAAAAaCg0AAIA/FQAAAAAiCg0AAIA/FQAAAAAqCg0AAIA/FQAAAAAyCg0AAIA/FQAAAAA6Cg0AAIA/FQAAAABCCg\ +0AAIA/FQAAAAA=' + +""" +Defaul EEPROM Dataclass +dac_calib_params + dac_ch1 + gain = 1 + offset = 0 + ~ + dac_ch8 + gain = 1 + offset = 0 +adc1_calib_params + adc_ch_1 + gain = 1 + offset = 0 + ~ + adc_ch_8 + gain = 1 + offset = 0 + diff1 + gain = 1 + offset = 0 + ~ + diff4 +adc2_calib_params + same as adc1_calib_params +rtd_calib_params + rtd + gain = 1 + offset = 0 + rtd_resistor = 2000 +tc_calib_params + tc_B + gain = 1 + offset = 0 + ~ + tc_T + gain = 1 + offset = 0 +config_key + private_key = None + certificate = None +data_key + private_key = None + certificate = None +serial = None +model = None +cm_part_number = None +tb_part_number = None +cm4_part_number = None +""" + + class EEPROMInfo(Enum): """ diff --git a/src/edgepi/eeprom/protobuf_assets/eeprom_data_classes/eeprom_key_module.py b/src/edgepi/eeprom/protobuf_assets/eeprom_data_classes/eeprom_key_module.py new file mode 100644 index 00000000..506f8680 --- /dev/null +++ b/src/edgepi/eeprom/protobuf_assets/eeprom_data_classes/eeprom_key_module.py @@ -0,0 +1,28 @@ +"""EEPROM key module Dataclass""" +from dataclasses import dataclass +from edgepi.eeprom.protobuf_assets.generated_pb2 import keys_pb2 + + + +@dataclass +class AwsKeys: + """Key Pair dataclass""" + private_key:str = None + certificate:str = None + + def populate_keys_pb(self, key_pb: keys_pb2): + """serialize method""" + if self.private_key is not None: + key_pb.private_key = self.private_key + if self.certificate is not None: + key_pb.certificate = self.certificate + + @staticmethod + def extract_keys(key_pb: keys_pb2): + """De-serialize method""" + key_mod = AwsKeys() + if key_pb.HasField("private_key"): + key_mod.private_key = key_pb.private_key + if key_pb.HasField("certificate"): + key_mod.certificate = key_pb.certificate + return key_mod diff --git a/src/edgepi/eeprom/protobuf_assets/generated_pb2/keys_pb2.py b/src/edgepi/eeprom/protobuf_assets/generated_pb2/keys_pb2.py index f3a6746d..ed46125b 100644 --- a/src/edgepi/eeprom/protobuf_assets/generated_pb2/keys_pb2.py +++ b/src/edgepi/eeprom/protobuf_assets/generated_pb2/keys_pb2.py @@ -14,7 +14,7 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nkeys.proto\"3\n\x07\x41wsKeys\x12\x13\n\x0bprivate_key\x18\x01 \x01(\t\x12\x13\n\x0b\x63\x65rtificate\x18\x02 \x01(\tb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nkeys.proto\"]\n\x07\x41wsKeys\x12\x18\n\x0bprivate_key\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x0b\x63\x65rtificate\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x0e\n\x0c_private_keyB\x0e\n\x0c_certificateb\x06proto3') _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'keys_pb2', globals()) @@ -22,5 +22,5 @@ DESCRIPTOR._options = None _AWSKEYS._serialized_start=14 - _AWSKEYS._serialized_end=65 + _AWSKEYS._serialized_end=107 # @@protoc_insertion_point(module_scope) diff --git a/src/edgepi/eeprom/protobuf_assets/proto_files/edgepi_default_bin b/src/edgepi/eeprom/protobuf_assets/proto_files/edgepi_default_bin index e602a716b74bf4ddd115e468ae3d24f34580e92c..68330ad72ecc056c3cae6bfa8b64db93fcd57671 100644 GIT binary patch delta 43 scmZ3@_Lq4=GSdXciK!EqrNESkk{}lsF9Sn^y(j|^0Eu5NS`!%)0S;>lo&W#< literal 811 zcmd-|;Ns$CU}&%xWdH&pB(@Y1TM3D+g~T>OVp}1xosiflaM*HkU5KxIjfL4yO24DkU6K2IZ}eiK?RJGUoJ{Ck031* zF0qh|%wh!~a?a07%S=}YD9S8LEJ+oTLKAmREh@=O%S;B!85wYiz+_z#OA_IFBv3?= zbXbYPWP($RG81zY{7Q3^Qj45qV8Y3{3Q75iMJWmeiA5y}d0<&DxYJ6Kki~<<5xPu} zC8FT2^36|4g;|mWcU5vuW@=tZd}c~~GT5(Ka0?JJDM0@e3BW8U$;ix02WkKSb!3~x diff --git a/src/edgepi/eeprom/protobuf_assets/proto_files/keys.proto b/src/edgepi/eeprom/protobuf_assets/proto_files/keys.proto index ba39c7a7..5482409b 100644 --- a/src/edgepi/eeprom/protobuf_assets/proto_files/keys.proto +++ b/src/edgepi/eeprom/protobuf_assets/proto_files/keys.proto @@ -1,6 +1,6 @@ syntax = "proto3"; message AwsKeys { - string private_key = 1; - string certificate = 2; + optional string private_key = 1; + optional string certificate = 2; } \ No newline at end of file diff --git a/src/edgepi/pwm/README.md b/src/edgepi/pwm/README.md index 8ab56e50..092ff1cc 100644 --- a/src/edgepi/pwm/README.md +++ b/src/edgepi/pwm/README.md @@ -14,9 +14,9 @@ edgepi_pwm = EdgePiPWM() # Initialize and open pwm device edgepi_pwm.init_pwm(PWMPins.PWM1) -# Setting PWM parameters -edgepi_pwm.set_config(PWMPins.PWM1, 1000.0, 50.0) -# enable the pwm signal +# Setting PWM parameters, frequency 1000.0 to 10,000.0 , duty cycle form 0-1.0 +edgepi_pwm.set_config(PWMPins.PWM1, 1000.0, 0.50) +# enable the pwm signal, PWM duty cycle and frequency must be set to enable the singal edgepi_pwm.enable() # disable the pwm signal edgepi_pwm.disable() @@ -24,6 +24,7 @@ edgepi_pwm.disable() edgepi_pwm.close() ``` +__NOTE__: Frequency and duty-cycle must be set before enabling the PWM signal. # User Guide - Instantiating the module generate the PWM device file diff --git a/src/edgepi/pwm/edgepi_pwm.py b/src/edgepi/pwm/edgepi_pwm.py index bad6d56b..4b45e2db 100644 --- a/src/edgepi/pwm/edgepi_pwm.py +++ b/src/edgepi/pwm/edgepi_pwm.py @@ -201,7 +201,7 @@ def init_pwm(self, pwm_num: PWMPins): self.log.debug("init_pwm: PWM device is already open") def set_config(self, pwm_num: PWMPins, - frequency: int = None, + frequency: float = None, duty_cycle: int = None, polarity: Polarity = None ): diff --git a/src/test_edgepi/integration_tests/test_eeprom/test_eeprom.py b/src/test_edgepi/integration_tests/test_eeprom/test_eeprom.py index ecfe0de1..fd9493a2 100644 --- a/src/test_edgepi/integration_tests/test_eeprom/test_eeprom.py +++ b/src/test_edgepi/integration_tests/test_eeprom/test_eeprom.py @@ -110,7 +110,7 @@ def test_write_edgepi_data(eeprom): [ (None, pytest.raises(PermissionDenied)), ("This is Dummy", pytest.raises(PermissionDenied)), - ("48d088f7536e5c59938724b174184611", does_not_raise()) + ("6b68b8e2dd2a6bec300ef91572270723", does_not_raise()) ]) def test_reset_edgepi_memory(bin_hash, error, eeprom): original_data = eeprom.read_edgepi_data() diff --git a/src/test_edgepi/unit_tests/test_eeprom/edgepi_default_bin b/src/test_edgepi/unit_tests/test_eeprom/edgepi_default_bin index 8a86d8866827062b21fe781033169778a3e9cdad..68330ad72ecc056c3cae6bfa8b64db93fcd57671 100644 GIT binary patch delta 7 OcmaFJ`j>gbUq%2AR0EX& literal 737 zcmd-|;Ns$CU}&%xWdH&pB(@Y1TM3D+g~T>OVp}1xosif<6Buc2g%^@_K}hT str: - return ( - f"\nchannel_number={dac_ch.value}, " - f"write_voltage={write_voltage} V, read_voltage={read_voltage} V" - f"\nassert {read_voltage} == {write_voltage} ± {RW_ERROR}\n" - ) - - -def _measure_voltage_individual( - adc, dac, adc_num: ADCNum, dac_ch: DACChannel, write_voltage: float - ): - # write to DAC channel - dac.write_voltage(dac_ch, write_voltage) - sleep(WRITE_READ_DELAY) - for _ in range(READS_PER_WRITE): - read_voltage = adc.read_voltage(adc_num) - _logger.info(_voltage_rw_msg(dac_ch, write_voltage, read_voltage)) - _assert_approx(write_voltage, read_voltage, RW_ERROR) - - -def _generate_test_cases(): - _logger.info( - ( - f"voltage_range: 0-{MAX_VOLTAGE} V, voltage_step: {VOLTAGE_STEP} V, " - f"read_write_error_tolerance: +/- {RW_ERROR} V, num_read_trials: {READS_PER_WRITE}" - ) - ) - for channel in range(NUM_CHANNELS): - voltage = 0 - while voltage < MAX_VOLTAGE - VOLTAGE_STEP: - voltage += VOLTAGE_STEP - yield channel, voltage - - -@pytest.mark.parametrize("channel, write_voltage", _generate_test_cases()) -def test_voltage_rw_adc_1(channel, write_voltage, adc_1, dac): - adc_1.set_config(adc_1_analog_in=_ch_map[channel][0]) - _measure_voltage_individual(adc_1, dac, ADCNum.ADC_1, _ch_map[channel][1], write_voltage) diff --git a/tests/hardware_tests/test_digital_io.py b/tests/hardware_tests/test_digital_io.py index 47b8c21a..637a2eb9 100644 --- a/tests/hardware_tests/test_digital_io.py +++ b/tests/hardware_tests/test_digital_io.py @@ -5,27 +5,23 @@ from edgepi.digital_input.edgepi_digital_input import EdgePiDigitalInput from edgepi.digital_output.edgepi_digital_output import EdgePiDigitalOutput from edgepi.digital_input.digital_input_constants import DinPins -from edgepi.digital_output.digital_output_constants import DoutPins +from edgepi.digital_output.digital_output_constants import DoutPins, DoutTriState @pytest.mark.parametrize("din_pin, dout_pin", [ (DinPins.DIN1, DoutPins.DOUT1), (DinPins.DIN2, DoutPins.DOUT2), - (DinPins.DIN3, DoutPins.DOUT3), - (DinPins.DIN4, DoutPins.DOUT4), - (DinPins.DIN5, DoutPins.DOUT5), - (DinPins.DIN6, DoutPins.DOUT6), - (DinPins.DIN7, DoutPins.DOUT7), - (DinPins.DIN8, DoutPins.DOUT8), + (DinPins.DIN3, DoutPins.DOUT3) ]) def test_input_state(din_pin, dout_pin): din=EdgePiDigitalInput() dout = EdgePiDigitalOutput() + dout.set_dout_state(dout_pin, DoutTriState.LOW) initial_state = din.digital_input_state(din_pin) - dout.set_dout_state(dout_pin, True) + dout.set_dout_state(dout_pin, DoutTriState.HIGH) sleep(0.1) changed_state = din.digital_input_state(din_pin) assert initial_state is not changed_state - dout.set_dout_state(dout_pin, False) + dout.set_dout_state(dout_pin, DoutTriState.LOW) sleep(0.1) changed_state = din.digital_input_state(din_pin) assert initial_state is changed_state diff --git a/tests/hardware_tests/test_eeprom_osensaspace.py b/tests/hardware_tests/test_eeprom_osensaspace.py index 4a6e3682..77fc7b8a 100644 --- a/tests/hardware_tests/test_eeprom_osensaspace.py +++ b/tests/hardware_tests/test_eeprom_osensaspace.py @@ -53,7 +53,7 @@ def test_osensa_space_modify_1(eeprom): assert eeprom_data_origin.adc1_calib_params != eeprom_data_modify.adc1_calib_params assert eeprom_data_origin.adc2_calib_params != eeprom_data_modify.adc2_calib_params - eeprom.read_edgepi_data(eeprom_data_origin) + eeprom.write_edgepi_data(eeprom_data_origin) # TC and RTD modification def test_osensa_space_modify_2(eeprom): @@ -97,10 +97,10 @@ def test_osensa_space_modify_3(eeprom): eeprom_data_modify = eeprom.read_edgepi_data() time.sleep(0.5) - eeprom_data_modify.config_key.certificate = "yeeeeeeet" - eeprom_data_modify.config_key.private_key = "ajksbvjkalsbkvalva" - eeprom_data_modify.data_key.certificate = "asjkdbvakjsnvjka" - eeprom_data_modify.data_key.private_key = "lozxivhzlnjqq" + eeprom_data_modify.config_key.certificate = "This is test string" + eeprom_data_modify.config_key.private_key = "This is test string" + eeprom_data_modify.data_key.certificate = "This is test string" + eeprom_data_modify.data_key.private_key = "This is test string" eeprom.write_edgepi_data(eeprom_data_modify) time.sleep(0.5) diff --git a/tests/hardware_tests/test_eeprom_userspace.py b/tests/hardware_tests/test_eeprom_userspace.py index 71696c42..d105698c 100644 --- a/tests/hardware_tests/test_eeprom_userspace.py +++ b/tests/hardware_tests/test_eeprom_userspace.py @@ -13,7 +13,7 @@ PATH = os.path.dirname(os.path.abspath(__file__)) import pytest -from edgepi.eeprom.eeprom_constants import EdgePiMemoryInfo, EEPROMInfo +from edgepi.eeprom.eeprom_constants import EEPROMInfo from edgepi.eeprom.edgepi_eeprom import EdgePiEEPROM @@ -31,26 +31,6 @@ def read_dummy_json(file_name: str): dummy = json.load(file) return dummy -def test__page_write_register(eeprom): - for val in range(0, 256): - _logger.info(f"test__page_write_register: Test Value = {val}") - data = [val]*16384 - initial_data = eeprom.read_user_space(0, len(data)) - _logger.info(f"test__page_write_register: Initial Value = {len(initial_data)}") - addrx = EdgePiMemoryInfo.USER_SPACE_START_BYTE.value - # pylint: disable=protected-access - page_n = eeprom._EdgePiEEPROM__generate_list_of_pages(addrx, data) - for indx, page in enumerate(page_n): - # pylint: disable=protected-access - eeprom._EdgePiEEPROM__page_write_register(addrx+(indx*EEPROMInfo.PAGE_SIZE.value), page) - time.sleep(0.002) - _logger.info(f"test__page_write_register: Page Written = {len(page_n)}") - new_data = eeprom.read_user_space(0, len(data)) - _logger.info(f"test__page_write_register: New Value = {len(new_data)}") - for indx, init_data in enumerate(initial_data): - assert init_data != new_data[indx] - assert new_data[indx] == data[indx] - def test_reset_user_space(eeprom): reset_vals = [] eeprom.reset_user_space() diff --git a/tests/hardware_tests/test_rtd_reads.py b/tests/hardware_tests/test_rtd_reads.py index f0846b52..77b02d5f 100644 --- a/tests/hardware_tests/test_rtd_reads.py +++ b/tests/hardware_tests/test_rtd_reads.py @@ -6,13 +6,14 @@ # This has to be manually set with temperature machine. Use this value for testing. -RTD_TEMP = 50 -ERROR = 1 +RTD_TEMP = 28 +ERROR = 4 @pytest.fixture(name="rtd", scope="module") def fixture_rtd(): adc = EdgePiADC() + adc.reset() adc.set_rtd(True) return adc @@ -20,11 +21,10 @@ def test_single_sample_rtd(rtd): out = rtd.single_sample_rtd() assert out == pytest.approx(RTD_TEMP, abs=ERROR) - def test_read_rtd_temperature(rtd): rtd.set_config(conversion_mode=ConvMode.CONTINUOUS) - rtd.start_conversions(ADCNum.ADC_1) + rtd.start_conversions(ADCNum.ADC_2) for _ in range(10): out = rtd.read_rtd_temperature() assert out == pytest.approx(RTD_TEMP, abs=ERROR) - rtd.stop_conversions(ADCNum.ADC_1) + rtd.stop_conversions(ADCNum.ADC_2) diff --git a/tests/hardware_tests/test_voltage_rw.py b/tests/hardware_tests/test_voltage_rw.py index 97258c90..4ab0babe 100644 --- a/tests/hardware_tests/test_voltage_rw.py +++ b/tests/hardware_tests/test_voltage_rw.py @@ -5,7 +5,7 @@ from time import sleep import pytest from edgepi.adc.edgepi_adc import EdgePiADC -from edgepi.adc.adc_constants import AnalogIn, ADCNum, DiffMode +from edgepi.adc.adc_constants import AnalogIn, ADCNum, DiffMode, ADCChannel from edgepi.dac.edgepi_dac import EdgePiDAC from edgepi.dac.dac_constants import DACChannel @@ -13,7 +13,7 @@ _logger = logging.getLogger(__name__) -NUM_CHANNELS = 8 +NUM_CHANNELS = 2 READS_PER_WRITE = 1 RW_ERROR = 1e-1 # TODO: change to mV MAX_VOLTAGE = 5.0 @@ -36,6 +36,7 @@ @pytest.fixture(name="adc_1", scope="module") def fixture_adc_1(): adc = EdgePiADC() + adc.reset() adc.start_conversions(ADCNum.ADC_1) yield adc adc.stop_conversions(ADCNum.ADC_1) @@ -44,6 +45,7 @@ def fixture_adc_1(): @pytest.fixture(name="adc_2", scope="module") def fixture_adc_2(): adc = EdgePiADC() + adc.reset() adc.start_conversions(ADCNum.ADC_2) yield adc adc.stop_conversions(ADCNum.ADC_2) @@ -114,11 +116,11 @@ def _generate_diff_test_cases(): f"read_write_error_tolerance: +/- {RW_ERROR} V, num_read_trials: {READS_PER_WRITE}" ) ) - for diff in DiffMode: - voltage = 0 - while voltage < MAX_VOLTAGE - VOLTAGE_STEP: - voltage += VOLTAGE_STEP - yield diff, voltage, voltage + diff = DiffMode.DIFF_2 + voltage = 0 + while voltage < MAX_VOLTAGE - VOLTAGE_STEP: + voltage += VOLTAGE_STEP + yield diff, voltage def _measure_voltage_differential( @@ -127,48 +129,52 @@ def _measure_voltage_differential( # write to DAC channel for channel, write_voltage in write_voltages.items(): dac.write_voltage(channel, write_voltage) - + write_volt = write_voltage + sleep(WRITE_READ_DELAY) for _ in range(READS_PER_WRITE): read_voltage = adc.read_voltage(adc_num) _logger.info(f"diff_read_voltage = {read_voltage}") - _assert_approx(0, read_voltage, RW_ERROR) + _assert_approx(write_volt/2, read_voltage, RW_ERROR) _diff_ch_map = { - AnalogIn.AIN1: DACChannel.AOUT1, - AnalogIn.AIN2: DACChannel.AOUT2, - AnalogIn.AIN3: DACChannel.AOUT3, - AnalogIn.AIN4: DACChannel.AOUT4, - AnalogIn.AIN5: DACChannel.AOUT5, - AnalogIn.AIN6: DACChannel.AOUT6, - AnalogIn.AIN7: DACChannel.AOUT7, - AnalogIn.AIN8: DACChannel.AOUT8, + ADCChannel.AIN0: DACChannel.AOUT1, + ADCChannel.AIN1: DACChannel.AOUT2, + ADCChannel.AIN2: DACChannel.AOUT3, + ADCChannel.AIN3: DACChannel.AOUT4, + ADCChannel.AIN4: DACChannel.AOUT5, + ADCChannel.AIN5: DACChannel.AOUT6, + ADCChannel.AIN6: DACChannel.AOUT7, + ADCChannel.AIN7: DACChannel.AOUT8, } -@pytest.mark.parametrize("diff, mux_p_volt, mux_n_volt", _generate_diff_test_cases()) -def test_differential_rw_adc_1(diff, mux_p_volt, mux_n_volt, adc_1, dac): +@pytest.mark.parametrize("diff, mux_p_volt", _generate_diff_test_cases()) +def test_differential_rw_adc_1(diff, mux_p_volt, adc_1, dac): adc_1.select_differential(ADCNum.ADC_1, diff) + adc_1.start_conversions(ADCNum.ADC_1) _logger.info( f"voltage read/write diff pair: mux_p = {diff.value.mux_p}, mux_n = {diff.value.mux_n}" ) - _logger.info(f"mux_p_write_voltage = {mux_p_volt}, mux_n_write_voltage = {mux_n_volt}") + _logger.info(f"mux_p_write_voltage = {mux_p_volt}") write_voltages = { - _diff_ch_map[diff.value.mux_p]: mux_p_volt, - _diff_ch_map[diff.value.mux_n]: mux_n_volt, + _diff_ch_map[diff.value.mux_p]: mux_p_volt } _measure_voltage_differential(adc_1, dac, ADCNum.ADC_1, write_voltages) + adc_1.stop_conversions(ADCNum.ADC_1) + -@pytest.mark.parametrize("diff, mux_p_volt, mux_n_volt", _generate_diff_test_cases()) -def test_differential_rw_adc_2(diff, mux_p_volt, mux_n_volt, adc_2, dac): +@pytest.mark.parametrize("diff, mux_p_volt", _generate_diff_test_cases()) +def test_differential_rw_adc_2(diff, mux_p_volt, adc_2, dac): adc_2.select_differential(ADCNum.ADC_2, diff) + adc_2.start_conversions(ADCNum.ADC_2) _logger.info( f"voltage read/write diff pair: mux_p = {diff.value.mux_p}, mux_n = {diff.value.mux_n}" ) - _logger.info(f"mux_p_write_voltage = {mux_p_volt}, mux_n_write_voltage = {mux_n_volt}") + _logger.info(f"mux_p_write_voltage = {mux_p_volt}") write_voltages = { - _diff_ch_map[diff.value.mux_p]: mux_p_volt, - _diff_ch_map[diff.value.mux_n]: mux_n_volt, + _diff_ch_map[diff.value.mux_p]: mux_p_volt } _measure_voltage_differential(adc_2, dac, ADCNum.ADC_2, write_voltages) + adc_2.stop_conversions(ADCNum.ADC_2) From 197ce44168ecb3341bf4d5b4c2b1cbf5e9339585 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Wed, 2 Aug 2023 23:18:02 +0000 Subject: [PATCH 39/49] =?UTF-8?q?Bump=20version:=201.2.5=20=E2=86=92=201.2?= =?UTF-8?q?.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 26f49763..cc6dd71b 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.2.5 +current_version = 1.2.6 diff --git a/setup.py b/setup.py index 0dbe83c9..cf05abfc 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.2.5", + version="1.2.6", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 344a2d122b136221137990fb8a13d5355221f1a1 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Tue, 22 Aug 2023 20:02:43 +0000 Subject: [PATCH 40/49] =?UTF-8?q?Bump=20version:=201.2.6=20=E2=86=92=201.2?= =?UTF-8?q?.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index cc6dd71b..b8605cc9 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.2.6 +current_version = 1.2.7 diff --git a/setup.py b/setup.py index cf05abfc..dc368a58 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.2.6", + version="1.2.7", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From b78fb4b0ab6fa955d7dd0e198407477a7805e12d Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Thu, 7 Sep 2023 17:51:18 +0000 Subject: [PATCH 41/49] =?UTF-8?q?Bump=20version:=201.2.7=20=E2=86=92=201.2?= =?UTF-8?q?.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index b8605cc9..d448fdfa 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.2.7 +current_version = 1.2.8 diff --git a/setup.py b/setup.py index dc368a58..be120602 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.2.7", + version="1.2.8", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From aea01476ea3869febe5ad01b1fb8c5e6693830ce Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Thu, 14 Sep 2023 21:09:00 +0000 Subject: [PATCH 42/49] =?UTF-8?q?Bump=20version:=201.2.8=20=E2=86=92=201.2?= =?UTF-8?q?.9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index d448fdfa..aba13a76 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.2.8 +current_version = 1.2.9 diff --git a/setup.py b/setup.py index be120602..b66fe95d 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.2.8", + version="1.2.9", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 61d9224eb4dc82aa311379736ef997b7c0782d27 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Fri, 15 Sep 2023 00:34:10 +0000 Subject: [PATCH 43/49] =?UTF-8?q?Bump=20version:=201.2.9=20=E2=86=92=201.2?= =?UTF-8?q?.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index aba13a76..4dd4bc1c 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.2.9 +current_version = 1.2.10 diff --git a/setup.py b/setup.py index b66fe95d..3e69c520 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.2.9", + version="1.2.10", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 7a4625548b2c19114365e996f59183a8a32f4da6 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Fri, 15 Sep 2023 17:30:33 +0000 Subject: [PATCH 44/49] =?UTF-8?q?Bump=20version:=201.2.10=20=E2=86=92=201.?= =?UTF-8?q?2.11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 4dd4bc1c..ed0ade77 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.2.10 +current_version = 1.2.11 diff --git a/setup.py b/setup.py index 3e69c520..6f157f34 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.2.10", + version="1.2.11", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 350ca934b6ca23617367856f2eaea402643f0e77 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Mon, 18 Sep 2023 21:09:35 +0000 Subject: [PATCH 45/49] =?UTF-8?q?Bump=20version:=201.2.11=20=E2=86=92=201.?= =?UTF-8?q?2.12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index ed0ade77..db59d4b8 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.2.11 +current_version = 1.2.12 diff --git a/setup.py b/setup.py index 6f157f34..090f352a 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.2.11", + version="1.2.12", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 77ccfbc6d8e3aaad08d331fb59aac671bebed19d Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Fri, 22 Sep 2023 19:07:11 +0000 Subject: [PATCH 46/49] =?UTF-8?q?Bump=20version:=201.2.12=20=E2=86=92=201.?= =?UTF-8?q?2.13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index db59d4b8..399ef87b 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.2.12 +current_version = 1.2.13 diff --git a/setup.py b/setup.py index 090f352a..26d73550 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.2.12", + version="1.2.13", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From d6a8cf39d18c091239dc6bfc7c016b0e2a4e8d54 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Thu, 19 Oct 2023 19:33:31 +0000 Subject: [PATCH 47/49] =?UTF-8?q?Bump=20version:=201.2.13=20=E2=86=92=201.?= =?UTF-8?q?2.14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 399ef87b..4fb657b2 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.2.13 +current_version = 1.2.14 diff --git a/setup.py b/setup.py index 26d73550..c1bd2030 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.2.13", + version="1.2.14", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From fef28bcbe30f4d7141bc1177126a37ba990366f5 Mon Sep 17 00:00:00 2001 From: bot-edgepi Date: Fri, 20 Oct 2023 20:19:15 +0000 Subject: [PATCH 48/49] =?UTF-8?q?Bump=20version:=201.2.14=20=E2=86=92=201.?= =?UTF-8?q?2.15?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 4fb657b2..5b15da20 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] tag_name = rc/v{new_version} -current_version = 1.2.14 +current_version = 1.2.15 diff --git a/setup.py b/setup.py index c1bd2030..56a2dd07 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="edgepi-python-sdk", - version="1.2.14", + version="1.2.15", author="S.Park", author_email="spark@osensa.com", description="EdgePi Python SDK package", From 0afa0097e876c63c859ee3fb7ac8317604560fa6 Mon Sep 17 00:00:00 2001 From: Ryan Walker Date: Thu, 26 Oct 2023 18:24:51 -0700 Subject: [PATCH 49/49] Docs a little off. --- src/edgepi/led/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/edgepi/led/README.md b/src/edgepi/led/README.md index f2c68b5a..5842b282 100644 --- a/src/edgepi/led/README.md +++ b/src/edgepi/led/README.md @@ -12,9 +12,9 @@ from edgepi.led.led_constants import LEDPins leds = EdgePiLED() -leds.turn_on(LEDPins.LED1) +leds.turn_led_on(LEDPins.LED1) -leds.turn_off(LEDPins.LED1) +leds.turn_led_off(LEDPins.LED1) ``` # Functionalities @@ -28,9 +28,9 @@ Currently, the LED module offers the following functionalities: ## Turn an LED on/off ```python -leds.turn_on(LEDPins.LED1) +leds.turn_led_on(LEDPins.LED1) -leds.turn_off(LEDPins.LED1) +leds.turn_led_off(LEDPins.LED1) ``` ## Toggle an LED to the opposite state