| ... | ... | @@ -151,8 +151,8 @@ int main() |
|
|
|
```
|
|
|
|
### Notes
|
|
|
|
- The `SPIBus` object must be shared by all slaves on the same bus. Do not create multiple instances of the class `SPIBus` for each sensor.
|
|
|
|
- But each slave can have different configurations
|
|
|
|
- SPITransactions must be scoped (if not, in the first example, the bus may be configured for *slave 2* before the operations with *slave 1* are performed)
|
|
|
|
- Each slave can use a different `SPIBusConfig`
|
|
|
|
- SPITransactions must be scoped (much like mutexes). If not, in the first example, the bus may be configured for *slave 2* before the operations with *slave 1* are performed.
|
|
|
|
- Access through `SPIBusInterface` (second example) is discouraged due to its complexity and because it is error-prone (easy to forget to configure / select / deselect). But it may be necessary in some cases (sensors with non-standard SPI implementation)
|
|
|
|
- Operations on the same bus must be synchronized between multiple threads. It is strongly recommended to perform operations from a single thread to avoid synchronization problems.
|
|
|
|
|
| ... | ... | |