* Add support for CEVA BNO08x 9DoF sensor. Also includes implementation of CEVA SH-2 and SHTP protocols.
* Replace machine.I2C with drivers.I2C interface to remove dependency on machine package
* Replace Pin functionality with that provided by tinygo.org/x/drivers/internal/pin
* Unexport fields on SensorValue and replace with accessor methods. Add check for correct SensorID validation
* Add example to smoketest.sh
* Change build target for smoketest to match development environment.. Probably not important, but matches reality.
* Fix decoding of some sensor data: Step Counter, Tap Detector, Flip Detector. These are experimental.
* Refactor to allow SPI/UART etc. SPI is currently under development, but is omitted from this commit.
Example code has been moved to i2c subdirectory.
This commit introduces some major refactoring changes. It introduces a "Buser" interface and tries to remove any I2C specific code from the core. It still retains a couple of I2C specific fields in the "Config" struct ("Address" and "ReadChunk") but they are ignored in the as yet uncommited SPI code.
* Fix CRLF -> LF for gofmt
* Update smoketest to point to new example file
* Added alarm features
* more functions
* chore: fix typo
* feat(ds3231): add Alarm2Mode type and mode consts
* docs(ds3231): add docstrings for SQW functions
* feat(ds3231): add methods for Alarm2
* fix(ds3231): use Alarm2Mode for SetAlarm2 method
* docs(ds3231): add example for alarms
* docs(ds3231): refactor alarms example
* make main function more concise to avoid llvm error for pico
* ci(ds3231): split basic and alarm tests
* style(ds3231): reorder private funcs to the bottom
* docs(ds3231): add docstring for alarm modes
* docs(ds3231): make alarm docstrings more descriptive
* chore(ds3231): fix typo in docstring
* style(ds3231): reorder public functions
* style(ds3231): reorder private methods
* chore(ds3231): add missing error handling
* feat(ds3231): use setter funcs for en/disabling instead of separate funcs
* fix(ds3231): correctly enable alarms in example
* style(ds3231): rename SetEnable32K to SetEnabled32K for consistency
* refactor(ds3231): replace legacy with regmap package
* refactor(ds3231): use Write32 instead of Tx for SetAlarm1
* chore(ds3231): remove fmt deps and and use println in examples
* refactor(ds3231): read temperature as uint16
---------
Co-authored-by: Matthias Fulz <mfulz@olznet.de>
* si5351: add support for si5351
Adds support for the si5351 I2C programmable clock generator using code
from @chiefMarlin which used code from @conotto which somehow never got merged.
Thank you everyone!
Signed-off-by: deadprogram <ron@hybridgroup.com>
* refactor: use regmap instead of legacy package to avoid heap allocations
Signed-off-by: deadprogram <ron@hybridgroup.com>
---------
Signed-off-by: deadprogram <ron@hybridgroup.com>
Instead of printing an error, this driver really should be returning
errors instead. Also, `Configure` didn't have a way to actually
configure the driver. This is now added, and can be expanded in the
future.
This is a breaking change.
fixed the spelling in the Connection error message; Initial support for LSM303DLHC added;
Added LSM303DLHC to smoketest and added an example;
Removed unnecessary comments;
fixed format error;
squashed and ready for merge;
* ssd1306: avoid unnecessary heap allocations
* ssd1306: extract i2c and spi bus implementations
* ssd1306: refactor tests -- show fps and heap usage
* ssd1306: bring back the lost exported methods
* Adjust examples
* Fix smoketests for ssd1306
Adafruit's Mini GPS PA1010D Module works with this device driver, but requires 0x10 as the address, rather than 0x42.
This change allows the device to be initialised with whatever i2c address is needed, while maintaining backward compatibility.
Adds new constants to allow easy configuration of both the ublox device and the PA1010D.
TMC5160: Added TMC5160 support
* Added example code for tmc5160 and smoke test
* Update go.mod
* Updated mod file
* Cleaned up commented out code and updated readme.
* ran go fmt
* Fixed setrampspeed func
* Removed spi1 pin setup in example.go. Renamed SPIComm to spicomm.go
* Removed unused test file
* Removed commented line
Tested on the following chips/boards:
* RP2040 (Raspberry Pi Pico)
* ATSAMD21 (Adafruit PyBadge)
* NRF52840 (PCA10056 developer board)
* ESP8266 (NodeMCU)
* ATmega328p (Arduino Uno)
* ESP32C3 (WaveShare ESP-C3-32S-Kit)
* FE310 (SiFive HiFive1 rev B)
The sensitivity threshold in the example may need to be adjusted per
board though, the default value of 100 typically recognizes when a cable
is being touched but the RP2040 for example is capable of doing much
more precise measurements if the power supply is sufficiently
noise-free.
According to man page accept(2), accept returns new client sockfd and
remote peer ip:port. This patch corrects the Accept() prototype in the
netdever interface to not take in an ip:port arg, but rather return an
ip:port for remote peer.
Tested with examples/net/tcpecho on wioterminal and nano-rp2040. Here's
a run with wioterminal:
SERVER
============
sfeldma@nuc:~/work/drivers$ tinygo flash -monitor -target wioterminal -size short -stack-size=8kb ./examples/net/tcpecho
code data bss | flash ram
110876 2552 11212 | 113428 13764
Connected to /dev/ttyACM2. Press Ctrl-C to exit.
Realtek rtl8720dn Wifi network device driver (rtl8720dn)
Driver version : 0.0.1
RTL8720 firmware version : 2.1.2
MAC address : 2c:f7:f1:1c:9b:2f
Connecting to Wifi SSID 'test'...CONNECTED
DHCP-assigned IP : 10.0.0.140
DHCP-assigned subnet : 255.255.255.0
DHCP-assigned gateway : 10.0.0.1
Starting TCP server listening on :8080
Client 10.0.0.190:50000 connected
Client 10.0.0.190:50000 closed
CLIENT
=============
nc -p 50000 10.0.0.140 8080
This moves the netdev/netlink namespace out of drivers and into their
own packages. Also, defines netdev and netlink as L3/L4 and L2 OSI
layers, respectively. Move some L3 functionality from netlink to
netdev (GetIPAddr).
For netlink, add ConnectParams for NetConnect to pass in L2 connection
parameters (ssid, pass, auth_type, etc). Also adds connection mode
(STA, AP, etc).
For netlink, add SendEth and RecvEthFunc funcs to handle L2 send/recv of
Ethernet pkts.
Tested with a rp2040.
TODO: add the ability to set the absolute humidity for more accurate
sensor details. The formula for that is rather complex, so I've left
this as a future addition.
Replace DrawRGBBitmap8 with DrawBitmap, following the change in the
previous commit.
This improves performance from 86fps to 100fps! I didn't investigate
why, but I suspect it's because it now needs only a single store instead
of two to update a pixel.