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 PMU | |
{ | |
private: | |
I2CMaster& i2c; | |
std::uint8_t address; | |
static constexpr std::uint8_t AXP192_REG_EXTEN_DCDC2_OUTPUT_CONFIG = 0x10; | |
static constexpr std::uint8_t AXP192_REG_LDO2_LDO3_OUTPUT_VOLTAGE = 0x28; |
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
MicroPython v1.11-127-g71019d174 on 2019-08-02; ESP32 module with ESP32 | |
Type "help()" for more information. | |
>>> | |
>>> | |
>>> import machine | |
>>> i2c = machine.I2C(1, sda=21, scl=22, speed=400000) | |
>>> i2c.scan() | |
[14, 104, 117] | |
>>> [hex(x) for x in i2c.scan()] | |
['0xe', '0x68', '0x75'] |
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 time | |
import machine | |
import network | |
import esp | |
import usocket | |
try: | |
from typing import Tuple, Callable, List, Optional | |
from builtins import const | |
except: |
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
#![no_std] | |
#![feature(lang_items, alloc_error_handler, alloc)] | |
use core::panic::PanicInfo; | |
use core::alloc::{GlobalAlloc, Layout}; | |
use core::fmt; | |
use core::fmt::Write; | |
use core::convert::From; | |
use core::ptr; | |
use core::mem; | |
use core::str; |
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
extern crate bindgen; | |
extern crate walkdir; | |
use std::env; | |
use std::path::PathBuf; | |
use walkdir::WalkDir; | |
fn main() { | |
let idf_components_path = PathBuf::from(env::var("IDF_PATH").unwrap()).join("components"); | |
let xtensa_toolchain_path = PathBuf::from(env::var("XTENSA_TOOLCHAIN_PATH").unwrap()); |
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 <hls_stream.h> | |
#include <ap_int.h> | |
void swap_endian(hls::stream<ap_uint<32> >& in, hls::stream<ap_uint<32> >& out) | |
{ | |
ap_uint<32> data; | |
in >> data; | |
out << (data.range(7, 0), data.range(15, 8), data.range(23, 16), data.range(31, 24)); | |
} |
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
#![no_std] | |
#![feature(lang_items, core_intrinsics)] | |
use core::intrinsics; | |
use core::panic::PanicInfo; | |
use core::alloc::{GlobalAlloc, Layout}; | |
use core::fmt; | |
use core::fmt::Write; | |
extern { | |
fn malloc(size: usize) -> *mut u8; |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleApp1 | |
{ | |
class Program | |
{ |
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": "M5Stack WiSUN", | |
"version": "v0.1", | |
"path": "WiSUN", | |
"commands": [ | |
"--chip esp32 --port %port --baud %baud --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 %PATH/bootloader.bin 0xf000 %PATH/phy_init_data.bin 0x10000 %PATH/MicroPython.bin 0x8000 %PATH/partitions_mpy.bin 0x1D0000 %PATH/spiffs_image.img" | |
] | |
} | |
] |
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
""" | |
Setup development environment | |
""" | |
import time | |
import network | |
import machine | |
import gc | |
try: |