update and test with rpi zero 2

This commit is contained in:
Tropicananass 2025-05-12 17:53:09 +02:00
parent c1fb89271c
commit 4b3b2d1772
73 changed files with 215772 additions and 2600 deletions

17
.vscode/c_cpp_properties.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/RpiLedBars/backend/src/tasks/includes/*"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu17",
"cppStandard": "c++17",
"intelliSenseMode": "linux-gcc-arm"
}
],
"version": 4
}

9
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,9 @@
{
"files.associations": {
"stdlib.h": "c",
"websocket.h": "c",
"stdint.h": "c",
"stdint-gcc.h": "c",
"rpi_param.h": "c"
}
}

19
LedBars.code-workspace Normal file
View File

@ -0,0 +1,19 @@
{
"folders": [
{
"path": "."
},
{
"path": "RpiLedBars"
}
],
"settings": {
"files.associations": {
"stdlib.h": "c",
"websocket.h": "c",
"stdint.h": "c",
"stdint-gcc.h": "c",
"rpi_param.h": "c"
}
}
}

42
RpiLedBars/README.md Normal file
View File

@ -0,0 +1,42 @@
# RpiLedBars
## TODO
### backend
#### Toolchain
- [ ] build raspberrypi toolchain :
- https://tttapa.github.io/Pages/Raspberry-Pi/C++-Development/Building-The-Toolchain.html
- https://medium.com/@stonepreston/how-to-cross-compile-a-cmake-c-application-for-the-raspberry-pi-4-on-ubuntu-20-04-bac6735d36df
- [ ] create a dockerized dev env
- [ ] use CMake to crosscompile
- [ ] use gdb and valgrind to debug and itegrate in vscode :
- https://code.visualstudio.com/docs/cpp/configure-intellisense-crosscompilation
#### Code
- [ ] move midi specific computing from param
- [ ] Use Json : https://github.com/json-c/json-c
- [ ] Midi note and clock sync
- [ ] Transitions
### frontend
- [ ] use Vue.js
- [ ] automate deployment
- [ ] define protocol
### hardware
- [ ] add button to switch AP
## Protocol
### From frontend to backend
| msg | desc |
| --- | ---- |
| c | |
| | |
### From backend to frontend

View File

@ -0,0 +1,87 @@
# This file will be configured to contain variables for CPack. These variables
# should be set in the CMake list file of the project before CPack module is
# included. The list of available CPACK_xxx variables and their associated
# documentation may be obtained using
# cpack --help-variable-list
#
# Some variables are common to all generators (e.g. CPACK_PACKAGE_NAME)
# and some are specific to a generator
# (e.g. CPACK_NSIS_EXTRA_INSTALL_COMMANDS). The generator specific variables
# usually begin with CPACK_<GENNAME>_xxxx.
set(CPACK_BINARY_7Z "")
set(CPACK_BINARY_BUNDLE "")
set(CPACK_BINARY_CYGWIN "")
set(CPACK_BINARY_DEB "OFF")
set(CPACK_BINARY_DRAGNDROP "")
set(CPACK_BINARY_FREEBSD "OFF")
set(CPACK_BINARY_IFW "OFF")
set(CPACK_BINARY_NSIS "OFF")
set(CPACK_BINARY_NUGET "")
set(CPACK_BINARY_OSXX11 "")
set(CPACK_BINARY_PACKAGEMAKER "")
set(CPACK_BINARY_PRODUCTBUILD "")
set(CPACK_BINARY_RPM "OFF")
set(CPACK_BINARY_STGZ "ON")
set(CPACK_BINARY_TBZ2 "OFF")
set(CPACK_BINARY_TGZ "ON")
set(CPACK_BINARY_TXZ "OFF")
set(CPACK_BINARY_TZ "ON")
set(CPACK_BINARY_WIX "")
set(CPACK_BINARY_ZIP "")
set(CPACK_BUILD_SOURCE_DIRS "/home/paquito/Projects/LedBars/RpiLedBars/backend;/home/paquito/Projects/LedBars/RpiLedBars/backend/.build")
set(CPACK_CMAKE_GENERATOR "Unix Makefiles")
set(CPACK_COMPONENTS_ALL "")
set(CPACK_COMPONENT_UNSPECIFIED_HIDDEN "TRUE")
set(CPACK_COMPONENT_UNSPECIFIED_REQUIRED "TRUE")
set(CPACK_DEFAULT_PACKAGE_DESCRIPTION_FILE "/usr/share/cmake-3.16/Templates/CPack.GenericDescription.txt")
set(CPACK_GENERATOR "STGZ;TGZ;TZ")
set(CPACK_INSTALL_CMAKE_PROJECTS "/home/paquito/Projects/LedBars/RpiLedBars/backend/.build;RpiLedBars;ALL;/")
set(CPACK_INSTALL_PREFIX "/usr/local")
set(CPACK_MODULE_PATH "")
set(CPACK_NSIS_DISPLAY_NAME "json-c 0.16.99")
set(CPACK_NSIS_INSTALLER_ICON_CODE "")
set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
set(CPACK_NSIS_PACKAGE_NAME "json-c 0.16.99")
set(CPACK_OUTPUT_CONFIG_FILE "/home/paquito/Projects/LedBars/RpiLedBars/backend/.build/CPackConfig.cmake")
set(CPACK_PACKAGE_DEFAULT_LOCATION "/")
set(CPACK_PACKAGE_DESCRIPTION_FILE "/usr/share/cmake-3.16/Templates/CPack.GenericDescription.txt")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "RpiLedBars built using CMake")
set(CPACK_PACKAGE_FILE_NAME "json-c-0.16.99-Linux")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "json-c 0.16.99")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "json-c 0.16.99")
set(CPACK_PACKAGE_NAME "json-c")
set(CPACK_PACKAGE_RELOCATABLE "true")
set(CPACK_PACKAGE_VENDOR "Humanity")
set(CPACK_PACKAGE_VERSION "0.16.99")
set(CPACK_PACKAGE_VERSION_MAJOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "16")
set(CPACK_PACKAGE_VERSION_PATCH "99")
set(CPACK_RESOURCE_FILE_LICENSE "/usr/share/cmake-3.16/Templates/CPack.GenericLicense.txt")
set(CPACK_RESOURCE_FILE_README "/usr/share/cmake-3.16/Templates/CPack.GenericDescription.txt")
set(CPACK_RESOURCE_FILE_WELCOME "/usr/share/cmake-3.16/Templates/CPack.GenericWelcome.txt")
set(CPACK_SET_DESTDIR "OFF")
set(CPACK_SOURCE_7Z "")
set(CPACK_SOURCE_CYGWIN "")
set(CPACK_SOURCE_GENERATOR "TBZ2;TGZ;TXZ;TZ")
set(CPACK_SOURCE_IGNORE_FILES "/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/build;/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/cmake-build-debug;/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/pack;/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/.idea;/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/.DS_Store;/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/.git;/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/.vscode")
set(CPACK_SOURCE_OUTPUT_CONFIG_FILE "/home/paquito/Projects/LedBars/RpiLedBars/backend/.build/CPackSourceConfig.cmake")
set(CPACK_SOURCE_RPM "OFF")
set(CPACK_SOURCE_TBZ2 "ON")
set(CPACK_SOURCE_TGZ "ON")
set(CPACK_SOURCE_TXZ "ON")
set(CPACK_SOURCE_TZ "ON")
set(CPACK_SOURCE_ZIP "OFF")
set(CPACK_SYSTEM_NAME "Linux")
set(CPACK_TOPLEVEL_TAG "Linux")
set(CPACK_WIX_SIZEOF_VOID_P "8")
if(NOT CPACK_PROPERTIES_FILE)
set(CPACK_PROPERTIES_FILE "/home/paquito/Projects/LedBars/RpiLedBars/backend/.build/CPackProperties.cmake")
endif()
if(EXISTS ${CPACK_PROPERTIES_FILE})
include(${CPACK_PROPERTIES_FILE})
endif()

View File

@ -0,0 +1,94 @@
# This file will be configured to contain variables for CPack. These variables
# should be set in the CMake list file of the project before CPack module is
# included. The list of available CPACK_xxx variables and their associated
# documentation may be obtained using
# cpack --help-variable-list
#
# Some variables are common to all generators (e.g. CPACK_PACKAGE_NAME)
# and some are specific to a generator
# (e.g. CPACK_NSIS_EXTRA_INSTALL_COMMANDS). The generator specific variables
# usually begin with CPACK_<GENNAME>_xxxx.
set(CPACK_BINARY_7Z "")
set(CPACK_BINARY_BUNDLE "")
set(CPACK_BINARY_CYGWIN "")
set(CPACK_BINARY_DEB "OFF")
set(CPACK_BINARY_DRAGNDROP "")
set(CPACK_BINARY_FREEBSD "OFF")
set(CPACK_BINARY_IFW "OFF")
set(CPACK_BINARY_NSIS "OFF")
set(CPACK_BINARY_NUGET "")
set(CPACK_BINARY_OSXX11 "")
set(CPACK_BINARY_PACKAGEMAKER "")
set(CPACK_BINARY_PRODUCTBUILD "")
set(CPACK_BINARY_RPM "OFF")
set(CPACK_BINARY_STGZ "ON")
set(CPACK_BINARY_TBZ2 "OFF")
set(CPACK_BINARY_TGZ "ON")
set(CPACK_BINARY_TXZ "OFF")
set(CPACK_BINARY_TZ "ON")
set(CPACK_BINARY_WIX "")
set(CPACK_BINARY_ZIP "")
set(CPACK_BUILD_SOURCE_DIRS "/home/paquito/Projects/LedBars/RpiLedBars/backend;/home/paquito/Projects/LedBars/RpiLedBars/backend/.build")
set(CPACK_CMAKE_GENERATOR "Unix Makefiles")
set(CPACK_COMPONENTS_ALL "")
set(CPACK_COMPONENT_UNSPECIFIED_HIDDEN "TRUE")
set(CPACK_COMPONENT_UNSPECIFIED_REQUIRED "TRUE")
set(CPACK_DEFAULT_PACKAGE_DESCRIPTION_FILE "/usr/share/cmake-3.16/Templates/CPack.GenericDescription.txt")
set(CPACK_GENERATOR "TBZ2;TGZ;TXZ;TZ")
set(CPACK_IGNORE_FILES "/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/build;/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/cmake-build-debug;/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/pack;/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/.idea;/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/.DS_Store;/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/.git;/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/.vscode")
set(CPACK_INSTALLED_DIRECTORIES "/home/paquito/Projects/LedBars/RpiLedBars/backend;/")
set(CPACK_INSTALL_CMAKE_PROJECTS "")
set(CPACK_INSTALL_PREFIX "/usr/local")
set(CPACK_MODULE_PATH "")
set(CPACK_NSIS_DISPLAY_NAME "json-c 0.16.99")
set(CPACK_NSIS_INSTALLER_ICON_CODE "")
set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
set(CPACK_NSIS_PACKAGE_NAME "json-c 0.16.99")
set(CPACK_OUTPUT_CONFIG_FILE "/home/paquito/Projects/LedBars/RpiLedBars/backend/.build/CPackConfig.cmake")
set(CPACK_PACKAGE_DEFAULT_LOCATION "/")
set(CPACK_PACKAGE_DESCRIPTION_FILE "/usr/share/cmake-3.16/Templates/CPack.GenericDescription.txt")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "RpiLedBars built using CMake")
set(CPACK_PACKAGE_FILE_NAME "json-c-0.16.99-Source")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "json-c 0.16.99")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "json-c 0.16.99")
set(CPACK_PACKAGE_NAME "json-c")
set(CPACK_PACKAGE_RELOCATABLE "true")
set(CPACK_PACKAGE_VENDOR "Humanity")
set(CPACK_PACKAGE_VERSION "0.16.99")
set(CPACK_PACKAGE_VERSION_MAJOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "16")
set(CPACK_PACKAGE_VERSION_PATCH "99")
set(CPACK_RESOURCE_FILE_LICENSE "/usr/share/cmake-3.16/Templates/CPack.GenericLicense.txt")
set(CPACK_RESOURCE_FILE_README "/usr/share/cmake-3.16/Templates/CPack.GenericDescription.txt")
set(CPACK_RESOURCE_FILE_WELCOME "/usr/share/cmake-3.16/Templates/CPack.GenericWelcome.txt")
set(CPACK_RPM_PACKAGE_SOURCES "ON")
set(CPACK_SET_DESTDIR "OFF")
set(CPACK_SOURCE_7Z "")
set(CPACK_SOURCE_CYGWIN "")
set(CPACK_SOURCE_GENERATOR "TBZ2;TGZ;TXZ;TZ")
set(CPACK_SOURCE_IGNORE_FILES "/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/build;/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/cmake-build-debug;/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/pack;/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/.idea;/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/.DS_Store;/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/.git;/mnt/c/Users/Paquito/Projects/LedBars/RpiLedBars/backend/.build/_deps/json-c-src/.vscode")
set(CPACK_SOURCE_INSTALLED_DIRECTORIES "/home/paquito/Projects/LedBars/RpiLedBars/backend;/")
set(CPACK_SOURCE_OUTPUT_CONFIG_FILE "/home/paquito/Projects/LedBars/RpiLedBars/backend/.build/CPackSourceConfig.cmake")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "json-c-0.16.99-Source")
set(CPACK_SOURCE_RPM "OFF")
set(CPACK_SOURCE_TBZ2 "ON")
set(CPACK_SOURCE_TGZ "ON")
set(CPACK_SOURCE_TOPLEVEL_TAG "Linux-Source")
set(CPACK_SOURCE_TXZ "ON")
set(CPACK_SOURCE_TZ "ON")
set(CPACK_SOURCE_ZIP "OFF")
set(CPACK_STRIP_FILES "")
set(CPACK_SYSTEM_NAME "Linux")
set(CPACK_TOPLEVEL_TAG "Linux-Source")
set(CPACK_WIX_SIZEOF_VOID_P "8")
if(NOT CPACK_PROPERTIES_FILE)
set(CPACK_PROPERTIES_FILE "/home/paquito/Projects/LedBars/RpiLedBars/backend/.build/CPackProperties.cmake")
endif()
if(EXISTS ${CPACK_PROPERTIES_FILE})
include(${CPACK_PROPERTIES_FILE})
endif()

View File

@ -5,8 +5,9 @@ project(RpiLedBars VERSION 0.5 LANGUAGES C)
set(CMAKE_C_STANDARD 99)
add_subdirectory(src)
add_subdirectory(libs)
configure_file(cava_config ../ COPYONLY)
configure_file(cava_config src/ COPYONLY)
add_subdirectory(src)

View File

@ -19,11 +19,18 @@ sudo pip3 install --upgrade adafruit-python-shell
~~~
#### Build and install module
OLD OS <= buster
~~~bash
cd /tmp
sudo wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/i2smic.py
sudo python3 i2smic.py
~~~
New os
Edit `sudo nano /boot/firmware/config.txt` to add
~~~
dtoverlay=googlevoicehat-soundcard
~~~
After a kernel update this step as to be executed again (after reboot -> depends on `uname`)
@ -48,14 +55,24 @@ cp res/.asoundrc ~/.asoundrc
### Project depenencies
~~~bash
sudo apt install libasound2-dev wiringpi
sudo apt install cmake libasound2-dev
~~~
#### WiringPi
~~~bash
(
cd /tmp
wget https://github.com/WiringPi/WiringPi/releases/download/3.6/wiringpi_3.6_armhf.deb
sudo apt install /tmp/wiringpi_3.6_armhf.deb
)
~~~
#### Cava
~~~bash
sudo apt install libfftw3-dev libasound2-dev libtool automake
cd cava_
sudo apt install libfftw3-dev libasound2-dev libtool automake git
git clone https://github.com/karlstav/cava.git
cd cava
./autogen.sh
./configure
make

View File

@ -0,0 +1,3 @@
#! /usr/bin/env bash
cmake -B .build && cmake --build .build

View File

@ -1,5 +1,8 @@
#! /usr/bin/env bash
# make
install -v -D ../build/src/RpiLedBars cava_config -t /opt/pixled/
sudo -s install -v -D ./build/src cava_config -t /opt/pixled/
sudo -s install -v -D ./build/src RpiLedBars -t /opt/pixled/
# cp ./bin/pixled bin/service_pixled
sudo -s bash -c "cp pixled.service /etc/systemd/system; systemctl daemon-reload"
# sudo -s bash -c "systemctl enable pixled"

View File

@ -1,6 +1,9 @@
include(FetchContent)
set(FETCHCONTENT_FULLY_DISCONNECTED ON)
#set(FETCHCONTENT_FULLY_DISCONNECTED ON)
# set(BUILD_SHARED_LIBS off)
# set(ENABLE_CJSON_TEST off)
FetchContent_Declare(
logc
@ -12,5 +15,10 @@ FetchContent_Declare(
GIT_REPOSITORY "https://github.com/Tropicananass/wsServer.git"
)
# FetchContent_Declare(
# cjson
# GIT_REPOSITORY "https://github.com/DaveGamble/cJSON.git"
# )
# add the log.c and ws libraries
FetchContent_MakeAvailable(logc ws)

View File

@ -0,0 +1,6 @@
#! /usr/bin/env bash
sudo -s bash -c "systemctl stop pixled"
cd '.build/src/' || exit 1
chmod u+x ./RpiLedBars
sudo ./RpiLedBars -n 60 -d 1

View File

@ -137,40 +137,48 @@ int main(int argc, char const *argv[]) {
**************************************************************************************************/
void parseCommandLineArgs(int argc, char const *argv[]) {
int args = 0;
int argIt = 0;
while (argc > ++args) // Process command-line args
while (argc > ++argIt) // Process command-line args
{
if (argv[args][0] == '-') {
switch (toupper(argv[args][1])) {
if (argv[argIt][0] == '-' && argv[argIt][2] == '\0') {
switch (toupper(argv[argIt][1])) {
case 'N': // -N: number of LEDs per channel
if (args >= argc - 1) {
if (argIt >= argc - 1) {
log_error("no numeric value");
exit(-EXIT_FAILURE);
} else {
param_access->pixled.chanLedCount = atoi(argv[++args]);
int ledCount = atoi(argv[++argIt]);
param_access->pixled.chanLedCount = ledCount <= CHAN_MAXLEDS ? ledCount : CHAN_MAXLEDS;
}
break;
case 'D': // -D: debug level
if (args >= argc - 1) {
if (argIt >= argc - 1) {
log_error("no debug level");
exit(-EXIT_FAILURE);
} else {
logLevel = atoi(argv[++args]);
logLevel = atoi(argv[++argIt]);
log_set_level(logLevel);
}
break;
case 'T': // -T: test mode
IsTestMode = true;
break;
default: // Otherwise error
log_error("Unrecognised option '%c'\n", argv[args][1]);
fprintf(stderr, "Options:\n"
" -t Test mode (flash LEDs)\n"
" -n num number of LEDs per channel\n"
" -d lvl debug level\n");
log_error("Unknown option '%c'\n", argv[argIt][1]);
fprintf(stderr,
"Options:\n"
" -t Test mode (flash LEDs)\n"
" -n num number of LEDs per channel (max : %d)\n"
" -d lvl debug level\n",
CHAN_MAXLEDS);
exit(-EXIT_FAILURE);
}
} else {
log_warn("Unknown option '%s'\n", argv[argIt]);
}
}
}
@ -288,10 +296,10 @@ void execute_autonomous_mode() {
if ((ret = cava_get_buffer(&buffer)) == 0) {
switch (param_access->auton.pattern) {
case 0:
bounce_led_and_color(buffer, CAVA_BAR_NUMBER);
bounce_led(buffer, CAVA_BAR_NUMBER);
break;
case 1:
bounce_led(buffer, CAVA_BAR_NUMBER);
bounce_led_and_color(buffer, CAVA_BAR_NUMBER);
break;
case 2:
bounce_led_and_travel(buffer, CAVA_BAR_NUMBER);

View File

@ -43,6 +43,7 @@ ledbar_param_t const dummyLedbarParam = {.sensitivity = 1.,
**************************************************************************************************/
param_t param;
param_t *param_access = NULL;
pthread_mutex_t paramLockMutex = PTHREAD_MUTEX_INITIALIZER;

View File

@ -54,7 +54,10 @@ typedef struct {
} auton_param_t;
/**
* @brief
*
* @var ledbar_param_t::sensitivity
* sensitivity of the led bar
*/
typedef struct {
float sensitivity;
@ -81,7 +84,7 @@ typedef struct {
* Global Variables
**************************************************************************************************/
param_t *param_access;
extern param_t *param_access;
/***************************************************************************************************
* External Function Prototypes
@ -89,56 +92,92 @@ param_t *param_access;
/**
* @brief
*
*/
void param_setup();
/**
* @brief
* @brief Set the mode object
*
* @param[in] mode
*/
void set_mode(unsigned int mode);
/**
* @brief
* @brief Set the pattern object
*
* @param[in] pattern
*/
void set_pattern(unsigned int pattern);
/**
* @brief
* @brief Set the hue auto shift object
*
* @param[in] HasToBeEnabled
*/
void set_hue_auto_shift(bool HasToBeEnabled);
/**
* @brief
* @brief Set the gravity object
*
* @param[in] gravity8
*/
void set_gravity(int8_t gravity8);
/**
* @brief
* @brief Set the sensitivity object
*
* @param[in] channel
*
* @param[in] sensitivity8
*/
void set_sensitivity(int channel, int8_t sensitivity8);
/**
* @brief Set the hue base object
*
* @param[in] channel
* @param[in] hueBase8
*/
void set_hue_base(int channel, int8_t hueBase8);
/**
* @brief Set the hue interval object
*
* @param[in] channel
* @param[in] hueInterval8
*/
void set_hue_interval(int channel, int8_t hueInterval8);
/**
* @brief Set the hue auto shift interval object
*
* @param[in] channel
* @param[in] hueInterval8
*/
void set_hue_auto_shift_interval(int channel, int8_t hueInterval8);
/**
* @brief Set the hue auto shift speed object
*
* @param[in] channel
* @param[in] hueSpeed8
*/
void set_hue_auto_shift_speed(int channel, int8_t hueSpeed8);
/**
* @brief Set the luminosity object
*
* @param[in] channel
* @param[in] luminosity8
*/
void set_luminosity(int channel, int8_t luminosity8);
/**
* @brief Set the saturation object
*
* @param[in] channel
* @param[in] saturation8
*/
void set_saturation(int channel, int8_t saturation8);
#endif /* __RPI_PARAM_H__ */

View File

@ -51,51 +51,64 @@ int baseLedIndexArray[LED_NCHANS];
* Internal Function Prototypes
**************************************************************************************************/
/**
* @brief Get the max on interval object
*
* @param array
* @param length
* @param intervalMin
* @param intervalSize
* @return uint16_t
*/
uint16_t get_max_on_interval(uint16_t *array, unsigned int length, size_t intervalMin,
size_t intervalSize);
/**
* @brief
*
* @param value
* @param valueIndex
* @return uint16_t
*/
uint16_t apply_sensitivity(uint16_t value, unsigned int valueIndex);
/**
* @brief Get the led to light count object
*
* @param barValue
* @param barIndex
* @return unsigned int
*/
unsigned int get_led_to_light_count(uint16_t barValue, unsigned int barIndex);
/**
* @brief Get the first led to light object
*
* @param barIndex
* @return unsigned int
*/
unsigned int get_first_led_to_light(unsigned int barIndex);
/**
* @brief Get the hsv color object
*
* @param barIndex
* @param shiftRatio
* @return uint32_t
*/
uint32_t get_hsv_color(unsigned int barIndex, float shiftRatio);
/**
* @brief
*
* @param barIndex
*/
void increment_autoshift(unsigned int barIndex);
/***************************************************************************************************
* External Function Definitions
**************************************************************************************************/
void bounce_led_and_color(uint16_t *spectrumArray, unsigned int spectrumLength) {
for (size_t ledBarIndex = 0; ledBarIndex < LED_NCHANS; ++ledBarIndex) {
size_t intervalSize = spectrumLength / LED_NCHANS;
uint16_t barMax = 0;
unsigned int ledToLightCount = 0;
barMax = get_max_on_interval(spectrumArray, spectrumLength, ledBarIndex * intervalSize,
intervalSize);
barMax = apply_sensitivity(barMax, ledBarIndex);
ledToLightCount = get_led_to_light_count(barMax, ledBarIndex);
uint32_t color = get_hsv_color(ledBarIndex, (ledToLightCount - 1) /
(float)param_access->pixled.chanLedCount);
for (size_t i = 0; i < ledToLightCount; ++i) {
rgbData[i][ledBarIndex] = color;
rgb_txdata(rgbData[i], i);
}
for (size_t i = ledToLightCount; i < param_access->pixled.chanLedCount; ++i) {
rgbData[i][ledBarIndex] = 0x000000;
rgb_txdata(rgbData[i], i);
}
increment_autoshift(ledBarIndex);
}
leddriver_refresh();
}
void bounce_led(uint16_t *spectrumArray, unsigned int spectrumLength) {
for (size_t ledBarIndex = 0; ledBarIndex < LED_NCHANS; ++ledBarIndex) {
size_t intervalSize = spectrumLength / LED_NCHANS;
@ -124,6 +137,34 @@ void bounce_led(uint16_t *spectrumArray, unsigned int spectrumLength) {
leddriver_refresh();
}
void bounce_led_and_color(uint16_t *spectrumArray, unsigned int spectrumLength) {
for (size_t ledBarIndex = 0; ledBarIndex < LED_NCHANS; ++ledBarIndex) {
size_t intervalSize = spectrumLength / LED_NCHANS;
uint16_t barMax = 0;
unsigned int ledToLightCount = 0;
barMax = get_max_on_interval(spectrumArray, spectrumLength, ledBarIndex * intervalSize,
intervalSize);
barMax = apply_sensitivity(barMax, ledBarIndex);
ledToLightCount = get_led_to_light_count(barMax, ledBarIndex);
uint32_t color = get_hsv_color(ledBarIndex, (ledToLightCount - 1) /
(float)param_access->pixled.chanLedCount);
for (size_t i = 0; i < ledToLightCount; ++i) {
rgbData[i][ledBarIndex] = color;
rgb_txdata(rgbData[i], i);
}
for (size_t i = ledToLightCount; i < param_access->pixled.chanLedCount; ++i) {
rgbData[i][ledBarIndex] = 0x000000;
rgb_txdata(rgbData[i], i);
}
increment_autoshift(ledBarIndex);
}
leddriver_refresh();
}
void bounce_led_and_travel(uint16_t *spectrumArray, unsigned int spectrumLength) {
for (size_t ledBarIndex = 0; ledBarIndex < LED_NCHANS; ++ledBarIndex) {
size_t intervalSize = spectrumLength / LED_NCHANS;

View File

@ -31,16 +31,6 @@
* @brief
*
* @param[in] spectrumArray array of value from spectral analysis
*
* @param[in] spectrumLength length of spectrum array
*/
void bounce_led_and_color(uint16_t *spectrumArray, unsigned int spectrumLength);
/**
* @brief
*
* @param[in] spectrumArray array of value from spectral analysis
*
* @param[in] spectrumLength length of spectrum array
*/
void bounce_led(uint16_t *spectrumArray, unsigned int spectrumLength);
@ -49,7 +39,14 @@ void bounce_led(uint16_t *spectrumArray, unsigned int spectrumLength);
* @brief
*
* @param[in] spectrumArray array of value from spectral analysis
* @param[in] spectrumLength length of spectrum array
*/
void bounce_led_and_color(uint16_t *spectrumArray, unsigned int spectrumLength);
/**
* @brief
*
* @param[in] spectrumArray array of value from spectral analysis
* @param[in] spectrumLength length of spectrum array
*/
void bounce_led_and_travel(uint16_t *spectrumArray, unsigned int spectrumLength);

View File

@ -34,7 +34,7 @@
int client_fd = -1;
int channel = LED_NCHANS;
int current_channel = LED_NCHANS;
/***************************************************************************************************
* Internal Function Prototypes
@ -73,18 +73,74 @@ void onclose(int fd);
*/
void onmessage(int fd, const unsigned char *msg, uint64_t size, int type);
void mode_command_handler(char *payload);
/**
* @brief
*
* @param payload
*/
void mode_command_handler(const char *payload);
void pattern_command_handler(char *payload);
/**
* @brief
*
* @param payload
*/
void pattern_command_handler(const char *payload);
/**
* @brief
*
* @param payload
*/
void color_command_handler(char *payload);
/**
* @brief
*
* @param payload
*/
void hue_interval_command_handler(char *payload);
/**
* @brief
*
* @param payload
*/
void modulate_command_handler(char *payload);
void channel_command_handler(char *payload);
/**
* @brief
*
* @param payload
*/
void modulation_interval_command_handler(char *payload);
/**
* @brief
*
* @param payload
*/
void modulation_speed_command_handler(char *payload);
/**
* @brief
*
* @param payload
*/
void channel_command_handler(const char *payload);
/**
* @brief
*
* @param payload
*/
void sensitivity_command_handler(char *payload);
/**
* @brief
*
* @param payload
*/
void gravity_command_handler(char *payload);
/***************************************************************************************************
@ -130,45 +186,65 @@ void onclose(int fd) {
client_fd = -1;
}
#define FOREACH_CMD(FNCT) \
FNCT(mode) \
FNCT(pattern) \
FNCT(channel)
#define GENERATE_SWITCH(CASE) \
if (!strcmp(command, #CASE)) { \
CASE##_command_handler(payload); \
} else
void onmessage(int fd, const unsigned char *msg, uint64_t size, int type) {
char msgStr[size + 1];
char *command, *payload;
char *cli = ws_getaddress(fd);
log_trace("Received message: %s (size: %" PRId64 ", type: %d), from: %s/%d", msg, size, type, cli,
fd);
strcpy(msgStr, (char *)msg);
command = strtok(msgStr, ":");
if (command != NULL) {
payload = strtok(NULL, ":");
if (payload != NULL && strlen(command) == 1) {
switch (command[0]) {
case 'm':
mode_command_handler(payload);
break;
case 'p':
pattern_command_handler(payload);
break;
case 'c':
color_command_handler(payload);
break;
case 's':
modulate_command_handler(payload);
break;
case 'h':
channel_command_handler(payload);
break;
case 'e':
sensitivity_command_handler(payload);
break;
case 'g':
gravity_command_handler(payload);
break;
if (payload != NULL) {
default:
log_warn("Unkown command in \"%s\"", msgStr);
break;
}
FOREACH_CMD(GENERATE_SWITCH) log_warn("Unkown command %s in \"%s\"", command, msg);
// switch (command[0]) {
// case 'm':
// mode_command_handler(payload);
// break;
// case 'p':
// pattern_command_handler(payload);
// break;
// case 'i':
// hue_interval_command_handler(payload);
// break;
// case 'c':
// color_command_handler(payload);
// break;
// case 's':
// modulate_command_handler(payload);
// break;
// case 't':
// modulation_interval_command_handler(payload);
// break;
// case 'u':
// modulation_speed_command_handler(payload);
// break;
// case 'h':
// channel_command_handler(payload);
// break;
// case 'e':
// sensitivity_command_handler(payload);
// break;
// case 'g':
// gravity_command_handler(payload);
// break;
// default:
// log_warn("Unkown command in \"%s\"", msgStr);
// break;
// }
} else {
log_warn("Empty payload in \"%s\"", msgStr);
}
@ -179,7 +255,7 @@ void onmessage(int fd, const unsigned char *msg, uint64_t size, int type) {
free(cli);
}
void mode_command_handler(char *payload) {
void mode_command_handler(const char *payload) {
int newMode = atoi(payload);
if (0 <= newMode && newMode <= 3) {
set_mode(newMode);
@ -188,7 +264,7 @@ void mode_command_handler(char *payload) {
}
}
void pattern_command_handler(char *payload) {
void pattern_command_handler(const char *payload) {
int newPattern = atoi(payload);
if (0 <= newPattern && newPattern <= 3) {
set_pattern(newPattern);
@ -209,15 +285,18 @@ void color_command_handler(char *payload) {
log_debug(" - %s", tokenArray[n]);
}
if (atoi(tokenArray[0]) == 0) {
set_hue_base(channel, atoi(tokenArray[1]) * INT8_MAX / HUE_MAX);
set_saturation(channel, atoi(tokenArray[2]) * INT8_MAX / 100);
set_luminosity(channel, atoi(tokenArray[3]) * INT8_MAX / 100);
} else {
set_saturation(channel, atoi(tokenArray[2]) * INT8_MAX / 100);
set_luminosity(channel, atoi(tokenArray[3]) * INT8_MAX / 100);
set_hue_base(current_channel, atoi(tokenArray[1]) * INT8_MAX / HUE_MAX);
set_saturation(current_channel, atoi(tokenArray[2]) * INT8_MAX / 100);
set_luminosity(current_channel, atoi(tokenArray[3]) * INT8_MAX / 100);
}
}
void hue_interval_command_handler(char *payload) {
int hueInterval = atoi(payload);
log_debug("hueInterval: %d", hueInterval);
set_hue_interval(current_channel, hueInterval);
}
void modulate_command_handler(char *payload) {
bool modulate;
modulate = strcmp(payload, "true") == 0;
@ -225,17 +304,27 @@ void modulate_command_handler(char *payload) {
set_hue_auto_shift(modulate);
}
void channel_command_handler(char *payload) {
void modulation_interval_command_handler(char *payload) {
int modulationInterval = atoi(payload);
set_hue_auto_shift_interval(8, modulationInterval);
}
void modulation_speed_command_handler(char *payload) {
int modulationSpeed = atoi(payload);
set_hue_auto_shift_speed(8, modulationSpeed);
}
void channel_command_handler(const char *payload) {
int newChannel = atoi(payload);
if (0 <= newChannel && newChannel <= LED_NCHANS) {
log_debug("Channel: %d", newChannel);
channel = newChannel;
current_channel = newChannel;
}
}
void sensitivity_command_handler(char *payload) {
int newSensitivity = atoi(payload);
set_sensitivity(channel, newSensitivity);
set_sensitivity(current_channel, newSensitivity);
}
void gravity_command_handler(char *payload) {

View File

@ -0,0 +1,2 @@
#! /usr/bin/env bash

View File

@ -28,16 +28,23 @@ server {
server_name _;
location / {
root /home/pi/LedBars/RpiLedBars/frontend/webapp/dist;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
root /home/pi/RpiLedBars/frontend/web/;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location /old/ {
alias /home/pi/LedBars/RpiLedBars/frontend/web/;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
alias /home/pi/RpiLedBars/frontend/web/;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ index.html =404;
}
location /dev/ {
alias /home/pi/LedBars/RpiLedBars/frontend/webapp/dist;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ index.html =404;
}
}

View File

@ -20,7 +20,8 @@
<body class="bg-dark text-white">
<!-- Modal -->
<div class="modal fade text-black" id="reconnectBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="connectionLostLabel" aria-hidden="true">
<div class="modal fade text-black" id="reconnectBackdrop" data-bs-backdrop="static" data-bs-keyboard="false"
tabindex="-1" aria-labelledby="connectionLostLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
@ -31,9 +32,10 @@
Try reconnecting in <span id="time-left">60s</span>
</div>
<form id="ws-input" class="btn-group" role="group" aria-label="Select ws">
<input type="radio" class="btn-check" name="ws-selection" id="hotspot-ws" autocomplete="off" value="0" checked>
<input type="radio" class="btn-check" name="ws-selection" id="local-ws" autocomplete="off" value="1">
<input type="radio" class="btn-check" name="ws-selection" id="distant-ws" autocomplete="off" value="2">
<input type="radio" class="btn-check" name="ws-selection" id="hotspot-ws" autocomplete="off"
checked>
<input type="radio" class="btn-check" name="ws-selection" id="local-ws" autocomplete="off">
<input type="radio" class="btn-check" name="ws-selection" id="distant-ws" autocomplete="off">
</form>
<div class="modal-footer">
<button type="button" class="btn btn-primary" onclick="{timeout=1;}">Reconnect now</button>
@ -50,17 +52,23 @@
<div class="row pt-2 gy-2">
<div class="col d-flex justify-content-center">
<form id="mode-input" class="btn-group" role="group" aria-label="Select mode">
<input type="radio" class="btn-check" name="mode-selection" id="test-mode" autocomplete="off" value="0" checked>
<input type="radio" class="btn-check" name="mode-selection" id="artnet-mode" autocomplete="off" value="1">
<input type="radio" class="btn-check" name="mode-selection" id="auto-mode" autocomplete="off" value="2">
<input type="radio" class="btn-check" name="mode-selection" id="manual-mode" autocomplete="off" value="3">
<input type="radio" class="btn-check" name="mode-selection" id="test-mode" autocomplete="off"
checked>
<input type="radio" class="btn-check" name="mode-selection" id="artnet-mode" autocomplete="off">
<input type="radio" class="btn-check" name="mode-selection" id="auto-mode" autocomplete="off">
<input type="radio" class="btn-check" name="mode-selection" id="manual-mode" autocomplete="off">
</form>
</div>
<div class="col d-flex justify-content-center">
<form id="pattern-input" class="btn-group" role="group" aria-label="Select pattern">
<input type="radio" class="btn-check" name="pattern-selection" id="pulse-pattern" autocomplete="off" value="0" checked>
<input type="radio" class="btn-check" name="pattern-selection" id="travel-pattern" autocomplete="off" value="1">
<input type="radio" class="btn-check" name="pattern-selection" id="strobe-pattern" autocomplete="off" value="2">
<input type="radio" class="btn-check" name="pattern-selection" id="bounce-pattern"
autocomplete="off" checked>
<input type="radio" class="btn-check" name="pattern-selection" id="pulse-pattern"
autocomplete="off">
<input type="radio" class="btn-check" name="pattern-selection" id="travel-pattern"
autocomplete="off">
<input type="radio" class="btn-check" name="pattern-selection" id="strobe-pattern"
autocomplete="off">
</form>
</div>
</div>
@ -77,15 +85,16 @@
<div class="col d-flex justify-content-center">
<form id="channel-input" class="btn-group" role="group" aria-label="Select channel">
<!-- todo: Change to checkbox -->
<input type="radio" class="btn-check" name="channel-selection" id="all-channel" autocomplete="off" value="8" checked>
<input type="radio" class="btn-check" name="channel-selection" id="0-channel" autocomplete="off" value="0">
<input type="radio" class="btn-check" name="channel-selection" id="1-channel" autocomplete="off" value="1">
<input type="radio" class="btn-check" name="channel-selection" id="2-channel" autocomplete="off" value="2">
<input type="radio" class="btn-check" name="channel-selection" id="3-channel" autocomplete="off" value="3">
<input type="radio" class="btn-check" name="channel-selection" id="4-channel" autocomplete="off" value="4">
<input type="radio" class="btn-check" name="channel-selection" id="5-channel" autocomplete="off" value="5">
<input type="radio" class="btn-check" name="channel-selection" id="6-channel" autocomplete="off" value="6">
<input type="radio" class="btn-check" name="channel-selection" id="7-channel" autocomplete="off" value="7">
<input type="radio" class="btn-check" name="channel-selection" id="0-channel" autocomplete="off">
<input type="radio" class="btn-check" name="channel-selection" id="1-channel" autocomplete="off">
<input type="radio" class="btn-check" name="channel-selection" id="2-channel" autocomplete="off">
<input type="radio" class="btn-check" name="channel-selection" id="3-channel" autocomplete="off">
<input type="radio" class="btn-check" name="channel-selection" id="4-channel" autocomplete="off">
<input type="radio" class="btn-check" name="channel-selection" id="5-channel" autocomplete="off">
<input type="radio" class="btn-check" name="channel-selection" id="6-channel" autocomplete="off">
<input type="radio" class="btn-check" name="channel-selection" id="7-channel" autocomplete="off">
<input type="radio" class="btn-check" name="channel-selection" id="all-channel" autocomplete="off"
checked>
</form>
</div>
</div>
@ -94,7 +103,8 @@
<label class="form-label col-9 col-sm-2 text-sm-end" for="formControlRange">Sensitivity</label>
<span class="col-3 col-sm-1 text-end">64</span>
<div class="col col-sm-9">
<input type="range" class="form-range" id="formControlRange" max="127" oninput="sensitivityCallback(this)">
<input type="range" class="form-range" id="formControlRange" max="127"
oninput="sensitivityCallback(this)">
</div>
</div>
@ -102,15 +112,25 @@
<label class="form-label col-9 col-sm-2 text-sm-end" for="formControlRange">Gravity</label>
<span class="col-3 col-sm-1 text-end">64</span>
<div class="col col-sm-9">
<input type="range" class="form-range col-auto" id="formControlRange" max="127" oninput="gravityCallback(this)">
<input type="range" class="form-range col-auto" id="formControlRange" max="127"
oninput="gravityCallback(this)">
</div>
</div>
<div class="row pt-2 gy-2">
<label class="form-label col-9 col-sm-2 text-sm-end" for="formControlRange">Hue interval</label>
<span class="col-3 col-sm-1 text-end">0</span>
<div class="col col-sm-9">
<input type="range" class="form-range col-auto" id="formControlRange" min="-63" max="63"
oninput="hueIntervalCallback(this)">
</div>
</div>
<div class="row pt-2 gy-2">
<div class="col">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="modulateColor" onclick="colorModulateCallback(this)">
<input class="form-check-input" type="checkbox" id="modulateColor"
onclick="colorModulateCallback(this)">
<label class="form-check-label" for="modulateColor">Modulate color</label>
</div>
</div>
@ -118,20 +138,29 @@
<div class="row pt-2 gy-2">
<div id="mainPicker" class="col d-flex justify-content-center"></div>
<div id="modulationPicker" class="col d-none d-flex justify-content-center"></div>
</div>
<div class="row pt-2 gy-2">
<label class="form-label col-9 col-sm-2 text-sm-end" for="formControlRange">Modulation interval</label>
<span class="col-3 col-sm-1 text-end">0</span>
<div class="col col-sm-9">
<input type="range" class="form-range col-auto" id="formControlRange" min="-63" max="63"
oninput="modulationIntervalCallback(this)">
</div>
</div>
<div class="row pt-2 gy-2">
<label class="form-label col-9 col-sm-2 text-sm-end" for="formControlRange">Modulation speed</label>
<span class="col-3 col-sm-auto text-end" id="rangeval">50</span>
<span class="col-3 col-sm-1 text-end" id="rangeval">50</span>
<div class="col col-sm-9">
<input type="range" class="form-range col-auto" id="formControlRange" oninput="rangeCallback(this)">
<input type="range" class="form-range col-auto" id="formControlRange" max="127"
oninput="modulationSpeedCallback(this)">
</div>
</div>
<div class="row pt-2 gy-2">
<label class="form-label col-9 col-sm-2 text-sm-end" for="formControlRange">Freq</label>
<span class="col-3 col-sm-auto text-end" id="rangeval">50</span>
<span class="col-3 col-sm-1 text-end" id="rangeval">50</span>
<div class="col col-sm-9">
<input type="range" class="form-range col-auto" id="formControlRange" oninput="rangeCallback(this)">
</div>

View File

@ -17,21 +17,21 @@ function addLabelAndListener(name, callback) {
label.classList.add("text-capitalize");
label.setAttribute("for", element.id);
labelText = element.id.split('-')[0];
element.value = inputIndex;
label.innerHTML = labelText;
element.insertAdjacentElement("afterend", label);
}
}
addLabelAndListener("ws", wsSelectCallback);
addLabelAndListener("mode", modeSelectCallback);
addLabelAndListener("pattern", patternSelectCallback);
addLabelAndListener("channel", channelSelectCallback);
addLabelAndListener("ws", buttonSelectCallback);
addLabelAndListener("mode", buttonSelectCallback);
addLabelAndListener("pattern", buttonSelectCallback);
addLabelAndListener("channel", buttonSelectCallback);
// addLabelAndListener("channelGlobal", channelSelectCallback);
var colorPicker = new iro.ColorPicker('#mainPicker', {
colors: [
'hsl(0, 100, 50)', // pure red
'hsl(180, 50, 100)' // pure green
],
layout: [{
component: iro.ui.Wheel,
@ -51,28 +51,28 @@ var colorPicker = new iro.ColorPicker('#mainPicker', {
handleRadius: 14
});
var modulationPicker = new iro.ColorPicker('#modulationPicker', {
colors: [
'hsl(0, 100, 50)', // pure red
],
layout: [{
component: iro.ui.Wheel,
options: {
wheelLightness: false
}
}, {
component: iro.ui.Slider,
options: {
sliderType: 'value'
}
}],
layoutDirection: 'horizontal',
// display: "flex",
width: 250,
margin: 0,
handleRadius: 14
});
// var modulationPicker = new iro.ColorPicker('#modulationPicker', {
// colors: [
// 'hsl(0, 100, 50)', // pure red
// ],
// layout: [{
// component: iro.ui.Wheel,
// options: {
// wheelLightness: false
// }
// }, {
// component: iro.ui.Slider,
// options: {
// sliderType: 'value'
// }
// }],
// layoutDirection: 'horizontal',
// // display: "flex",
// width: 250,
// margin: 0,
// handleRadius: 14
// });
reconnect();
colorPicker.on("color:change", colorChangeCallback);
modulationPicker.on("color:change", modulationColorChangeCallback);
// modulationPicker.on("color:change", modulationColorChangeCallback);

View File

@ -11,24 +11,19 @@ function wait_reconnection() {
}
function reconnect() {
// for (i in ws_address_list) {
// console.log("try to connect " + ws_address_list[i])
// try {
socket = new WebSocket(ws_address_list[ws_index]);
// } catch (error) {
// console.error("failed to connect to " + ws_address_list[i] + "\n" + error);
// }
// }
// socket = new WebSocket("ws://192.168.1.130");
address = window.location.href.replace(/(http|https):\/\//i, "ws://")
address = address.slice(0, address.length - 1) + ":8080"
console.log("connecting to " + address)
socket = new WebSocket(address)
timeout = 60;
socket.onopen = function(e) {
socket.onopen = function (e) {
console.log("[open] ws: Connection established");
clearInterval(timer);
modal.hide();
};
socket.onmessage = function(event) {
socket.onmessage = function (event) {
console.log(`[message] ws: Data received from server: ${event.data}`);
let message = event.data.split(":");
let command = message[0];
@ -44,7 +39,7 @@ function reconnect() {
}
};
socket.onclose = function(event) {
socket.onclose = function (event) {
if (event.wasClean) {
console.log(`[close] ws: Connection closed cleanly, code=${event.code} reason=${event.reason}`);
} else {
@ -56,7 +51,7 @@ function reconnect() {
}
};
socket.onerror = function(error) {
socket.onerror = function (error) {
console.log(`[error] ws: ${error.message}`);
++ws_index;
if (ws_index >= ws_address_list.length) {

View File

@ -1,3 +1,5 @@
var eventd;
function wsSelectCallback(event) {
// todo: disable form on this != auto
if (event.target.nodeName == 'INPUT') {
@ -6,12 +8,14 @@ function wsSelectCallback(event) {
}
}
function modeSelectCallback(event) {
function buttonSelectCallback(event) {
// todo: disable form on this != auto
eventd = event
if (event.target.nodeName == 'INPUT') {
console.log("m:" + event.target.value);
newMode = event.target.parentElement.id.split('-')[0] + ":" + event.target.value
console.log(newMode);
if (socket.readyState == WebSocket.OPEN) {
socket.send("m:" + event.target.value);
socket.send(newMode);
}
}
}
@ -51,15 +55,21 @@ function gravityCallback(element) {
rangeCallback(element);
}
var eventd;
function hueIntervalCallback(element) {
console.log("i:" + (Number(element.value) + 63 + 1));
if (socket.readyState == WebSocket.OPEN) {
socket.send("i:" + (Number(element.value) + 63 + 1));
}
rangeCallback(element);
}
function colorModulateCallback(element) {
eventd = element;
if (element.checked) {
document.getElementById("modulationPicker").classList.remove("d-none");
} else {
document.getElementById("modulationPicker").classList.add("d-none");
}
// eventd = element;
// if (element.checked) {
// document.getElementById("modulationPicker").classList.remove("d-none");
// } else {
// document.getElementById("modulationPicker").classList.add("d-none");
// }
console.log("s: " + element.checked);
if (socket.readyState == WebSocket.OPEN) {
socket.send("s:" + element.checked);
@ -73,11 +83,20 @@ function colorChangeCallback(color) {
}
}
function modulationColorChangeCallback(color) {
console.log("c: " + (color.index + 2) + ", h: " + color.hsl.h + ", s: " + color.hsl.s + ", l: " + color.hsl.l + "}");
function modulationIntervalCallback(element) {
console.log("t:" + (Number(element.value) + 63 + 1));
if (socket.readyState == WebSocket.OPEN) {
socket.send("c:" + (color.index + 2) + "," + color.hsl.h + "," + color.hsl.s + "," + color.hsl.l);
socket.send("t:" + (Number(element.value) + 63 + 1));
}
rangeCallback(element);
}
function modulationSpeedCallback(element) {
console.log("u:" + element.value);
if (socket.readyState == WebSocket.OPEN) {
socket.send("u:" + element.value);
}
rangeCallback(element);
}
function rangeCallback(element) {

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,81 @@
{
"board": {
"active_layer": 0,
"active_layer_preset": "",
"auto_track_width": true,
"hidden_netclasses": [],
"hidden_nets": [],
"high_contrast_mode": 0,
"net_color_mode": 1,
"opacity": {
"images": 0.6,
"pads": 1.0,
"tracks": 1.0,
"vias": 1.0,
"zones": 0.6
},
"ratsnest_display_mode": 0,
"selection_filter": {
"dimensions": true,
"footprints": true,
"graphics": true,
"keepouts": true,
"lockedItems": true,
"otherItems": true,
"pads": true,
"text": true,
"tracks": true,
"vias": true,
"zones": true
},
"visible_items": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
32,
33,
34,
35,
36,
39,
40
],
"visible_layers": "fffffff_ffffffff",
"zone_display_mode": 0
},
"meta": {
"filename": "LedBarsHat.kicad_prl",
"version": 3
},
"project": {
"files": []
}
}

View File

@ -0,0 +1,699 @@
{
"board": {
"3dviewports": [],
"design_settings": {
"defaults": {
"board_outline_line_width": 0.09999999999999999,
"copper_line_width": 0.19999999999999998,
"copper_text_italic": false,
"copper_text_size_h": 1.5,
"copper_text_size_v": 1.5,
"copper_text_thickness": 0.3,
"copper_text_upright": false,
"courtyard_line_width": 0.049999999999999996,
"dimension_precision": 4,
"dimension_units": 3,
"dimensions": {
"arrow_length": 1270000,
"extension_offset": 500000,
"keep_text_aligned": true,
"suppress_zeroes": false,
"text_position": 0,
"units_format": 1
},
"fab_line_width": 0.09999999999999999,
"fab_text_italic": false,
"fab_text_size_h": 1.0,
"fab_text_size_v": 1.0,
"fab_text_thickness": 0.15,
"fab_text_upright": false,
"other_line_width": 0.09999999999999999,
"other_text_italic": false,
"other_text_size_h": 1.0,
"other_text_size_v": 1.0,
"other_text_thickness": 0.15,
"other_text_upright": false,
"pads": {
"drill": 0.762,
"height": 1.524,
"width": 1.524
},
"silk_line_width": 0.15,
"silk_text_italic": false,
"silk_text_size_h": 1.0,
"silk_text_size_v": 1.0,
"silk_text_thickness": 0.15,
"silk_text_upright": false,
"zones": {
"min_clearance": 0.508
}
},
"diff_pair_dimensions": [],
"drc_exclusions": [],
"meta": {
"filename": "board_design_settings.json",
"version": 2
},
"rule_severities": {
"annular_width": "error",
"clearance": "error",
"connection_width": "warning",
"copper_edge_clearance": "error",
"copper_sliver": "warning",
"courtyards_overlap": "error",
"diff_pair_gap_out_of_range": "error",
"diff_pair_uncoupled_length_too_long": "error",
"drill_out_of_range": "error",
"duplicate_footprints": "warning",
"extra_footprint": "warning",
"footprint": "error",
"footprint_type_mismatch": "ignore",
"hole_clearance": "error",
"hole_near_hole": "error",
"invalid_outline": "error",
"isolated_copper": "warning",
"item_on_disabled_layer": "error",
"items_not_allowed": "error",
"length_out_of_range": "error",
"lib_footprint_issues": "warning",
"lib_footprint_mismatch": "warning",
"malformed_courtyard": "error",
"microvia_drill_out_of_range": "error",
"missing_courtyard": "ignore",
"missing_footprint": "warning",
"net_conflict": "warning",
"npth_inside_courtyard": "ignore",
"padstack": "warning",
"pth_inside_courtyard": "ignore",
"shorting_items": "error",
"silk_edge_clearance": "warning",
"silk_over_copper": "warning",
"silk_overlap": "warning",
"skew_out_of_range": "error",
"solder_mask_bridge": "error",
"starved_thermal": "error",
"text_height": "warning",
"text_thickness": "warning",
"through_hole_pad_without_hole": "error",
"too_many_vias": "error",
"track_dangling": "warning",
"track_width": "error",
"tracks_crossing": "error",
"unconnected_items": "error",
"unresolved_variable": "error",
"via_dangling": "warning",
"zones_intersect": "error"
},
"rules": {
"max_error": 0.005,
"min_clearance": 0.0,
"min_connection": 0.0,
"min_copper_edge_clearance": 0.0,
"min_hole_clearance": 0.25,
"min_hole_to_hole": 0.25,
"min_microvia_diameter": 0.19999999999999998,
"min_microvia_drill": 0.09999999999999999,
"min_resolved_spokes": 2,
"min_silk_clearance": 0.0,
"min_text_height": 0.7999999999999999,
"min_text_thickness": 0.08,
"min_through_hole_diameter": 0.3,
"min_track_width": 0.19999999999999998,
"min_via_annular_width": 0.09999999999999999,
"min_via_diameter": 0.39999999999999997,
"solder_mask_to_copper_clearance": 0.0,
"use_height_for_length_calcs": true
},
"teardrop_options": [
{
"td_allow_use_two_tracks": true,
"td_curve_segcount": 5,
"td_on_pad_in_zone": false,
"td_onpadsmd": true,
"td_onroundshapesonly": false,
"td_ontrackend": false,
"td_onviapad": true
}
],
"teardrop_parameters": [
{
"td_curve_segcount": 0,
"td_height_ratio": 1.0,
"td_length_ratio": 0.5,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_target_name": "td_round_shape",
"td_width_to_size_filter_ratio": 0.9
},
{
"td_curve_segcount": 0,
"td_height_ratio": 1.0,
"td_length_ratio": 0.5,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_target_name": "td_rect_shape",
"td_width_to_size_filter_ratio": 0.9
},
{
"td_curve_segcount": 0,
"td_height_ratio": 1.0,
"td_length_ratio": 0.5,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_target_name": "td_track_end",
"td_width_to_size_filter_ratio": 0.9
}
],
"track_widths": [],
"via_dimensions": [],
"zones_allow_external_fillets": false,
"zones_use_no_outline": true
},
"layer_presets": [],
"viewports": []
},
"boards": [],
"cvpcb": {
"equivalence_files": []
},
"erc": {
"erc_exclusions": [],
"meta": {
"version": 0
},
"pin_map": [
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
1,
0,
1,
2
],
[
0,
1,
0,
0,
0,
0,
1,
1,
2,
1,
1,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2
],
[
1,
1,
1,
1,
1,
0,
1,
1,
1,
1,
1,
2
],
[
0,
0,
0,
1,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
1,
2,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
0,
2,
1,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
]
],
"rule_severities": {
"bus_definition_conflict": "error",
"bus_entry_needed": "error",
"bus_label_syntax": "error",
"bus_to_bus_conflict": "error",
"bus_to_net_conflict": "error",
"different_unit_footprint": "error",
"different_unit_net": "error",
"duplicate_reference": "error",
"duplicate_sheet_names": "error",
"extra_units": "error",
"global_label_dangling": "warning",
"hier_label_mismatch": "error",
"label_dangling": "error",
"lib_symbol_issues": "warning",
"multiple_net_names": "warning",
"net_not_bus_member": "warning",
"no_connect_connected": "warning",
"no_connect_dangling": "warning",
"pin_not_connected": "error",
"pin_not_driven": "error",
"pin_to_pin": "warning",
"power_pin_not_driven": "error",
"similar_labels": "warning",
"unannotated": "error",
"unit_value_mismatch": "error",
"unresolved_variable": "error",
"wire_dangling": "error"
}
},
"libraries": {
"pinned_footprint_libs": [],
"pinned_symbol_libs": []
},
"meta": {
"filename": "LedBarsHat.kicad_pro",
"version": 1
},
"net_settings": {
"classes": [
{
"bus_width": 12,
"clearance": 0.2,
"diff_pair_gap": 0.25,
"diff_pair_via_gap": 0.25,
"diff_pair_width": 0.2,
"line_style": 0,
"microvia_diameter": 0.3,
"microvia_drill": 0.1,
"name": "Default",
"pcb_color": "rgba(0, 0, 0, 0.000)",
"schematic_color": "rgba(0, 0, 0, 0.000)",
"track_width": 0.25,
"via_diameter": 0.8,
"via_drill": 0.4,
"wire_width": 6
}
],
"meta": {
"version": 3
},
"net_colors": null,
"netclass_assignments": null,
"netclass_patterns": [
{
"netclass": "Default",
"pattern": "+12V"
},
{
"netclass": "Default",
"pattern": "+3V3"
},
{
"netclass": "Default",
"pattern": "+5V"
},
{
"netclass": "Default",
"pattern": "/I2S_CLK"
},
{
"netclass": "Default",
"pattern": "/I2S_SD"
},
{
"netclass": "Default",
"pattern": "/I2S_WS"
},
{
"netclass": "Default",
"pattern": "/SEL_MODE0"
},
{
"netclass": "Default",
"pattern": "/SEL_MODE1"
},
{
"netclass": "Default",
"pattern": "/SEL_MODE2"
},
{
"netclass": "Default",
"pattern": "/SEL_MODE3"
},
{
"netclass": "Default",
"pattern": "/SMI_SD0"
},
{
"netclass": "Default",
"pattern": "/SMI_SD1"
},
{
"netclass": "Default",
"pattern": "/SMI_SD13"
},
{
"netclass": "Default",
"pattern": "/SMI_SD14"
},
{
"netclass": "Default",
"pattern": "/SMI_SD15"
},
{
"netclass": "Default",
"pattern": "/SMI_SD16"
},
{
"netclass": "Default",
"pattern": "/SMI_SD17"
},
{
"netclass": "Default",
"pattern": "/SMI_SD2"
},
{
"netclass": "Default",
"pattern": "/SMI_SD3"
},
{
"netclass": "Default",
"pattern": "/SMI_SD4"
},
{
"netclass": "Default",
"pattern": "/SMI_SD5"
},
{
"netclass": "Default",
"pattern": "/SMI_SD6"
},
{
"netclass": "Default",
"pattern": "/SMI_SD7"
},
{
"netclass": "Default",
"pattern": "/SMI_SD8"
},
{
"netclass": "Default",
"pattern": "/SMI_SD9"
},
{
"netclass": "Default",
"pattern": "GND"
},
{
"netclass": "Default",
"pattern": "Net-(J1-Pad13)"
},
{
"netclass": "Default",
"pattern": "Net-(J1-Pad26)"
},
{
"netclass": "Default",
"pattern": "Net-(J1-Pad27)"
},
{
"netclass": "Default",
"pattern": "Net-(J1-Pad28)"
},
{
"netclass": "Default",
"pattern": "Net-(J1-Pad3)"
},
{
"netclass": "Default",
"pattern": "Net-(J1-Pad5)"
},
{
"netclass": "Default",
"pattern": "Net-(J1-Pad7)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT1-Pad1)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT1-Pad2)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT1-Pad3)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT1-Pad4)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT1-Pad5)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT1-Pad6)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT1-Pad7)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT1-Pad8)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT2-Pad1)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT2-Pad2)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT2-Pad3)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT2-Pad4)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT2-Pad5)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT2-Pad6)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT2-Pad7)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT2-Pad8)"
},
{
"netclass": "Default",
"pattern": "Net-(OUT_5V1-Pad2)"
},
{
"netclass": "Default",
"pattern": "Net-(OUT_5V1-Pad3)"
},
{
"netclass": "Default",
"pattern": "Net-(OUT_5V1-Pad5)"
},
{
"netclass": "Default",
"pattern": "Net-(R1-Pad1)"
},
{
"netclass": "Default",
"pattern": "Net-(R2-Pad2)"
},
{
"netclass": "Default",
"pattern": "Net-(R3-Pad1)"
},
{
"netclass": "Default",
"pattern": "Net-(U1-Pad9)"
},
{
"netclass": "Default",
"pattern": "VCC"
}
]
},
"pcbnew": {
"last_paths": {
"gencad": "",
"idf": "",
"netlist": "",
"specctra_dsn": "",
"step": "",
"vrml": ""
},
"page_layout_descr_file": ""
},
"schematic": {
"annotate_start_num": 0,
"drawing": {
"default_line_thickness": 6.0,
"default_text_size": 50.0,
"field_names": [],
"intersheets_ref_own_page": false,
"intersheets_ref_prefix": "",
"intersheets_ref_short": false,
"intersheets_ref_show": false,
"intersheets_ref_suffix": "",
"junction_size_choice": 3,
"label_size_ratio": 0.25,
"pin_symbol_size": 0.0,
"text_offset_ratio": 0.08
},
"legacy_lib_dir": "",
"legacy_lib_list": [],
"meta": {
"version": 1
},
"net_format_name": "Pcbnew",
"ngspice": {
"fix_include_paths": true,
"fix_passive_vals": false,
"meta": {
"version": 0
},
"model_mode": 0,
"workbook_filename": ""
},
"page_layout_descr_file": "",
"plot_directory": "",
"spice_adjust_passive_values": false,
"spice_external_command": "spice \"%I\"",
"subpart_first_id": 65,
"subpart_id_separator": 0
},
"sheets": [],
"text_variables": {}
}

File diff suppressed because it is too large Load Diff

View File

@ -53,10 +53,10 @@ Wire Wire Line
Wire Wire Line
10600 1100 10600 1200
$Comp
L Connector:Conn_01x02_Male OUT_12V
L Connector:Conn_01x02_Male OUT_12V1
U 1 1 6099C84A
P 8350 900
F 0 "OUT_12V" H 8458 1081 50 0000 C CNN
F 0 "OUT_12V1" H 8458 1081 50 0000 C CNN
F 1 "Conn_01x02_Male" H 8458 990 50 0000 C CNN
F 2 "Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical" H 8350 900 50 0001 C CNN
F 3 "~" H 8350 900 50 0001 C CNN
@ -64,10 +64,10 @@ F 3 "~" H 8350 900 50 0001 C CNN
1 0 0 -1
$EndComp
$Comp
L Connector:Conn_01x02_Female IN_5V
L Connector:Conn_01x02_Female IN_5V1
U 1 1 6099CF4C
P 7350 900
F 0 "IN_5V" H 7378 876 50 0000 L CNN
F 0 "IN_5V1" H 7378 876 50 0000 L CNN
F 1 "Conn_01x02_Female" H 7378 785 50 0000 L CNN
F 2 "Connector_PinSocket_2.54mm:PinSocket_1x02_P2.54mm_Vertical" H 7350 900 50 0001 C CNN
F 3 "~" H 7350 900 50 0001 C CNN
@ -121,10 +121,10 @@ F 3 "~" H 950 4150 50 0001 C CNN
0 1 1 0
$EndComp
$Comp
L Connector:USB_A OUT_5V
L Connector:USB_A OUT_5V1
U 1 1 60994FCE
P 5600 1100
F 0 "OUT_5V" H 5657 1567 50 0000 C CNN
F 0 "OUT_5V1" H 5657 1567 50 0000 C CNN
F 1 "USB_A" H 5657 1476 50 0000 C CNN
F 2 "Connector_USB:USB_A_CONNFLY_DS1095-WNR0" H 5750 1050 50 0001 C CNN
F 3 " ~" H 5750 1050 50 0001 C CNN
@ -199,7 +199,7 @@ Text Label 1100 3250 2 50 ~ 0
SMI_SD6
Text Label 1100 3350 2 50 ~ 0
SMI_SD7
Text Label 1100 3650 2 50 ~ 0
Text Label 1100 3550 2 50 ~ 0
SMI_SD15
Text Label 1100 3750 2 50 ~ 0
SMI_SD16
@ -270,7 +270,7 @@ Text Label 1100 5400 2 50 ~ 0
SMI_SD1
Text Label 1100 3850 2 50 ~ 0
SMI_SD2
Text Label 1100 3550 2 50 ~ 0
Text Label 1100 3650 2 50 ~ 0
SMI_SD14
Text Label 1100 3450 2 50 ~ 0
SMI_SD9
@ -297,10 +297,10 @@ F 3 "~" H 7100 2700 50 0001 C CNN
0 1 1 0
$EndComp
$Comp
L Connector:Jack-DC IN_12V
L Connector:Jack-DC IN_12V1
U 1 1 6099631E
P 9900 1000
F 0 "IN_12V" H 9957 1325 50 0000 C CNN
F 0 "IN_12V1" H 9957 1325 50 0000 C CNN
F 1 "Jack-DC" H 9957 1234 50 0000 C CNN
F 2 "Connector_BarrelJack:BarrelJack_Wuerth_6941xx301002" H 9950 960 50 0001 C CNN
F 3 "~" H 9950 960 50 0001 C CNN

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,83 @@
{
"board": {
"active_layer": 0,
"active_layer_preset": "All Layers",
"auto_track_width": true,
"hidden_netclasses": [],
"hidden_nets": [],
"high_contrast_mode": 0,
"net_color_mode": 1,
"opacity": {
"images": 0.6,
"pads": 1.0,
"tracks": 1.0,
"vias": 1.0,
"zones": 0.6
},
"selection_filter": {
"dimensions": true,
"footprints": true,
"graphics": true,
"keepouts": true,
"lockedItems": false,
"otherItems": true,
"pads": true,
"text": true,
"tracks": true,
"vias": true,
"zones": true
},
"visible_items": [
0,
1,
2,
3,
4,
5,
8,
9,
10,
11,
12,
13,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
32,
33,
34,
35,
36,
39,
40
],
"visible_layers": "fffffff_ffffffff",
"zone_display_mode": 0
},
"git": {
"repo_password": "",
"repo_type": "",
"repo_username": "",
"ssh_key": ""
},
"meta": {
"filename": "LedBarsUHat.kicad_prl",
"version": 3
},
"project": {
"files": []
}
}

View File

@ -0,0 +1,632 @@
{
"board": {
"3dviewports": [],
"design_settings": {
"defaults": {
"apply_defaults_to_fp_fields": false,
"apply_defaults_to_fp_shapes": false,
"apply_defaults_to_fp_text": false,
"board_outline_line_width": 0.05,
"copper_line_width": 0.2,
"copper_text_italic": false,
"copper_text_size_h": 1.5,
"copper_text_size_v": 1.5,
"copper_text_thickness": 0.3,
"copper_text_upright": false,
"courtyard_line_width": 0.05,
"dimension_precision": 4,
"dimension_units": 3,
"dimensions": {
"arrow_length": 1270000,
"extension_offset": 500000,
"keep_text_aligned": true,
"suppress_zeroes": false,
"text_position": 0,
"units_format": 1
},
"fab_line_width": 0.1,
"fab_text_italic": false,
"fab_text_size_h": 1.0,
"fab_text_size_v": 1.0,
"fab_text_thickness": 0.15,
"fab_text_upright": false,
"other_line_width": 0.1,
"other_text_italic": false,
"other_text_size_h": 1.0,
"other_text_size_v": 1.0,
"other_text_thickness": 0.15,
"other_text_upright": false,
"pads": {
"drill": 2.7,
"height": 2.7,
"width": 2.7
},
"silk_line_width": 0.12,
"silk_text_italic": false,
"silk_text_size_h": 1.0,
"silk_text_size_v": 1.0,
"silk_text_thickness": 0.15,
"silk_text_upright": false,
"zones": {
"45_degree_only": true,
"min_clearance": 0.0
}
},
"diff_pair_dimensions": [
{
"gap": 0.0,
"via_gap": 0.0,
"width": 0.0
}
],
"drc_exclusions": [],
"meta": {
"version": 2
},
"rule_severities": {
"annular_width": "error",
"clearance": "error",
"connection_width": "warning",
"copper_edge_clearance": "error",
"copper_sliver": "warning",
"courtyards_overlap": "error",
"diff_pair_gap_out_of_range": "error",
"diff_pair_uncoupled_length_too_long": "error",
"drill_out_of_range": "error",
"duplicate_footprints": "warning",
"extra_footprint": "warning",
"footprint": "error",
"footprint_symbol_mismatch": "warning",
"footprint_type_mismatch": "error",
"hole_clearance": "error",
"hole_near_hole": "error",
"holes_co_located": "warning",
"invalid_outline": "error",
"isolated_copper": "warning",
"item_on_disabled_layer": "error",
"items_not_allowed": "error",
"length_out_of_range": "error",
"lib_footprint_issues": "warning",
"lib_footprint_mismatch": "warning",
"malformed_courtyard": "error",
"microvia_drill_out_of_range": "error",
"missing_courtyard": "ignore",
"missing_footprint": "warning",
"net_conflict": "warning",
"npth_inside_courtyard": "ignore",
"padstack": "error",
"pth_inside_courtyard": "ignore",
"shorting_items": "error",
"silk_edge_clearance": "warning",
"silk_over_copper": "error",
"silk_overlap": "error",
"skew_out_of_range": "error",
"solder_mask_bridge": "error",
"starved_thermal": "error",
"text_height": "warning",
"text_thickness": "warning",
"through_hole_pad_without_hole": "error",
"too_many_vias": "error",
"track_dangling": "warning",
"track_width": "error",
"tracks_crossing": "error",
"unconnected_items": "error",
"unresolved_variable": "error",
"via_dangling": "warning",
"zone_has_empty_net": "error",
"zones_intersect": "error"
},
"rules": {
"allow_blind_buried_vias": false,
"allow_microvias": false,
"max_error": 0.005,
"min_clearance": 0.4,
"min_connection": 0.0,
"min_copper_edge_clearance": 0.05,
"min_hole_clearance": 0.0,
"min_hole_to_hole": 0.25,
"min_microvia_diameter": 0.2,
"min_microvia_drill": 0.1,
"min_resolved_spokes": 1,
"min_silk_clearance": 0.0,
"min_text_height": 0.8,
"min_text_thickness": 0.08,
"min_through_hole_diameter": 0.3,
"min_track_width": 0.4,
"min_via_annular_width": 0.05,
"min_via_diameter": 0.4,
"solder_mask_to_copper_clearance": 0.0,
"use_height_for_length_calcs": true
},
"teardrop_options": [
{
"td_onpadsmd": true,
"td_onroundshapesonly": false,
"td_ontrackend": false,
"td_onviapad": true
}
],
"teardrop_parameters": [
{
"td_allow_use_two_tracks": true,
"td_curve_segcount": 0,
"td_height_ratio": 1.0,
"td_length_ratio": 0.5,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_on_pad_in_zone": false,
"td_target_name": "td_round_shape",
"td_width_to_size_filter_ratio": 0.9
},
{
"td_allow_use_two_tracks": true,
"td_curve_segcount": 0,
"td_height_ratio": 1.0,
"td_length_ratio": 0.5,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_on_pad_in_zone": false,
"td_target_name": "td_rect_shape",
"td_width_to_size_filter_ratio": 0.9
},
{
"td_allow_use_two_tracks": true,
"td_curve_segcount": 0,
"td_height_ratio": 1.0,
"td_length_ratio": 0.5,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_on_pad_in_zone": false,
"td_target_name": "td_track_end",
"td_width_to_size_filter_ratio": 0.9
}
],
"track_widths": [
0.0
],
"tuning_pattern_settings": {
"diff_pair_defaults": {
"corner_radius_percentage": 80,
"corner_style": 1,
"max_amplitude": 1.0,
"min_amplitude": 0.2,
"single_sided": false,
"spacing": 1.0
},
"diff_pair_skew_defaults": {
"corner_radius_percentage": 80,
"corner_style": 1,
"max_amplitude": 1.0,
"min_amplitude": 0.2,
"single_sided": false,
"spacing": 0.6
},
"single_track_defaults": {
"corner_radius_percentage": 80,
"corner_style": 1,
"max_amplitude": 1.0,
"min_amplitude": 0.2,
"single_sided": false,
"spacing": 0.6
}
},
"via_dimensions": [
{
"diameter": 0.0,
"drill": 0.0
}
],
"zones_allow_external_fillets": false,
"zones_use_no_outline": true
},
"ipc2581": {
"dist": "",
"distpn": "",
"internal_id": "",
"mfg": "",
"mpn": ""
},
"layer_presets": [],
"viewports": []
},
"boards": [],
"cvpcb": {
"equivalence_files": []
},
"erc": {
"erc_exclusions": [],
"meta": {
"version": 0
},
"pin_map": [
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
1,
0,
1,
2
],
[
0,
1,
0,
0,
0,
0,
1,
1,
2,
1,
1,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2
],
[
1,
1,
1,
1,
1,
0,
1,
1,
1,
1,
1,
2
],
[
0,
0,
0,
1,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
1,
2,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
0,
2,
1,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
]
],
"rule_severities": {
"bus_definition_conflict": "error",
"bus_entry_needed": "error",
"bus_to_bus_conflict": "error",
"bus_to_net_conflict": "error",
"conflicting_netclasses": "error",
"different_unit_footprint": "error",
"different_unit_net": "error",
"duplicate_reference": "error",
"duplicate_sheet_names": "error",
"endpoint_off_grid": "warning",
"extra_units": "error",
"global_label_dangling": "warning",
"hier_label_mismatch": "error",
"label_dangling": "error",
"lib_symbol_issues": "warning",
"missing_bidi_pin": "warning",
"missing_input_pin": "warning",
"missing_power_pin": "error",
"missing_unit": "warning",
"multiple_net_names": "warning",
"net_not_bus_member": "warning",
"no_connect_connected": "warning",
"no_connect_dangling": "warning",
"pin_not_connected": "error",
"pin_not_driven": "error",
"pin_to_pin": "warning",
"power_pin_not_driven": "error",
"similar_labels": "warning",
"simulation_model_issue": "error",
"unannotated": "error",
"unit_value_mismatch": "error",
"unresolved_variable": "error",
"wire_dangling": "error"
}
},
"libraries": {
"pinned_footprint_libs": [],
"pinned_symbol_libs": []
},
"meta": {
"filename": "LedBarsUHat.kicad_pro",
"version": 1
},
"net_settings": {
"classes": [
{
"bus_width": 12,
"clearance": 0.2,
"diff_pair_gap": 0.25,
"diff_pair_via_gap": 0.25,
"diff_pair_width": 0.2,
"line_style": 0,
"microvia_diameter": 0.5,
"microvia_drill": 0.1,
"name": "Default",
"pcb_color": "rgba(0, 0, 0, 0.000)",
"schematic_color": "rgba(0, 0, 0, 0.000)",
"track_width": 0.2,
"via_diameter": 0.9,
"via_drill": 0.6,
"wire_width": 6
},
{
"bus_width": 12,
"clearance": 0.2,
"diff_pair_gap": 0.25,
"diff_pair_via_gap": 0.25,
"diff_pair_width": 0.2,
"line_style": 0,
"microvia_diameter": 0.5,
"microvia_drill": 0.1,
"name": "Power",
"pcb_color": "rgba(0, 0, 0, 0.000)",
"schematic_color": "rgba(0, 0, 0, 0.000)",
"track_width": 0.5,
"via_diameter": 1.0,
"via_drill": 0.7,
"wire_width": 6
}
],
"meta": {
"version": 3
},
"net_colors": null,
"netclass_assignments": null,
"netclass_patterns": []
},
"pcbnew": {
"last_paths": {
"gencad": "",
"idf": "",
"netlist": "",
"plot": "",
"pos_files": "",
"specctra_dsn": "",
"step": "",
"svg": "",
"vrml": ""
},
"page_layout_descr_file": ""
},
"schematic": {
"annotate_start_num": 0,
"bom_export_filename": "",
"bom_fmt_presets": [],
"bom_fmt_settings": {
"field_delimiter": ",",
"keep_line_breaks": false,
"keep_tabs": false,
"name": "CSV",
"ref_delimiter": ",",
"ref_range_delimiter": "",
"string_delimiter": "\""
},
"bom_presets": [],
"bom_settings": {
"exclude_dnp": false,
"fields_ordered": [
{
"group_by": false,
"label": "Reference",
"name": "Reference",
"show": true
},
{
"group_by": true,
"label": "Value",
"name": "Value",
"show": true
},
{
"group_by": false,
"label": "Datasheet",
"name": "Datasheet",
"show": true
},
{
"group_by": false,
"label": "Footprint",
"name": "Footprint",
"show": true
},
{
"group_by": false,
"label": "Qty",
"name": "${QUANTITY}",
"show": true
},
{
"group_by": true,
"label": "DNP",
"name": "${DNP}",
"show": true
}
],
"filter_string": "",
"group_symbols": true,
"name": "Grouped By Value",
"sort_asc": true,
"sort_field": "Reference"
},
"connection_grid_size": 50.0,
"drawing": {
"dashed_lines_dash_length_ratio": 12.0,
"dashed_lines_gap_length_ratio": 3.0,
"default_bus_thickness": 12.0,
"default_junction_size": 40.0,
"default_line_thickness": 6.0,
"default_text_size": 50.0,
"default_wire_thickness": 6.0,
"field_names": [],
"intersheets_ref_own_page": false,
"intersheets_ref_prefix": "",
"intersheets_ref_short": false,
"intersheets_ref_show": false,
"intersheets_ref_suffix": "",
"junction_size_choice": 3,
"label_size_ratio": 0.3,
"operating_point_overlay_i_precision": 3,
"operating_point_overlay_i_range": "~A",
"operating_point_overlay_v_precision": 3,
"operating_point_overlay_v_range": "~V",
"overbar_offset_ratio": 1.23,
"pin_symbol_size": 25.0,
"text_offset_ratio": 0.3
},
"legacy_lib_dir": "",
"legacy_lib_list": [],
"meta": {
"version": 1
},
"net_format_name": "",
"ngspice": {
"fix_include_paths": true,
"fix_passive_vals": false,
"meta": {
"version": 0
},
"model_mode": 0,
"workbook_filename": ""
},
"page_layout_descr_file": "",
"plot_directory": "",
"spice_adjust_passive_values": false,
"spice_current_sheet_as_root": false,
"spice_external_command": "spice \"%I\"",
"spice_model_current_sheet_as_root": true,
"spice_save_all_currents": false,
"spice_save_all_dissipations": false,
"spice_save_all_voltages": false,
"subpart_first_id": 65,
"subpart_id_separator": 0
},
"sheets": [
[
"e63e39d7-6ac0-4ffd-8aa3-1841a4541b55",
"Root"
]
],
"text_variables": {}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
(fp_lib_table
(version 7)
(lib (name "Library")(type "KiCad")(uri "${KIPRJMOD}/LedBarsUHat-backups/Library.pretty")(options "")(descr ""))
)

View File

@ -0,0 +1 @@
{"hostname":"DELLETERE","username":"Paquito"}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,87 @@
{
"board": {
"active_layer": 0,
"active_layer_preset": "",
"auto_track_width": true,
"hidden_netclasses": [],
"hidden_nets": [],
"high_contrast_mode": 0,
"net_color_mode": 1,
"opacity": {
"images": 0.6,
"pads": 1.0,
"tracks": 1.0,
"vias": 1.0,
"zones": 0.6
},
"ratsnest_display_mode": 0,
"selection_filter": {
"dimensions": true,
"footprints": true,
"graphics": true,
"keepouts": true,
"lockedItems": true,
"otherItems": true,
"pads": true,
"text": true,
"tracks": true,
"vias": true,
"zones": true
},
"visible_items": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
32,
33,
34,
35,
36,
39,
40
],
"visible_layers": "fffffff_ffffffff",
"zone_display_mode": 0
},
"git": {
"repo_password": "",
"repo_type": "",
"repo_username": "",
"ssh_key": ""
},
"meta": {
"filename": "LedBarsHat.kicad_prl",
"version": 3
},
"project": {
"files": []
}
}

View File

@ -0,0 +1,825 @@
{
"board": {
"3dviewports": [],
"design_settings": {
"defaults": {
"apply_defaults_to_fp_fields": false,
"apply_defaults_to_fp_shapes": false,
"apply_defaults_to_fp_text": false,
"board_outline_line_width": 0.1,
"copper_line_width": 0.2,
"copper_text_italic": false,
"copper_text_size_h": 1.5,
"copper_text_size_v": 1.5,
"copper_text_thickness": 0.3,
"copper_text_upright": false,
"courtyard_line_width": 0.05,
"dimension_precision": 4,
"dimension_units": 3,
"dimensions": {
"arrow_length": 1270000,
"extension_offset": 500000,
"keep_text_aligned": true,
"suppress_zeroes": false,
"text_position": 0,
"units_format": 1
},
"fab_line_width": 0.1,
"fab_text_italic": false,
"fab_text_size_h": 1.0,
"fab_text_size_v": 1.0,
"fab_text_thickness": 0.15,
"fab_text_upright": false,
"other_line_width": 0.1,
"other_text_italic": false,
"other_text_size_h": 1.0,
"other_text_size_v": 1.0,
"other_text_thickness": 0.15,
"other_text_upright": false,
"pads": {
"drill": 0.762,
"height": 1.524,
"width": 1.524
},
"silk_line_width": 0.15,
"silk_text_italic": false,
"silk_text_size_h": 1.0,
"silk_text_size_v": 1.0,
"silk_text_thickness": 0.15,
"silk_text_upright": false,
"zones": {
"45_degree_only": false,
"min_clearance": 0.508
}
},
"diff_pair_dimensions": [],
"drc_exclusions": [],
"meta": {
"filename": "board_design_settings.json",
"version": 2
},
"rule_severities": {
"annular_width": "error",
"clearance": "error",
"connection_width": "warning",
"copper_edge_clearance": "error",
"copper_sliver": "warning",
"courtyards_overlap": "error",
"diff_pair_gap_out_of_range": "error",
"diff_pair_uncoupled_length_too_long": "error",
"drill_out_of_range": "error",
"duplicate_footprints": "warning",
"extra_footprint": "warning",
"footprint": "error",
"footprint_symbol_mismatch": "warning",
"footprint_type_mismatch": "ignore",
"hole_clearance": "error",
"hole_near_hole": "error",
"holes_co_located": "warning",
"invalid_outline": "error",
"isolated_copper": "warning",
"item_on_disabled_layer": "error",
"items_not_allowed": "error",
"length_out_of_range": "error",
"lib_footprint_issues": "warning",
"lib_footprint_mismatch": "warning",
"malformed_courtyard": "error",
"microvia_drill_out_of_range": "error",
"missing_courtyard": "ignore",
"missing_footprint": "warning",
"net_conflict": "warning",
"npth_inside_courtyard": "ignore",
"padstack": "warning",
"pth_inside_courtyard": "ignore",
"shorting_items": "error",
"silk_edge_clearance": "warning",
"silk_over_copper": "warning",
"silk_overlap": "warning",
"skew_out_of_range": "error",
"solder_mask_bridge": "error",
"starved_thermal": "error",
"text_height": "warning",
"text_thickness": "warning",
"through_hole_pad_without_hole": "error",
"too_many_vias": "error",
"track_dangling": "warning",
"track_width": "error",
"tracks_crossing": "error",
"unconnected_items": "error",
"unresolved_variable": "error",
"via_dangling": "warning",
"zone_has_empty_net": "error",
"zones_intersect": "error"
},
"rules": {
"allow_blind_buried_vias": false,
"allow_microvias": false,
"max_error": 0.005,
"min_clearance": 0.0,
"min_connection": 0.0,
"min_copper_edge_clearance": 0.0,
"min_hole_clearance": 0.25,
"min_hole_to_hole": 0.25,
"min_microvia_diameter": 0.2,
"min_microvia_drill": 0.1,
"min_resolved_spokes": 2,
"min_silk_clearance": 0.0,
"min_text_height": 0.8,
"min_text_thickness": 0.08,
"min_through_hole_diameter": 0.3,
"min_track_width": 0.2,
"min_via_annular_width": 0.1,
"min_via_diameter": 0.4,
"solder_mask_to_copper_clearance": 0.0,
"use_height_for_length_calcs": true
},
"teardrop_options": [
{
"td_onpadsmd": true,
"td_onroundshapesonly": false,
"td_ontrackend": false,
"td_onviapad": true
}
],
"teardrop_parameters": [
{
"td_allow_use_two_tracks": true,
"td_curve_segcount": 0,
"td_height_ratio": 1.0,
"td_length_ratio": 0.5,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_on_pad_in_zone": false,
"td_target_name": "td_round_shape",
"td_width_to_size_filter_ratio": 0.9
},
{
"td_allow_use_two_tracks": true,
"td_curve_segcount": 0,
"td_height_ratio": 1.0,
"td_length_ratio": 0.5,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_on_pad_in_zone": false,
"td_target_name": "td_rect_shape",
"td_width_to_size_filter_ratio": 0.9
},
{
"td_allow_use_two_tracks": true,
"td_curve_segcount": 0,
"td_height_ratio": 1.0,
"td_length_ratio": 0.5,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_on_pad_in_zone": false,
"td_target_name": "td_track_end",
"td_width_to_size_filter_ratio": 0.9
}
],
"track_widths": [],
"tuning_pattern_settings": {
"diff_pair_defaults": {
"corner_radius_percentage": 80,
"corner_style": 1,
"max_amplitude": 1.0,
"min_amplitude": 0.2,
"single_sided": false,
"spacing": 1.0
},
"diff_pair_skew_defaults": {
"corner_radius_percentage": 80,
"corner_style": 1,
"max_amplitude": 1.0,
"min_amplitude": 0.2,
"single_sided": false,
"spacing": 0.6
},
"single_track_defaults": {
"corner_radius_percentage": 80,
"corner_style": 1,
"max_amplitude": 1.0,
"min_amplitude": 0.2,
"single_sided": false,
"spacing": 0.6
}
},
"via_dimensions": [],
"zones_allow_external_fillets": false,
"zones_use_no_outline": true
},
"ipc2581": {
"dist": "",
"distpn": "",
"internal_id": "",
"mfg": "",
"mpn": ""
},
"layer_presets": [],
"viewports": []
},
"boards": [],
"cvpcb": {
"equivalence_files": []
},
"erc": {
"erc_exclusions": [],
"meta": {
"version": 0
},
"pin_map": [
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
1,
0,
1,
2
],
[
0,
1,
0,
0,
0,
0,
1,
1,
2,
1,
1,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2
],
[
1,
1,
1,
1,
1,
0,
1,
1,
1,
1,
1,
2
],
[
0,
0,
0,
1,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
1,
2,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
0,
2,
1,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
]
],
"rule_severities": {
"bus_definition_conflict": "error",
"bus_entry_needed": "error",
"bus_label_syntax": "error",
"bus_to_bus_conflict": "error",
"bus_to_net_conflict": "error",
"conflicting_netclasses": "error",
"different_unit_footprint": "error",
"different_unit_net": "error",
"duplicate_reference": "error",
"duplicate_sheet_names": "error",
"endpoint_off_grid": "warning",
"extra_units": "error",
"global_label_dangling": "warning",
"hier_label_mismatch": "error",
"label_dangling": "error",
"lib_symbol_issues": "warning",
"missing_bidi_pin": "warning",
"missing_input_pin": "warning",
"missing_power_pin": "error",
"missing_unit": "warning",
"multiple_net_names": "warning",
"net_not_bus_member": "warning",
"no_connect_connected": "warning",
"no_connect_dangling": "warning",
"pin_not_connected": "error",
"pin_not_driven": "error",
"pin_to_pin": "warning",
"power_pin_not_driven": "error",
"similar_labels": "warning",
"simulation_model_issue": "ignore",
"unannotated": "error",
"unit_value_mismatch": "error",
"unresolved_variable": "error",
"wire_dangling": "error"
}
},
"libraries": {
"pinned_footprint_libs": [],
"pinned_symbol_libs": []
},
"meta": {
"filename": "LedBarsHat.kicad_pro",
"version": 1
},
"net_settings": {
"classes": [
{
"bus_width": 12,
"clearance": 0.2,
"diff_pair_gap": 0.25,
"diff_pair_via_gap": 0.25,
"diff_pair_width": 0.2,
"line_style": 0,
"microvia_diameter": 0.3,
"microvia_drill": 0.1,
"name": "Default",
"pcb_color": "rgba(0, 0, 0, 0.000)",
"schematic_color": "rgba(0, 0, 0, 0.000)",
"track_width": 0.25,
"via_diameter": 0.8,
"via_drill": 0.4,
"wire_width": 6
}
],
"meta": {
"version": 3
},
"net_colors": null,
"netclass_assignments": null,
"netclass_patterns": [
{
"netclass": "Default",
"pattern": "+12V"
},
{
"netclass": "Default",
"pattern": "+3V3"
},
{
"netclass": "Default",
"pattern": "+5V"
},
{
"netclass": "Default",
"pattern": "/I2S_CLK"
},
{
"netclass": "Default",
"pattern": "/I2S_SD"
},
{
"netclass": "Default",
"pattern": "/I2S_WS"
},
{
"netclass": "Default",
"pattern": "/SEL_MODE0"
},
{
"netclass": "Default",
"pattern": "/SEL_MODE1"
},
{
"netclass": "Default",
"pattern": "/SEL_MODE2"
},
{
"netclass": "Default",
"pattern": "/SEL_MODE3"
},
{
"netclass": "Default",
"pattern": "/SMI_SD0"
},
{
"netclass": "Default",
"pattern": "/SMI_SD1"
},
{
"netclass": "Default",
"pattern": "/SMI_SD13"
},
{
"netclass": "Default",
"pattern": "/SMI_SD14"
},
{
"netclass": "Default",
"pattern": "/SMI_SD15"
},
{
"netclass": "Default",
"pattern": "/SMI_SD16"
},
{
"netclass": "Default",
"pattern": "/SMI_SD17"
},
{
"netclass": "Default",
"pattern": "/SMI_SD2"
},
{
"netclass": "Default",
"pattern": "/SMI_SD3"
},
{
"netclass": "Default",
"pattern": "/SMI_SD4"
},
{
"netclass": "Default",
"pattern": "/SMI_SD5"
},
{
"netclass": "Default",
"pattern": "/SMI_SD6"
},
{
"netclass": "Default",
"pattern": "/SMI_SD7"
},
{
"netclass": "Default",
"pattern": "/SMI_SD8"
},
{
"netclass": "Default",
"pattern": "/SMI_SD9"
},
{
"netclass": "Default",
"pattern": "GND"
},
{
"netclass": "Default",
"pattern": "Net-(J1-Pad13)"
},
{
"netclass": "Default",
"pattern": "Net-(J1-Pad26)"
},
{
"netclass": "Default",
"pattern": "Net-(J1-Pad27)"
},
{
"netclass": "Default",
"pattern": "Net-(J1-Pad28)"
},
{
"netclass": "Default",
"pattern": "Net-(J1-Pad3)"
},
{
"netclass": "Default",
"pattern": "Net-(J1-Pad5)"
},
{
"netclass": "Default",
"pattern": "Net-(J1-Pad7)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT1-Pad1)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT1-Pad2)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT1-Pad3)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT1-Pad4)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT1-Pad5)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT1-Pad6)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT1-Pad7)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT1-Pad8)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT2-Pad1)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT2-Pad2)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT2-Pad3)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT2-Pad4)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT2-Pad5)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT2-Pad6)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT2-Pad7)"
},
{
"netclass": "Default",
"pattern": "Net-(J_OUT2-Pad8)"
},
{
"netclass": "Default",
"pattern": "Net-(OUT_5V1-Pad2)"
},
{
"netclass": "Default",
"pattern": "Net-(OUT_5V1-Pad3)"
},
{
"netclass": "Default",
"pattern": "Net-(OUT_5V1-Pad5)"
},
{
"netclass": "Default",
"pattern": "Net-(R1-Pad1)"
},
{
"netclass": "Default",
"pattern": "Net-(R2-Pad2)"
},
{
"netclass": "Default",
"pattern": "Net-(R3-Pad1)"
},
{
"netclass": "Default",
"pattern": "Net-(U1-Pad9)"
},
{
"netclass": "Default",
"pattern": "VCC"
}
]
},
"pcbnew": {
"last_paths": {
"gencad": "",
"idf": "",
"netlist": "",
"plot": "",
"pos_files": "",
"specctra_dsn": "",
"step": "",
"svg": "",
"vrml": ""
},
"page_layout_descr_file": ""
},
"schematic": {
"annotate_start_num": 0,
"bom_export_filename": "",
"bom_fmt_presets": [],
"bom_fmt_settings": {
"field_delimiter": ",",
"keep_line_breaks": false,
"keep_tabs": false,
"name": "CSV",
"ref_delimiter": ",",
"ref_range_delimiter": "",
"string_delimiter": "\""
},
"bom_presets": [],
"bom_settings": {
"exclude_dnp": false,
"fields_ordered": [
{
"group_by": false,
"label": "Reference",
"name": "Reference",
"show": true
},
{
"group_by": true,
"label": "Value",
"name": "Value",
"show": true
},
{
"group_by": false,
"label": "Datasheet",
"name": "Datasheet",
"show": true
},
{
"group_by": false,
"label": "Footprint",
"name": "Footprint",
"show": true
},
{
"group_by": false,
"label": "Qty",
"name": "${QUANTITY}",
"show": true
},
{
"group_by": true,
"label": "DNP",
"name": "${DNP}",
"show": true
}
],
"filter_string": "",
"group_symbols": true,
"name": "Grouped By Value",
"sort_asc": true,
"sort_field": "Reference"
},
"connection_grid_size": 50.0,
"drawing": {
"dashed_lines_dash_length_ratio": 12.0,
"dashed_lines_gap_length_ratio": 3.0,
"default_line_thickness": 6.0,
"default_text_size": 50.0,
"field_names": [],
"intersheets_ref_own_page": false,
"intersheets_ref_prefix": "",
"intersheets_ref_short": false,
"intersheets_ref_show": false,
"intersheets_ref_suffix": "",
"junction_size_choice": 3,
"label_size_ratio": 0.25,
"operating_point_overlay_i_precision": 3,
"operating_point_overlay_i_range": "~A",
"operating_point_overlay_v_precision": 3,
"operating_point_overlay_v_range": "~V",
"overbar_offset_ratio": 1.23,
"pin_symbol_size": 0.0,
"text_offset_ratio": 0.08
},
"legacy_lib_dir": "",
"legacy_lib_list": [],
"meta": {
"version": 1
},
"net_format_name": "Pcbnew",
"ngspice": {
"fix_include_paths": true,
"fix_passive_vals": false,
"meta": {
"version": 0
},
"model_mode": 0,
"workbook_filename": ""
},
"page_layout_descr_file": "",
"plot_directory": "",
"spice_adjust_passive_values": false,
"spice_current_sheet_as_root": false,
"spice_external_command": "spice \"%I\"",
"spice_model_current_sheet_as_root": true,
"spice_save_all_currents": false,
"spice_save_all_dissipations": false,
"spice_save_all_voltages": false,
"subpart_first_id": 65,
"subpart_id_separator": 0
},
"sheets": [],
"text_variables": {}
}

View File

@ -0,0 +1,28 @@
(module I2S_MEMS_Microphone (layer F.Cu) (tedit 6099062F)
(descr "I2S MEMS Microphone")
(tags "I2S MEMS Microphone")
(fp_text reference REF** (at 3.81 -2.33) (layer F.SilkS)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text value "I2S MEMS Microphone" (at 3.81 7.41) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_line (start 1.635 -1.27) (end 6.985 -1.27) (layer F.Fab) (width 0.1))
(fp_line (start 6.985 -1.27) (end 6.985 6.35) (layer F.Fab) (width 0.1))
(fp_line (start 6.985 6.35) (end 0.635 6.35) (layer F.Fab) (width 0.1))
(fp_line (start 0.635 6.35) (end 0.635 -0.27) (layer F.Fab) (width 0.1))
(fp_line (start 0.635 -0.27) (end 1.635 -1.27) (layer F.Fab) (width 0.1))
(fp_line (start -1.45 -1.55) (end -1.45 6.6) (layer F.CrtYd) (width 0.05))
(fp_line (start -1.45 6.6) (end 9.1 6.6) (layer F.CrtYd) (width 0.05))
(fp_line (start 9.1 6.6) (end 9.1 -1.55) (layer F.CrtYd) (width 0.05))
(fp_line (start 9.1 -1.55) (end -1.45 -1.55) (layer F.CrtYd) (width 0.05))
(fp_text user %R (at 3.81 2.54) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(pad 6 thru_hole oval (at 7.62 0) (size 2.4 1.6) (drill 0.8) (layers *.Cu *.Mask))
(pad 3 thru_hole oval (at 0 5.08) (size 2.4 1.6) (drill 0.8) (layers *.Cu *.Mask))
(pad 5 thru_hole oval (at 7.62 2.54) (size 2.4 1.6) (drill 0.8) (layers *.Cu *.Mask))
(pad 2 thru_hole oval (at 0 2.54) (size 2.4 1.6) (drill 0.8) (layers *.Cu *.Mask))
(pad 4 thru_hole oval (at 7.62 5.08) (size 2.4 1.6) (drill 0.8) (layers *.Cu *.Mask))
(pad 1 thru_hole rect (at 0 0) (size 2.4 1.6) (drill 0.8) (layers *.Cu *.Mask))
)

View File

@ -0,0 +1,46 @@
(module Led_Power_Bus (layer F.Cu) (tedit 609AB8F7)
(descr "Through hole straight pin header, 2x08, 2.54mm pitch, double rows")
(tags "Through hole pin header THT 2x08 2.54mm double row")
(fp_text reference REF** (at 1.27 -2.33) (layer F.SilkS)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text value Led_Power_Bus (at 1.27 20.11) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_line (start 0 -1.27) (end 3.81 -1.27) (layer F.Fab) (width 0.1))
(fp_line (start 3.81 -1.27) (end 3.81 19.05) (layer F.Fab) (width 0.1))
(fp_line (start 3.81 19.05) (end -1.27 19.05) (layer F.Fab) (width 0.1))
(fp_line (start -1.27 19.05) (end -1.27 0) (layer F.Fab) (width 0.1))
(fp_line (start -1.27 0) (end 0 -1.27) (layer F.Fab) (width 0.1))
(fp_line (start -1.33 19.11) (end 3.87 19.11) (layer F.SilkS) (width 0.12))
(fp_line (start -1.33 1.27) (end -1.33 19.11) (layer F.SilkS) (width 0.12))
(fp_line (start 3.87 -1.33) (end 3.87 19.11) (layer F.SilkS) (width 0.12))
(fp_line (start -1.33 1.27) (end 1.27 1.27) (layer F.SilkS) (width 0.12))
(fp_line (start 1.27 1.27) (end 1.27 -1.33) (layer F.SilkS) (width 0.12))
(fp_line (start 1.27 -1.33) (end 3.87 -1.33) (layer F.SilkS) (width 0.12))
(fp_line (start -1.33 0) (end -1.33 -1.33) (layer F.SilkS) (width 0.12))
(fp_line (start -1.33 -1.33) (end 0 -1.33) (layer F.SilkS) (width 0.12))
(fp_line (start -1.8 -1.8) (end -1.8 19.55) (layer F.CrtYd) (width 0.05))
(fp_line (start -1.8 19.55) (end 4.35 19.55) (layer F.CrtYd) (width 0.05))
(fp_line (start 4.35 19.55) (end 4.35 -1.8) (layer F.CrtYd) (width 0.05))
(fp_line (start 4.35 -1.8) (end -1.8 -1.8) (layer F.CrtYd) (width 0.05))
(fp_text user %R (at 1.27 8.89 90) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(pad 8b thru_hole oval (at 2.54 17.78) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 8a thru_hole oval (at 0 17.78) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 7b thru_hole oval (at 2.54 15.24) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 7a thru_hole oval (at 0 15.24) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 6b thru_hole oval (at 2.54 12.7) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 6a thru_hole oval (at 0 12.7) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 5b thru_hole oval (at 2.54 10.16) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 5a thru_hole oval (at 0 10.16) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 4b thru_hole oval (at 2.54 7.62) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 4a thru_hole oval (at 0 7.62) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 3b thru_hole oval (at 2.54 5.08) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 3a thru_hole oval (at 0 5.08) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 2b thru_hole oval (at 2.54 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 2a thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 1b thru_hole oval (at 2.54 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 1a thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
)

View File

@ -0,0 +1,36 @@
(module Led_Signal_Bus (layer F.Cu) (tedit 609AB921)
(descr "Through hole straight socket strip, 1x08, 2.54mm pitch, single row (from Kicad 4.0.7), script generated")
(tags "Through hole socket strip THT 1x08 2.54mm single row")
(fp_text reference REF** (at 0 -2.77) (layer F.SilkS)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text value Led_Signal_Bus (at 0 20.55) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_line (start -1.8 19.55) (end -1.8 -1.8) (layer F.CrtYd) (width 0.05))
(fp_line (start 1.75 19.55) (end -1.8 19.55) (layer F.CrtYd) (width 0.05))
(fp_line (start 1.75 -1.8) (end 1.75 19.55) (layer F.CrtYd) (width 0.05))
(fp_line (start -1.8 -1.8) (end 1.75 -1.8) (layer F.CrtYd) (width 0.05))
(fp_line (start 0 -1.33) (end 1.33 -1.33) (layer F.SilkS) (width 0.12))
(fp_line (start 1.33 -1.33) (end 1.33 0) (layer F.SilkS) (width 0.12))
(fp_line (start 1.33 1.27) (end 1.33 19.11) (layer F.SilkS) (width 0.12))
(fp_line (start -1.33 19.11) (end 1.33 19.11) (layer F.SilkS) (width 0.12))
(fp_line (start -1.33 1.27) (end -1.33 19.11) (layer F.SilkS) (width 0.12))
(fp_line (start -1.33 1.27) (end 1.33 1.27) (layer F.SilkS) (width 0.12))
(fp_line (start -1.27 19.05) (end -1.27 -1.27) (layer F.Fab) (width 0.1))
(fp_line (start 1.27 19.05) (end -1.27 19.05) (layer F.Fab) (width 0.1))
(fp_line (start 1.27 -0.635) (end 1.27 19.05) (layer F.Fab) (width 0.1))
(fp_line (start 0.635 -1.27) (end 1.27 -0.635) (layer F.Fab) (width 0.1))
(fp_line (start -1.27 -1.27) (end 0.635 -1.27) (layer F.Fab) (width 0.1))
(fp_text user %R (at 0 8.89 90) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(pad 8 thru_hole oval (at 0 17.78) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 7 thru_hole oval (at 0 15.24) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 6 thru_hole oval (at 0 12.7) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 5 thru_hole oval (at 0 10.16) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 4 thru_hole oval (at 0 7.62) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 3 thru_hole oval (at 0 5.08) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
(pad 1 thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask))
)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1,3 @@
(fp_lib_table
(lib (name LedBarsHat)(type KiCad)(uri ${KIPRJMOD}/LedBarsHat.pretty)(options "")(descr ""))
)

View File

@ -0,0 +1,4 @@
(sym_lib_table
(lib (name 74hct245)(type Legacy)(uri ${KIPRJMOD}/LedBarsHat.symbols/74hct245.lib)(options "")(descr ""))
(lib (name LedBarsHat-rescue)(type Legacy)(uri ${KIPRJMOD}/LedBarsHat-rescue.lib)(options "")(descr ""))
)

View File

@ -1,18 +1,25 @@
#! /usr/bin/env bash
target=pi_hotspot
dir_target=~/RpiLedBars
target=raspberrypi-3.local
dir_target=RpiLedBars
# I - Copy project to pi target
## 1 - select target from ssh config
## 2 - rsync project
rsync -avz --delete --backup-dir=../RpiLedBars_backup/"$(date +%F_%H-%M-%S)" ./ -e ssh ${target}:${dir_target}
rsync -avz --delete --exclude '*.build' --exclude 'cava' --filter='P .build' --backup-dir=../RpiLedBars_backup/"$(date +%F_%H-%M-%S)" ./ -e ssh ${target}:${dir_target}
# II - Connect to pi target
## 1 - Check prequistite (cava, i2s micropphone module, CMake)
## 2 - Build project
ssh ${target} "cd ${dir_target}/frontend && "
# 2 - Build project
if [[ "$?" -eq 0 ]]; then
ssh ${target} "cd ${dir_target}/backend && cmake -B .build && cmake --build .build"
fi
## 3 - Install project
# ssh ${target} "cd ${dir_target}/backend && ./install.sh"
## 3 - Run project
if [[ "$?" -eq 0 ]]; then
ssh ${target} "cd ${dir_target}/backend && ./run.sh"
fi

View File

@ -164,11 +164,13 @@ int chan_num;
// Convert RGB text string into integer data, for given channel
// Return number of data points for this channel
int str_rgb(char *s, int rgbs[][LED_NCHANS], int chan) {
int str_rgb(char *s, int rgbs[][LED_NCHANS], int chan)
{
int i = 0;
char *p;
while (chan < LED_NCHANS && i < CHAN_MAXLEDS && hexdig(*s) >= 0) {
while (chan < LED_NCHANS && i < CHAN_MAXLEDS && hexdig(*s) >= 0)
{
rgbs[i++][chan] = strtoul(s, &p, 16);
s = *p ? p + 1 : p;
}
@ -177,19 +179,24 @@ int str_rgb(char *s, int rgbs[][LED_NCHANS], int chan) {
// Set Tx data for 8 or 16 chans, 1 LED per chan, given 1 RGB val per chan
// Logic 1 is 0.8us high, 0.4 us low, logic 0 is 0.4us high, 0.8us low
void set_color(uint32_t rgb, TXDATA_T *txd) {
void set_color(uint32_t rgb, TXDATA_T *txd)
{
int msk;
// For each bit of the 24-bit RGB values..
for (size_t n = 0; n < LED_NBITS; n++) {
for (size_t n = 0; n < LED_NBITS; n++)
{
// Mask to convert RGB to GRB, M.S bit first
msk = n == 0 ? 0x800000 : n == 8 ? 0x8000 : n == 16 ? 0x80 : msk >> 1;
msk = n == 0 ? 0x800000 : n == 8 ? 0x8000
: n == 16 ? 0x80
: msk >> 1;
// 1st byte or word is a high pulse on all lines
txd[0] = (TXDATA_T)0xffff;
// 2nd has high or low bits from data
// 3rd is a low pulse
txd[1] = txd[2] = 0;
if (rgb & msk) {
if (rgb & msk)
{
txd[1] = (TXDATA_T)0xffff;
}
txd += BIT_NPULSES;
@ -198,19 +205,24 @@ void set_color(uint32_t rgb, TXDATA_T *txd) {
// Set Tx data for 8 or 16 chans, 1 LED per chan, given 1 RGB val per chan
// Logic 1 is 0.8us high, 0.4 us low, logic 0 is 0.4us high, 0.8us low
void rgb_txdata(int *rgbs, TXDATA_T *txd) {
void rgb_txdata(int *rgbs, TXDATA_T *txd)
{
int i, n, msk;
// For each bit of the 24-bit RGB values..
for (n = 0; n < LED_NBITS; n++) {
for (n = 0; n < LED_NBITS; n++)
{
// Mask to convert RGB to GRB, M.S bit first
msk = n == 0 ? 0x800000 : n == 8 ? 0x8000 : n == 16 ? 0x80 : msk >> 1;
msk = n == 0 ? 0x800000 : n == 8 ? 0x8000
: n == 16 ? 0x80
: msk >> 1;
// 1st byte or word is a high pulse on all lines
txd[0] = (TXDATA_T)0xffff;
// 2nd has high or low bits from data
// 3rd is a low pulse
txd[1] = txd[2] = 0;
for (i = 0; i < LED_NCHANS; i++) {
for (i = 0; i < LED_NCHANS; i++)
{
if (rgbs[i] & msk)
txd[1] |= (1 << i);
}
@ -219,25 +231,30 @@ void rgb_txdata(int *rgbs, TXDATA_T *txd) {
}
// Swap adjacent bytes in transmit data
void swap_bytes(void *data, int len) {
void swap_bytes(void *data, int len)
{
uint16_t *wp = (uint16_t *)data;
len = (len + 1) / 2;
while (len-- > 0) {
while (len-- > 0)
{
*wp = __builtin_bswap16(*wp);
wp++;
}
}
// Return hex digit value, -ve if not hex
int hexdig(char c) {
int hexdig(char c)
{
c = toupper(c);
return ((c >= '0' && c <= '9') ? c - '0' : (c >= 'A' && c <= 'F') ? c - 'A' + 10 : -1);
return ((c >= '0' && c <= '9') ? c - '0' : (c >= 'A' && c <= 'F') ? c - 'A' + 10
: -1);
}
// Map GPIO, DMA and SMI registers into virtual mem (user space)
// If any of these fail, program will be terminate_smid
void map_devices(void) {
void map_devices(void)
{
map_periph(&gpio_regs, (void *)GPIO_BASE, PAGE_SIZE);
map_periph(&dma_regs, (void *)DMA_BASE, PAGE_SIZE);
map_periph(&clk_regs, (void *)CLK_BASE, PAGE_SIZE);
@ -245,16 +262,19 @@ void map_devices(void) {
}
// Catastrophic failure in initial setup
void fail(char *s) {
void fail(char *s)
{
printf(s);
terminate_smi(0);
}
// Free memory segments and exit
void terminate_smi(int sig) {
void terminate_smi(int sig)
{
int i;
printf("Closing\n");
if (gpio_regs.virt) {
if (gpio_regs.virt)
{
for (i = 0; i < LED_NCHANS; i++)
gpio_mode(LED_D0_PIN + i, GPIO_IN);
}
@ -270,7 +290,8 @@ void terminate_smi(int sig) {
// Initialise SMI, given data width, time step, and setup/hold/strobe counts
// Step value is in nanoseconds: even numbers, 2 to 30
void init_smi(int ledChan, int ns, int setup, int strobe, int hold) {
void init_smi(int ledChan, int ns, int setup, int strobe, int hold)
{
int width = ledChan > 8 ? SMI_16_BITS : SMI_8_BITS;
int i, divi = ns / 2;
@ -286,7 +307,8 @@ void init_smi(int ledChan, int ns, int setup, int strobe, int hold) {
smi_dcd = (SMI_DCD_REG *)REG32(smi_regs, SMI_DCD);
smi_cs->value = smi_l->value = smi_a->value = 0;
smi_dsr->value = smi_dsw->value = smi_dcs->value = smi_dca->value = 0;
if (*REG32(clk_regs, CLK_SMI_DIV) != divi << 12) {
if (*REG32(clk_regs, CLK_SMI_DIV) != divi << 12)
{
*REG32(clk_regs, CLK_SMI_CTL) = CLK_PASSWD | (1 << 5);
usleep(10);
while (*REG32(clk_regs, CLK_SMI_CTL) & (1 << 7))
@ -313,7 +335,8 @@ void init_smi(int ledChan, int ns, int setup, int strobe, int hold) {
}
// Set up SMI transfers using DMA
void setup_smi_dma(MEM_MAP *mp, int nsamp, TXDATA_T **txdata) {
void setup_smi_dma(MEM_MAP *mp, int nsamp, TXDATA_T **txdata)
{
DMA_CB *cbs = mp->virt;
*txdata = (TXDATA_T *)(cbs + 1);
@ -331,7 +354,8 @@ void setup_smi_dma(MEM_MAP *mp, int nsamp, TXDATA_T **txdata) {
}
// Start SMI DMA transfers
void start_smi(MEM_MAP *mp) {
void start_smi(MEM_MAP *mp)
{
DMA_CB *cbs = mp->virt;
start_dma(mp, DMA_CHAN, &cbs[0], 0);

View File

@ -0,0 +1,9 @@
#! /usr/bin/env bash
target=pi
dir_target=RpiLedBars_dev
if [[ "$1" ]]; then
target="$1"
fi

View File

@ -1,11 +0,0 @@
--2021-07-24 09:17:35-- https://forums.adafruit.com/download/file.php?id=49380
Resolving forums.adafruit.com (forums.adafruit.com)... 34.200.112.132
Connecting to forums.adafruit.com (forums.adafruit.com)|34.200.112.132|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1510 (1.5K) [application/octet-stream]
Saving to: file.php?id=49380
file.php?id=49380 0%[ ] 0 --.-KB/s file.php?id=49380 100%[===================================================================================================================>] 1.47K --.-KB/s in 0s
2021-07-24 09:17:36 (3.03 MB/s) - file.php?id=49380 saved [1510/1510]