machine: split board definitions in separate files

This commit is contained in:
Ayke van Laethem
2018-09-22 15:41:52 +02:00
parent 2c21925f4c
commit 8f5bd81bf5
6 changed files with 45 additions and 35 deletions
-13
View File
@@ -13,9 +13,6 @@ const (
GPIO_OUTPUT
)
// LED on the Arduino
const LED = 13
func (p GPIO) Configure(config GPIOConfig) {
if config.Mode == GPIO_OUTPUT { // set output bit
if p.Pin < 8 {
@@ -125,16 +122,6 @@ func (pwm PWM) Set(value uint16) {
}
}
// ADC on the Arduino
const (
ADC0 = 0
ADC1 = 1
ADC2 = 2
ADC3 = 3
ADC4 = 4
ADC5 = 5
)
// InitADC initializes the registers needed for ADC.
func InitADC() {
// set a2d prescaler so we are inside the desired 50-200 KHz range at 16MHz.