Skip to content

Instantly share code, notes, and snippets.

View C47D's full-sized avatar
:octocat:
Working...

Carlos Diaz C47D

:octocat:
Working...
  • México
View GitHub Profile
@C47D
C47D / .pre-commit-config.yaml
Created February 8, 2022 05:54
LVGL pre-commit
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- repo: local
hooks:
# Run astyle over the staged files with c and h extension found in the directories
# listed in the files regex pattern. Ignoring the files in the exclude pattern.
- id: format-source
@C47D
C47D / main.rs
Last active March 29, 2021 21:55
[Rust lang] Read files and send it via serialport
use std::fs::File;
use std::io::prelude::*;
use serialport::available_ports;
fn main() {
let mut file = File::open("info.txt").expect("Can't open the file");
let mut contents = String::new();
@C47D
C47D / disp_spi.c
Last active September 17, 2020 01:55
Prototype implementation of an "platform-agnostic" lv_drivers for LVGL.
/**
* @file disp_spi.c
*
*/
/*********************
* INCLUDES
*********************/
#include <string.h>
@C47D
C47D / debug.txt
Created November 28, 2019 23:34
Habilitar y deshabilitar mensajes de depuración definiendo un simbolo
#define DEBUG_MP3_PLAYER
#ifdef DEBUG_MP3_PLAYER
#define DEBUG_(fmt, ...) \
DBG_println(fmt, __VA_ARGS__)
#define DEBUG(...) \
DEBUG_(__VA_ARGS__, "")
#else
#define DEBUG(fmt, ...)
#endif
@C47D
C47D / notas_lorawan_node.txt
Last active November 9, 2019 15:21
Creación de board custom en LoRaMac-node
## Creando custom board basados en el board B-L072Z-LRWAN1 ##
# Clonamos el repositorio de LoRaMac-node
$ git clone https://github.com/Lora-net/LoRaMac-node.git
# Entramos a LoRaMac-node/src/boards y copiamos el directorio B-L072Z-LRWAN1,
# al nuevo directorio le asignamos el nombre de nuetro board, por ejemplo FOO
$ cd LoRaMac-node/src/boards
@C47D
C47D / flash_jlink.txt
Created June 23, 2019 21:29
Flash adafruit uf2 bootloader to grandcentral m4 express board, this can be converted into a jlink script
@C47D
C47D / notes.txt
Created June 7, 2019 23:00
circuitpython notes
# Add i2s to nrf52
Go to ports/nrf/common-hal/audiobusio/I2SOut.h y I2SOut.c
revisar el common-hal de atmel-samd para referencia.
Implementar las funciones definidas en shared-bindings/audiobusio/I2SOut.h y I2SOut.c / PDMIn.h y PDMIn.c
NOTA: shared-bindings son la relacion entre python y el código en C
La hal de los chips de nordic se basa en: https://github.com/adafruit/nrfx
@C47D
C47D / gist:c1c4d8735749e67d9703230dde4bbb4e
Last active June 7, 2019 22:39
esp32 environment setup
export PATH="$HOME/esp/xtensa-esp32-elf/bin:$PATH"
export IDF_PATH=~/esp/esp-idf
export PATH="$IDF_PATH/tools:$PATH"
# ADD INCLUDE PATHS
Edit component.mk
(from https://esp32.com/viewtopic.php?t=958)
See: https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html?highlight=component#component-makefiles
LD_FILE = boards/samd21x18-bootloader.ld
USB_VID = 0x1209
USB_PID = 0xBAB3
USB_PRODUCT = "Bast Pro Mini RGB M0"
USB_MANUFACTURER = "Electronic Cats"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
@C47D
C47D / mpconfigboard.h
Created June 2, 2019 02:41
Custom board definition for the bast pro mini with a rgb led attached to it
#define MICROPY_HW_BOARD_NAME "Electronic Cats Bast Pro Mini RGB M0"
#define MICROPY_HW_MCU_NAME "samd21e18"
#define MICROPY_PORT_A (0)
#define MICROPY_PORT_B (0)
#define MICROPY_PORT_C (0)
#define CIRCUITPY_INTERNAL_NVM_SIZE 0
#define CP_RGB_STATUS_R (&pin_PA15)