Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
.cargo
src
Cargo.lock
Cargo.toml
Makefile
README.md
Xargo.toml
build.rs
memory.x
recv.py

README.md

The file src/main.rs demonstrates how to use the platform agnostic ADC driver adc-mcp3008 together with the embedded-hal implementation stm32f30x-hal.

You need an STM32F3Discovery (or compatible) board to run the code.

Compiling code for embedded platforms requires specific versions of "nightly" Rust - code can break mysteriously when the nightly version is changed. Please refer this post for the setup which I have used successfully.

You can compile the code by running:

make release

The code can be flashed by running:

make flash_release

You need the st-flash utility to flash the code.

The code will simply read from channel 0 of the MCP3008 ADC and send the data out through the serial port. You can print it out by running:

python recv.py

The Python serial module should be installed.

A USB-to-serial converted should be used to interface the UART pins of the discovery board with the USB port of the PC/Laptop.