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
/* | |
xdrv_42_i2s_audio.ino - Audio dac support for Tasmota | |
Copyright (C) 2021 Gerhard Mutz and Theo Arends | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. |
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
{"NAME":"ESP32P4-NANO","GPIO":[0,0,0,0,0,0,0,640,608,7776,7840,7872,7808,9376,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5568,0,0,0,0,0,0,0,8864,8896,8928,8960,8832,8800,6720,0,0,0,0,0,5536,5600,0,0],"FLAG":0,"BASE":1,"CMND":"ethtype 1|ethaddress -1"} |
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 |
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
int32_t m_chacha20_poly_run(bvm *vm, int32_t _encrypt) { | |
int32_t argc = be_top(vm); // Get the number of arguments | |
if (argc >= 4 && be_isbytes(vm, 1) // secret_key - 32 bytes | |
&& be_isbytes(vm, 2) // iv/nonce - 12 bytes | |
&& be_isbytes(vm, 3) // data/cipher | |
&& be_isbytes(vm, 4) // mac/tag - 16 bytes | |
// optional: aad | |
) { | |
size_t key_len = 0; |
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
import crypto | |
e = crypto.ED25519() | |
seed = bytes("9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60") | |
secret_key=e.secret_key(seed) | |
message = bytes() | |
public_key = secret_key[-32..] | |
_public_key = bytes("d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a") | |
assert(public_key == _public_key) | |
signature = e.sign(message, secret_key) | |
assert(signature == bytes("e5564300c360ac729086e2cc806e828a84877f1eb8e5d974d873e065224901555fb8821590a33bacc61e39701cf9b46bd25bf5f0595bbe24655141438e7a100b")) |
NewerOlder