Setting up a DMA transfer can take longer than sending out a buffer
byte by byte if the buffer is small.
DMA only shows advantages for large buffers, using it for every transfer
will cause a net slowdown.
Since we did not come up with a good way to determine the treshold based
on the SPI frequency, just use a fixed buffer for now so that DMA can be
used without slowing things down overall.
The default driver type is just an index into a device array defined
by the board.
If a platform wants to encode additional information in the device type,
it can define a custom type.
This means we can just set the default type to whatever fits the target
CPU best.
On ARM this will still be a 32 bit word, but on AVR it will by a 8 bit byte.
This API change refactors the usbdev API to supply buffers via the
usbdev_ep_xmit function. This changes from the usbdev_ep_ready call to allow
separate buffers per call. An usbdev_ep_buf_t pseudotype is available and must
be used when defining buffers used for endpoints to adhere to the DMA alignment
restrictions often required with usb peripherals.
Main advantage is that the usbdev peripherals no longer have to allocate
oversized buffers for the endpoint data, potentially saving multiple KiB
of unused buffer space. These allocations are now the responsibility of
the individual USB interfaces in the firmware
This API change refactors the usbdev API to supply buffers via the
usbdev_ep_xmit function. This changes from the usbdev_ep_ready call to allow
separate buffers per call. An usbdev_ep_buf_t pseudotype is available and must
be used when defining buffers used for endpoints to adhere to the DMA alignment
restrictions often required with usb peripherals.
Main advantage is that the usbdev peripherals no longer have to allocate
oversized buffers for the endpoint data, potentially saving multiple KiB
of unused buffer space. These allocations are now the responsibility of
the individual USB interfaces in the firmware
By moving all the single byte struct elements to the end, we can reduce
padding inside `dose_t` and ensure that `recv_buf` is always aligned.
This saves some RAM:
master
------
text data bss dec hex filename
36384 136 12944 49464 c138 tests/driver_dose/bin/samr21-xpro/tests_driver_dose.e
this patch
----------
text data bss dec hex filename
36484 136 12936 49556 c194 tests/driver_dose/bin/samr21-xpro/tests_driver_dose.elf
Some CAN transceivers have a standby pin that has to be pulled low
in order to use it.
If the interface is disabled we can set it to high again to save some
power.
BOARDs with RF switch might only support one of the TX modes, and
on init the BOARD needs to be configured accordingly and the correct
mode selected on TX.
The bogus packed attribute added to lis3dh_data_t resulted in the
structure being aligned two 1 byte. It was later casted to an
uint16_t pointer (which is aligned two 2 bytes). By dropping the
packed attribute the alignment mismatch is fixed.