Граф коммитов

16 коммитов

Автор SHA1 Сообщение Дата
Ayke van Laethem
90b42799a2 machine: make machine.I2C0 and similar objects pointers
This makes it possible to assign I2C objects (machine.I2C0,
machine.I2C1, etc.) without needing to take a pointer.

This is important especially in the future when I2C may be driven using
DMA and the machine.I2C type needs to store some state.
2021-03-29 02:02:04 +02:00
ardnew
5279bebf57 move nRF52 ADC methods to common machine file 2021-02-01 12:25:18 +01:00
ardnew
06f231468d
accept configuration struct for ADC parameters (#1533) 2021-01-31 14:54:27 -06:00
Ayke van Laethem
ce539ce583 nrf: refactor code a bit to reduce duplication
The nrf52 series is all very similar and copying the code only makes it
harder to maintain the code or to add more chips in the nrf52 series
(for example, the nrf52833 as used in the micro:bit v2).

This commit also has a small improvement regarding pins: it now includes
chip-level pin names (P0.00, P0.01, etc) to the machine package.
2020-12-22 14:41:06 +01:00
deadprogram
d1c4ed664e all: changeover to eliminate all direct use of master/slave terminology
Signed-off-by: deadprogram <ron@hybridgroup.com>
2020-07-23 22:45:23 +02:00
Ayke van Laethem
38fc340802 sam: return an error when an incorrect PWM pin is used
Previously it would trigger a nil pointer panic.
2020-05-13 19:19:45 +02:00
Scott Yoder
630c498efa
nrf52840: implement USB-CDC (#883)
* machine/nrf52840: usb-cdc implementation
2020-02-17 15:14:24 +01:00
Ayke van Laethem
a5ed993f8d all: add compiler support for interrupts
This commit lets the compiler know about interrupts and allows
optimizations to be performed based on that: interrupts are eliminated
when they appear to be unused in a program. This is done with a new
pseudo-call (runtime/interrupt.New) that is treated specially by the
compiler.
2020-01-20 21:19:12 +01:00
Ayke van Laethem
768c652468 machine: rename CPU_FREQUENCY -> CPUFrequency()
These all-caps constants aren't in the Go style, so rename it to
CPUFrequency (which is more aligned with Go style). Additionally, make
it a function so that it is possible to add support for changing the
frequency in the future.

Tested by running `make smoketest`. None of the outputs did change.
2019-12-16 20:34:39 +01:00
Ayke van Laethem
94b8214529 machine: refactor pins to be of Pin type 2019-05-26 20:48:50 +02:00
Ron Evans
9f8340a970 machine/nrf: refactor to use volatile package/API
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-05-24 15:44:33 +02:00
Ayke van Laethem
b1c70d85f7 nrf: add CPU frequency 2019-02-24 13:45:10 +01:00
Ron Evans
06ab3a836f
machine/nrf: SPI master implementation
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2018-12-02 13:26:08 +01:00
Ayke van Laethem
daf92226d8
nrf: add nrf52840-mdk board
With the help of Chillance on GitHub.
2018-10-18 15:07:06 +02:00
Ayke van Laethem
bc9210b674
nrf: add micro:bit board 2018-10-06 13:04:14 +02:00
Ron Evans
8f7b7e6ee3
nrf52: implement ADC and PWM interfaces
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2018-10-04 13:56:44 +02:00