- Date written: 2024-10-30
- Python version: 3.12.7
- Rust version: 1.82.0
- PyO3 version: 0.22.5
- zlib version: 1.3.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
| FROM debian:trixie as build | |
| WORKDIR /build | |
| RUN apt update && apt -y install clang llvm git make ninja-build cmake wget | |
| RUN git clone https://git.code.sf.net/p/mingw-w64/mingw-w64 | |
| RUN cd mingw-w64 && git checkout v14.0.0 | |
| RUN wget https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-22.1.3.tar.gz | |
| RUN tar xzf llvmorg-22.1.3.tar.gz |
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
| #!/usr/bin/env python3 | |
| from collections import namedtuple | |
| import socket | |
| import struct | |
| usbip_user_op_common = namedtuple('usbip_user_op_common', 'version code status') | |
| usbip_usb_device = namedtuple('usbip_usb_device', 'path busid busnum devnum speed idVendor idProduct bcdDevice bDeviceClass bDeviceSubClass bDeviceProtocol bConfigurationValue bNumConfigurations bNumInterfaces') | |
| usbip_header_basic = namedtuple('usbip_header_basic', 'command seqnum devid direction ep') |
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
| /** | |
| * \file spi.c | |
| * | |
| * \brief This is a sample application file which invokes some APIs | |
| * from the SPI device abstraction layer to perform configuration, | |
| * transmission and reception operations. | |
| * | |
| */ | |
| /* |
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
| # https://deutsch.ucsd.edu/psychology/pages.php?i=201 | |
| import numpy as np | |
| import scipy.io.wavfile | |
| import scipy.special | |
| f_s = 44100 | |
| duration = 10 | |
| note1 = 392 |
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
| mcpy r_end, r_sta(rt), r_dst | |
| 00000 00 00000 00000 11100000 0001111 | |
| r_dst r_sta r_end MISC-MEM |
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
| def gf2_mult_intermed(a, b, m): | |
| result = 0 | |
| for biti in range(m): | |
| if a & (1 << biti): | |
| result ^= (b << biti) | |
| return result | |
| def gf2_reduce(c, p, m): | |
| # polynomial has an implicit, unspecified x^m term | |
| c_bits = 2*m-1 |
JLCPCB color silkscreen files are encrypted using AES-128-GCM and RSA-2048 with OAEP padding with SHA-256 as the hash function. Unfortunately, this means that, although it is possible for tools other than EasyEDA to create files, only JLCPCB can decrypt the resulting files.
The structure of an encrypted file is as follows:
- 256 bytes RSA-encrypted AES key
- 256 bytes RSA-encrypted GCM nonce
This has been reverse engineered from the toolchain only and has not been tested on hardware.
The c.lbu, c.lhu, c.sb, and c.sh opcodes replace some standard opcodes (that the QingKe cores do not implement, as the replaced opcodes require the D extension), and they also appear to be compatible with "Huawei" extensions mentioned here.
The c.lbusp, c.lhusp, c.sbsp, and c.shsp opcodes exist in a "reserved" opcode block.
001 uimm[0] uimm[4:3] rs1` uimm[2:1] rd` 00 c.lbu (replacing c.fld)
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 <stdint.h> | |
| #include <string.h> | |
| #include "CH579SFR.h" | |
| void write_str(const char *s) { | |
| for (uint32_t i = 0; i < strlen(s); i++) { | |
| while (!(R8_UART1_LSR & RB_LSR_TX_FIFO_EMP)) {} | |
| R8_UART1_THR = s[i]; | |
| } |
NewerOlder