File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -497,10 +497,16 @@ backticks ``:class:`~adafruit_motor.servo.Servo```. You must also add the refer
497
497
Use ``adafruit_register `` when possible
498
498
--------------------------------------------------------------------------------
499
499
`Register <https://github.com/adafruit/Adafruit_CircuitPython_Register >`_ is
500
- a foundational library that manages packing and unpacking data from device
501
- registers. When possible, use it for unpacking and packing registers. This
502
- ensures the packing code is shared amongst all registers. Furthermore, it
503
- simplifies device definitions by making them declarative (only data.)
500
+ a foundational library that manages packing and unpacking data from I2C device
501
+ registers. There is also `Register SPI <https://github.com/adafruit/Adafruit_CircuitPython_Register_SPI >`_
502
+ for SPI devices. When possible, use one of these libraries for unpacking and
503
+ packing registers. This ensures the packing code is shared amongst all
504
+ registers (even across drivers). Furthermore, it simplifies device definitions
505
+ by making them declarative (only data.)
506
+
507
+ Values with non-consecutive bits in a register or that represent FIFO endpoints
508
+ may not map well to existing register classes. In unique cases like these, it is
509
+ ok to read and write the register directly.
504
510
505
511
*Do not * add all registers from a datasheet upfront. Instead, only add the ones
506
512
necessary for the functionality the driver exposes. Adding them all will lead to
You can’t perform that action at this time.
0 commit comments