GithubHelp home page GithubHelp logo

chmatsch / asksinpp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pa-pa/asksinpp

1.0 0.0 0.0 12.97 MB

Extension of the encoder to half and quarter steps for encoders that have 2 or 4 detent positions per pulse period. The configuration takes place when the class instance is created using the constructor. The new parameters are optional, so existing code can continue to be used unchanged. A special feature emerged with double or quadruple evaluation when using hardware debouncing of the encoder signals via RC element: If the interrupt release occurs during initialization immediately after the port mode has been defined, the capacitor is still empty and is charging. This leads to an unwanted detection of an alleged rotary movement. Therefore the interrupt release must be delayed. For the sake of simplicity, I used the delay() method here, since this is called only once during boot and only during setup.

Shell 1.26% JavaScript 0.09% C++ 87.21% C 5.13% Assembly 0.26% HTML 6.06%

asksinpp's Introduction

AskSin++ .github/workflows/build-sketches.yml

C++ implementation of the AskSin protocol

  • easy configuration of the device channels by using templates
  • direct eeprom access for the channel data
  • AES signature support
  • Supported MCU:

Required additional Arduino libraries:

  • EnableInterrupt
    • For ATMega644 and ATMega1284 the PR #49 needs to be included
  • Low-Power
    • For ATMega644 and ATMega1284 the PR #57 needs to be included

Optional required Sensor Libraries

Enable AES Support

To enable the AES signature support USE_AES needs to be defined. In addition the default key and the default key index has to provided with HM_DEF_KEY and HM_DEF_KEY_INDEX.

#define USE_AES
#define HM_DEF_KEY 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10
#define HM_DEF_KEY_INDEX 0

In FHEM you can get the key from the hmKey, hmKey2, hmKey3 attributes of the VCCU. The index is the key number multiplied by 2.

Extra Defines for Configuration

All defines has to set in the sketch before any header file is included.

  • USE_WOR - enables WOR listening during idle (burst devices)
  • USE_CCA - enable Clear Channel Assessment / Listen Before Talk
  • DEVICE_CHANNEL_COUNT - set number of device channels, skip calculation
  • USE_HW_SERIAL - generate device id and serial from cpu identifier (ATmega644, ATmega1284, STM32F1 only)
  • USE_OTA_BOOTLOADER - read device id and serial from the OTA bootloader
  • USE_OTA_BOOTLOADER_FREQUENCY - reuse the CC1101 frequence setting from the bootloader
  • HIDE_IGNORE_MSG - do not show ignore-packet dumps of received messages (that are not for our device)

Defnies to reduce code size

The following defines can be used to reduce the size of the code. All defines has to set in the sketch before any header file is included.

  • SENSOR_ONLY - save some byte by exclude code for actor devices
  • NORTC - removes code for RTC support
  • NOCRC - removes CRC calculation during startup - The EEPROM will no longer initialized when channel configuration is changed. A extra RESET is needed to initialize it again.
  • SIMPLE_CC1101_INIT - simple CC1101 initialization - No error reporting in case of errors.
  • NDEBUG - no serial (debug) output; no hardware serial initialized/used at all

Alternative Device RESET Method

Normally, a device can be reset to its default settings by pressing and holding down the config button for at least 6 seconds. Alternatively, another reset method can be used with ResetOnBoot.h without pressing the config button (i.e. for devices in hard to reach places):

  • to reset, reboot the device twice within 4 seconds after startup
    • explained in detail:
      • startup: the device led blinks with 5 Hz the first 4 seconds
      • if the device is restarted within this time, the device led blinks with 10 Hz for 4 seconds
      • only if the device is restarted again within this time, the device will do a RESET , otherwise it will proceed normal operation
  • implemented in HM-LC-SW1-BA-PCB.ino to demonstrate the usage
  • at least, an automated pairing can be triggered by uncommenting line #113

asksinpp's People

Contributors

jp112sdl avatar pa-pa avatar trilu2000 avatar stan23 avatar xento avatar psi-4ward avatar scuba82 avatar alexreinert avatar tommajor avatar maniac103 avatar chmatsch avatar bird968 avatar harvey637 avatar feinfinger380 avatar manawyrm avatar p2122 avatar der-pw avatar darkshortie avatar messemar avatar mdk2412 avatar krikk avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.