machine/samd51: correct channel init and pin map for ADC based on ItsyBitsy-M4
Signed-off-by: Ron Evans <ron@hybridgroup.com>
Этот коммит содержится в:
родитель
3ec94a06ed
коммит
41df9648a8
2 изменённых файлов: 3 добавлений и 6 удалений
|
@ -28,7 +28,7 @@ const (
|
||||||
// Analog pins
|
// Analog pins
|
||||||
const (
|
const (
|
||||||
A0 = PA02 // ADC/AIN[0]
|
A0 = PA02 // ADC/AIN[0]
|
||||||
A1 = PB05 // ADC/AIN[2]
|
A1 = PA05 // ADC/AIN[2]
|
||||||
A2 = PB08 // ADC/AIN[3]
|
A2 = PB08 // ADC/AIN[3]
|
||||||
A3 = PB09 // ADC/AIN[4]
|
A3 = PB09 // ADC/AIN[4]
|
||||||
A4 = PA04 // ADC/AIN[5]
|
A4 = PA04 // ADC/AIN[5]
|
||||||
|
|
|
@ -386,11 +386,8 @@ func (a ADC) Get() uint16 {
|
||||||
for bus.SYNCBUSY.HasBits(sam.ADC_SYNCBUSY_INPUTCTRL) {
|
for bus.SYNCBUSY.HasBits(sam.ADC_SYNCBUSY_INPUTCTRL) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Selection for the positive ADC input
|
// Selection for the positive ADC input channel
|
||||||
bus.INPUTCTRL.ClearBits(sam.ADC_INPUTCTRL_MUXPOS_Msk)
|
bus.INPUTCTRL.SetBits((uint16(ch) & sam.ADC_INPUTCTRL_MUXPOS_Msk) << sam.ADC_INPUTCTRL_MUXPOS_Pos)
|
||||||
for bus.SYNCBUSY.HasBits(sam.ADC_SYNCBUSY_ENABLE) {
|
|
||||||
}
|
|
||||||
bus.INPUTCTRL.SetBits(uint16(ch << sam.ADC_INPUTCTRL_MUXPOS_Pos))
|
|
||||||
for bus.SYNCBUSY.HasBits(sam.ADC_SYNCBUSY_ENABLE) {
|
for bus.SYNCBUSY.HasBits(sam.ADC_SYNCBUSY_ENABLE) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче