Snowfox = HAL + IO + COMSTACK + CI + C++
This project is retired due to increasingly better vendor provided HALs and middleware.
What ?
Snowfox consists of a Hardware Abstraction Layer + IO driver support for various sensors, actuators and communication controllers + industrial communication stacks written mostly in C++. The codebase can be simultaneously compiled for both host and desired target platform which enables the user to run and verify the complete firmware within the host pc without the need for target hardware. Furthermore unit tests are run and code quality metrics are gathered automatically upon commit in order to ensure code quality and functionality.
Why #1?
The application of OO principles such as SOLID leads to a clean code base and minimizes coupling between modules. This enables the application of Test Driven Development which gives developers instantenous feedback on their code therefore eliminating tedious integration and bug fixing sessions typical for Debug-Later-Programming.
Why #2?
In his book "Refactoring: Improving the Design of Existing Code" Martin Fowler frankly states that “Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” This project aims to do just that for the embedded domain. You are kindly invited to browse the code and form your own opinion about how well the code is adhering to our claim.
Hardware Abstraction Layers
Atmel/Microchip
MCU | MCU_ARCH | MCU_TYPE | Eval-Boards |
---|---|---|---|
AT90CAN32 | avr | at90can32 | |
AT90CAN64 | ... | at90can64 | |
AT90CAN128 | ... | at90can128 | Olimex AVR-CAN, AL-ERAM128 V2.0 |
ATMega640 | ... | atmega640 | |
ATMega1280 | ... | atmega1280 | |
ATMega2560 | ... | atmega2560 | Arduino Mega, Controllino Mega, Controllino Maxi |
ATMega164P | ... | atmega164p | |
ATMega324P | ... | atmega324p | |
ATMega644P | ... | atmega644p | |
ATMega1284P | ... | atmega1284p | Moteino Mega USB |
ATMega328P | ... | atmega328p | Arduino Uno, Controllino Mini |
ATMega16U4 | ... | atmega16u4 | |
ATMega32U4 | ... | atmega32u4 | Arduino Leonardo |
ATMega3209 | ... | atmega3209 | |
ATMega4809 | ... | atmega4809 | Arduino Uno WiFi Rev.2 |
SiFive (RISC-V)
MCU | MCU_ARCH | MCU_TYPE | Eval-Boards |
---|---|---|---|
FE310 | riscv64 | fe310 | HiFive 1 Rev. B |
Host (Test Build)
MCU | MCU_ARCH | MCU_TYPE |
---|---|---|
Host (Test Build) | host | host |
I/O Device Drivers
/driver/can
- MCP2515 (CAN Controller) (Seedstudio CAN Shield V2.0)
/driver/glcd
- RA6963 (GLCD Controller)
/driver/haptic
- DRV2605L (Haptic Driver for LRA and ERM)
/driver/ioexpander
- MAX6921 (20-Output VFD tube driver)
- MCP23017 (16-Bit I/O Expander)
- PCA9547 (8-channel I2C-Bus multiplexer)
/driver/lora
- RFM9x (HopeRF RFM95/96/97/98 Low Power Long Range Transceiver Module) (Dragino LoRa Shield V1.4, Moteino Mega USB)
/driver/memory
- AT45DBx (SPI NAND Flash)
- N25Q256A (SPI NOR Flash) (Digilent Pmod SF3)
- PCF8570 (256 × 8-Bit Static Low-Voltage RAM)
/driver/sensor
- AD7151 (1-channel capacitance converter for proximity sensing)
- AS5600 (12-Bit programmable contactless potentiometer)
- BMG160 (3-axis digital output MEMS gyroscope)
- INA220 (Low- or high-side, bidirectional, I2C current monitor)
- L3GD20 (3-axis digital output MEMS gyroscope)
- LIS2DSH (3-axis digital output MEMS accelerometer)
- LIS3DSH (3-axis digital output MEMS accelerometer)
- LIS3MDL (3-axis digital output MEMS magnetometer)
/driver/serial
- UART (Serial UART Driver)
/driver/stepper
- TMC26x (Trinamic TMC26x configurable stepper driver) (Trinamic TOS-100 TMC-26x Shield)
/driver/tlcd
- HD44780 (Dot Matrix LCD Controller/Driver)
Communication Stacks
- CANOpen ( Work in progress ... )
Getting started
Install toolchain
- ALL
sudo apt-get install cmake
- AVR
sudo apt-get install avr-libc binutils-avr gcc-avr avrdude
Tip: Get the latest version of avr-gcc by cross compiling from source or download a pre-compiled toolchain.
- RISCV64 (SiFive)
cd /opt
sudo wget https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.2.0-2019.02.0-x86_64-linux-ubuntu14.tar.gz
sudo tar -xzvf riscv64-unknown-elf-gcc-8.2.0-2019.02.0-x86_64-linux-ubuntu14.tar.gz
export PATH=$PATH:/opt/riscv64-unknown-elf-gcc-8.2.0-2019.02.0-x86_64-linux-ubuntu14/bin
Clone repository
git clone --recurse-submodules https://github.com/snowfox-project/snowfox.git
cd snowfox
Build Example
.ci/script/run-build-example.sh examples/hal/ATMEGA328P/hal-atmega328p-digital-out-pin
Licensing
Snowfox is open source and licensed under version 3 of the GNU GPL. Snowfox is free under this license and can be freely used and distributed under its terms.
The freedom that this GNU GPL license offers, comes with responsibilities and side effects that are not always desirable. This is especially the case if you want to integrate Snowfox in your closed source product and/or don’t want your customers to know that your product contains Snowfox.
As an alternative, Snowfox can be made available under a commercial license. Under the commercial license, Snowfox does not contain any references to the GNU GPL. Refer to the following license comparison matrix to determine the Snowfox license your product requires.
Question | GNU GPL version 3 | Commercial License |
---|---|---|
Is Snowfox free? | yes | no |
Do I have the right to change the Snowfox source code? | yes | yes |
Can I use Snowfox in my closed source product? | no | yes |
Do I have to open my source code? | yes | no |
Do I have to open source my changes to Snowfox? | yes | no |
Do I have to offer the Snowfox source code to users of my product? | yes | no |
Do I have to document that my product uses Snowfox? | yes | no |
Can I redistribute Snowfox in source code format? | yes | no |
Can I receive professional technical support on a commercial basis? | no | yes |
For purchasing a commercial license, requesting a quote tailored for you or simply if you need additional information contact us at consulting@lxrobotics.com.