This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Copyright (c) 2017 Thomas Pornin <[email protected]> | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining | |
| * a copy of this software and associated documentation files (the | |
| * "Software"), to deal in the Software without restriction, including | |
| * without limitation the rights to use, copy, modify, merge, publish, | |
| * distribute, sublicense, and/or sell copies of the Software, and to | |
| * permit persons to whom the Software is furnished to do so, subject to | |
| * the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Tasmota Berry SHA-256 benchmark (multi-size) | |
| # Uses crypto.SHA256 with update()/out() | |
| # Timing via tasmota.millis() | |
| # Compares hashes in uppercase | |
| import crypto | |
| # Hash utility: returns uppercase hex (native .tohex()) | |
| def sha256_hex(data) | |
| var h = crypto.SHA256() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "t_inner.h" | |
| #if defined(USE_SHA_ROM) | |
| #if defined(ESP_PLATFORM) && !defined(ESP8266) | |
| #include <stdint.h> | |
| #include <stddef.h> | |
| #include <string.h> | |
| #include "freertos/FreeRTOS.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #------------------------------------------------------------------------------ | |
| - Matter BLE | |
| -------------------------------------------------------------------------------# | |
| import BLE | |
| import matter | |
| var cbuf = bytes(-255) | |
| class BTP_CONTROL_FLAGS | |
| static var H_BIT = 6 # Handshake | |
| static var M_BIT = 5 # Management Message |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class DAIKIN_PARSER | |
| static def to_list(buf) | |
| import string | |
| var result = {} | |
| var msg = buf | |
| if classof(buf) == bytes | |
| msg = buf.asstring() | |
| end | |
| msg = string.split(msg,",") | |
| var success = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # TAS5805M DAC Driver for Berry/Tasmota | |
| # Based on: https://github.com/sonocotta/esp32-tas5805m-dac | |
| class TAS5805M | |
| # Louder-ESP32 I2S DAC Driver for TAS5805M | |
| static i2c_addr = 0x2D # Default I2C address | |
| static pdn_pin = 33 # Power Down Pin (GPIO 33) | |
| static fault_pin = 34 # Fault Pin (GPIO 34, optional) | |
| var i2c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ES8311 Audio Codec Driver for Berry | |
| # HW: ESP32P4-Nano, may work with the ESP32P4-EV too | |
| class ES8311 | |
| var i2c | |
| def init() | |
| import gpio | |
| self.i2c = tasmota.wire_scan(0x18) | |
| if self.i2c == nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ES8311 Audio Codec Driver - Complete Berry Implementation | |
| # Converted from C implementation for Tasmota/ESP32 | |
| class ES8311 | |
| # Konstanten | |
| # P4 Nano | |
| static P4_NANO_PA_GPIO = 53 | |
| static ES8311_ADDR = 0x18 | |
| static FROM_MCLK_PIN = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class PLAYER | |
| var mp3s, mp3_index | |
| def init() | |
| import path | |
| import string | |
| var d = path.listdir("/") | |
| self.mp3s = [] | |
| self.mp3_index = 0 | |
| for f:d | |
| if string.endswith(f,".mp3") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #- Simple SSH server in Berry by Christian Baars | |
| # this is demo code and not intended for production use | |
| -# | |
| #@ solidify:SSH_MSG | |
| class SSH_MSG | |
| static DISCONNECT = 1 | |
| static IGNORE = 2 | |
| static SERVICE_REQUEST = 5 | |
| static SERVICE_ACCEPT = 6 |