Install some required packages first:
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common| #!/usr/bin/env python3 | |
| # | |
| # Copyright (c) 2015, Freescale Semiconductor, Inc. | |
| # Copyright 2016-2021 NXP | |
| # Copyright 2022 Kristian Sloth Lauszus | |
| # All rights reserved. | |
| # | |
| # SPDX-License-Identifier: BSD-3-Clause | |
| # | |
| # Python port of the "FLEXCAN_CalculateImprovedTimingValues" function from the NXP SDK |
| import json | |
| import zipfile | |
| from typing import Union, Optional | |
| import requests | |
| GITHUB_OAUTH_TOKEN = '' | |
| OWNER = '' | |
| REPO = '' |
| // gcc -Wall -O3 -pthread -o set_drive_strength pigpio.c -lpigpio | |
| #include <stdlib.h> | |
| #include <pigpio.h> | |
| int main(int argc, char *argv[]) { | |
| if (gpioInitialise() < 0) return 1; | |
| int strength_ma = argc > 1 ? atoi(argv[1]) : 8; |
| #!/bin/sh | |
| # Check if this is the initial commit | |
| if git rev-parse --verify HEAD >/dev/null 2>&1; then | |
| against=HEAD | |
| else | |
| # Initial commit: diff against an empty tree object | |
| against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |
| fi |
| // Overlay for Maxim MAX98357A audio DAC without using the PCM_DIN pin | |
| // dtparams: | |
| // sdmode-pin - Specify GPIO pin to which SD_MODE is connected (default 20). | |
| /dts-v1/; | |
| /plugin/; | |
| / { | |
| compatible = "brcm,bcm2835"; |
| /* | |
| * Device tree overlay for mcp251x on any spi interface by Kristian Sloth Lauszus. | |
| * Should be used with the "spi0-4cs" overlay. | |
| */ | |
| /dts-v1/; | |
| /plugin/; | |
| / { | |
| compatible = "brcm,bcm2835"; |
| import hashlib | |
| SCOPEID = '0000000000000000' | |
| Model = 'SDS2000X+' | |
| # Note that 'AWG' should be used for the 'FG' option | |
| # If you have the 100 MHz model, then first upgrade it to 200 MHz, then 350 MHz and finally 500 MHz | |
| bwopt = ('25M', '40M', '50M', '60M', '70M', '100M', '150M', '200M', '250M', '300M', '350M', '500M', '750M', '1000M', 'MAX', 'AWG', 'WIFI', 'MSO', 'FLX', 'CFD', 'I2S', '1553', 'PWA') | |
| hashkey = '5zao9lyua01pp7hjzm3orcq90mds63z6zi5kv7vmv3ih981vlwn06txnjdtas3u2wa8msx61i12ueh14t7kqwsfskg032nhyuy1d9vv2wm925rd18kih9xhkyilobbgy' |
| # Put in "/usr/lib/os-release-bionic" | |
| NAME="Ubuntu" | |
| VERSION="18.04 (Bionic Beaver)" | |
| ID=ubuntu | |
| ID_LIKE=debian | |
| PRETTY_NAME="Ubuntu 18.04" | |
| VERSION_ID="18.04" | |
| VERSION_CODENAME=bionic | |
| UBUNTU_CODENAME=bionic |
| [Match] | |
| Name=can* | |
| [CAN] | |
| BitRate=250000 | |
| RestartSec=100ms | |
| # Put this file in: "/etc/systemd/network/" and then run "sudo systemctl enable systemd-networkd" to enable systemd-networkd | |
| # Now start systemd-networkd: "sudo systemctl start systemd-networkd" | |
| # Credit: https://github.com/linux-can/can-utils/issues/68#issuecomment-584505426 |
Install some required packages first:
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common