embello

Embedded software from JeeLabs

Embello Home Page
Hardware Documentation
Forth Library Documentation

ADC interface

This interfaces to the built-in 1 Msps 12-bit ADC of the STM32L0xx ┬ÁC.

API

: adc-init ( -- )  \ initialise ADC
: adc-calib ( -- )  \ perform an ADC calibration cycle
: adc-deinit ( -- )  \ de-initialise ADC
: adc ( pin -- u )  \ read ADC value 2x to avoid chip erratum
: adc-once ( -- u )  \ read ADC value once
: adc-vcc ( -- mv )  \ measure current Vcc
: adc-temp ( -- degc )  \ measure chip temperature

Examples

adc-init
adc .
adc-vcc .
adc-temp .