Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright (c) 2021 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/kernel.h>
#include <zephyr/audio/dmic.h>
#include <zephyr/drivers/pwm.h>
@hlord2000
hlord2000 / NOOTS.TXT
Created July 18, 2023 17:02
NOOT STACK
LIONS MANE : https://www.amazon.com/Lions-Mushroom-Capsules-Month-Supply/dp/B07PM8X5CG/ref=sr_1_6?keywords=Lions+Mane&qid=1689699585&sr=8-6
ASHWAGANDA : https://www.amazon.com/Futurebiotics-Ashwagandha-Capsules-Strength-Serving/dp/B09KHK2FPF/ref=sr_1_6?keywords=ashwagandha&qid=1689699578&rdc=1&sr=8-6
GINGKO : https://www.amazon.com/Natures-Bounty-Supplement-Supports-Alertness/dp/B002Y27JYM/ref=sr_1_4?c=ts&keywords=Ginkgo+Biloba+Herbal+Supplements&qid=1689699566&s=hpc&sr=1-4&ts_id=3765701
GINSENG : https://www.amazon.com/Bronson-Supports-Endurance-Vitality-Performance/dp/B08ZYKS5QF/ref=sr_1_7?keywords=ginseng&qid=1689699548&rdc=1&sr=8-7
LECITHIN : https://www.amazon.com/Carlyle-Sunflower-Lecithin-1200mg-Softgels/dp/B07G7HSQK9/ref=sr_1_5?keywords=Lecithin&qid=1689699259&sr=8-5
VINPOCETINE : https://www.amazon.com/Piping-Rock-Vinpocetine-Supplement-Super-Strength/dp/B0BM53Y7MZ/ref=sr_1_3?keywords=vinpocetine+10mg&qid=1689699450&sr=8-3
DMAE BITARTRATE : https://www.amazon.com
@hlord2000
hlord2000 / nboot0.c
Created August 20, 2023 07:06
Disregarding BOOT0 Pin on STM32L4 Microcontroller
#define OPTION_BYTES_BASE 0x40022020
#define FLASH_STATUS_REGISTER_OFFSET 0x10
volatile uint32_t * FLASH_STATUS_REGISTER = (volatile uint32_t *)(OPTION_BYTES_BASE + FLASH_STATUS_REGISTER_OFFSET);
#define FLASH_STATUS_REGISTER_BUSY (1 << 16)
#define FLASH_CONTROL_REGISTER_OFFSET 0x14
volatile uint32_t * FLASH_CONTROL_REGISTER = (volatile uint32_t *)(OPTION_BYTES_BASE + FLASH_CONTROL_REGISTER_OFFSET);
{
"version": "1.0",
"keymap": {
"layers": [
{
"name": "layer0",
"keys": [
{
"behavior": "tap",
"parameters": ["keycode_A", "option_1"]
@hlord2000
hlord2000 / main.py
Created May 10, 2024 16:49
Bleak Test w/ Nordic UART Service
# This demo shows how to connect to a device, get its services and characteristics,
# and then subscribe to notifications from a characteristic. It also shows how to
# write to a characteristic.
#
# To begin, create a virtual environment and install bleak
#
# python3 -m venv venv
# source venv/bin/activate
# pip install bleak
#
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
if (argc != 2) {
fprintf(stderr, "Usage: %s <errno_value>\n", argv[0]);
return 1;
}
@hlord2000
hlord2000 / ncs_zsh.sh
Last active September 26, 2024 11:40
# NCS activation function
actvenv_ncs() {
local ncs_dir="/opt/ncs"
local versions=($(ls "$ncs_dir" | sort -Vr))
# If no argument provided, show available versions
if [[ $# -eq 0 ]]; then
echo "Available versions:"
printf '%s\n' "${versions[@]}"
echo "Usage: actvenv_ncs <version>"
@hlord2000
hlord2000 / sdm.sh
Created October 3, 2024 17:59
Serial Device Manager, defaults to using tio
sdm() {
# ANSI color codes
local RED=$'\033[0;31m'
local GREEN=$'\033[0;32m'
local YELLOW=$'\033[1;33m'
local BLUE=$'\033[0;34m'
local MAGENTA=$'\033[0;35m'
local CYAN=$'\033[0;36m'
local BOLD=$'\033[1m'
local UNDERLINE=$'\033[4m'
import argparse
import os
from pathlib import Path
import shutil
import sys
from west import log
from west.commands import WestCommand
from InquirerPy import inquirer
class BoardCreator(WestCommand):
import re
import sys
import argparse
from dataclasses import dataclass
from typing import List, Dict, Set, Optional
@dataclass
class State:
name: str
parent: Optional[str] = None