Implement the usbfs fast buffer switching mechanism on the "bulk out"
endpoint. This can improve the overall USB throughput and bus
utilization.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The usbfs device supports two buffers for each endpoint - typically
one for rx and one for tx. Add support for explicit handling of both
buffers. This is in preparation for improved "double buffering"
support.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Replace the set_stat_x_bits() functions with a single calc_epr_bits()
function. This new function supports setting bits other than the stat
field in the epr register.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Use a fixed layout for the USB transfer memory and remove the ep_mem
struct definition.
This is in preparation for stm32g0 support.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The stm32f0 line uses 16bit packet memory reads/writes (as opposed to
the goofy 32bit accesses required on the stm32f103).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The usbfs receive buffers must also have space for the 2 byte crc at
the end of a transmission. This fixes an error that could lead to
lost messages from mcu to host (resulting in bytes_invalid increasing
in stats) on the stm32f103.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Now that the code in stm32f4/ can handle both stm32f1 and stm32f4
chips, rename the directory to just "stm32".
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>