extmod/machine_spi: Use delay_half, not baudrate, for internal timing.

The delay_half parameter must be specified by the port to set up the
timing of the software SPI.  This allows the port to adjust the timing
value to better suit its timing characteristics, as well as provide a
more accurate printing of the baudrate.
This commit is contained in:
Damien George
2016-10-04 13:43:02 +11:00
parent 9f1e395c16
commit b932b2dd1f
4 changed files with 37 additions and 8 deletions

View File

@@ -37,7 +37,7 @@ typedef struct _mp_machine_spi_p_t {
typedef struct _mp_machine_soft_spi_obj_t {
mp_obj_base_t base;
uint32_t baudrate;
uint32_t delay_half; // microsecond delay for half SCK period
uint8_t polarity;
uint8_t phase;
mp_hal_pin_obj_t sck;