diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/pyb/i2c.py | 2 | ||||
| -rw-r--r-- | tests/pyb/i2c_accel.py | 2 | ||||
| -rw-r--r-- | tests/pyb/i2c_error.py | 2 | ||||
| -rw-r--r-- | tests/pyb/pyb_f405.py | 2 | ||||
| -rw-r--r-- | tests/pyb/spi.py | 14 | ||||
| -rw-r--r-- | tests/pyb/spi.py.exp | 4 |
6 files changed, 14 insertions, 12 deletions
diff --git a/tests/pyb/i2c.py b/tests/pyb/i2c.py index bc9dba878..c96884327 100644 --- a/tests/pyb/i2c.py +++ b/tests/pyb/i2c.py @@ -11,6 +11,6 @@ for bus in (-1, 0, 1): i2c = I2C(1) -i2c.init(I2C.MASTER, baudrate=400000) +i2c.init(I2C.CONTROLLER, baudrate=400000) print(i2c.scan()) i2c.deinit() diff --git a/tests/pyb/i2c_accel.py b/tests/pyb/i2c_accel.py index 8c74fa60e..8b87d406d 100644 --- a/tests/pyb/i2c_accel.py +++ b/tests/pyb/i2c_accel.py @@ -11,7 +11,7 @@ accel_addr = 76 pyb.Accel() # this will init the MMA for us -i2c = I2C(1, I2C.MASTER, baudrate=400000) +i2c = I2C(1, I2C.CONTROLLER, baudrate=400000) print(i2c.scan()) print(i2c.is_ready(accel_addr)) diff --git a/tests/pyb/i2c_error.py b/tests/pyb/i2c_error.py index b17a26325..1228962f5 100644 --- a/tests/pyb/i2c_error.py +++ b/tests/pyb/i2c_error.py @@ -11,7 +11,7 @@ if not hasattr(pyb, "Accel"): pyb.Accel() # get I2C bus -i2c = I2C(1, I2C.MASTER, dma=True) +i2c = I2C(1, I2C.CONTROLLER, dma=True) # test polling mem_read pyb.disable_irq() diff --git a/tests/pyb/pyb_f405.py b/tests/pyb/pyb_f405.py index 243381056..d7431a11a 100644 --- a/tests/pyb/pyb_f405.py +++ b/tests/pyb/pyb_f405.py @@ -10,7 +10,7 @@ print(pyb.freq()) print(type(pyb.rng())) # test HAL error specific to F405 -i2c = pyb.I2C(2, pyb.I2C.MASTER) +i2c = pyb.I2C(2, pyb.I2C.CONTROLLER) try: i2c.recv(1, 1) except OSError as e: diff --git a/tests/pyb/spi.py b/tests/pyb/spi.py index 73d39e724..7df6aeb45 100644 --- a/tests/pyb/spi.py +++ b/tests/pyb/spi.py @@ -11,12 +11,14 @@ for bus in (-1, 0, 1, 2): spi = SPI(1) print(spi) -spi = SPI(1, SPI.MASTER) -spi = SPI(1, SPI.MASTER, baudrate=500000) -spi = SPI(1, SPI.MASTER, 500000, polarity=1, phase=0, bits=8, firstbit=SPI.MSB, ti=False, crc=None) -print(str(spi)[:28], str(spi)[49:]) # don't print baudrate/prescaler +spi = SPI(1, SPI.CONTROLLER) +spi = SPI(1, SPI.CONTROLLER, baudrate=500000) +spi = SPI( + 1, SPI.CONTROLLER, 500000, polarity=1, phase=0, bits=8, firstbit=SPI.MSB, ti=False, crc=None +) +print(str(spi)[:32], str(spi)[53:]) # don't print baudrate/prescaler -spi.init(SPI.SLAVE, phase=1) +spi.init(SPI.PERIPHERAL, phase=1) print(spi) try: # need to flush input before we get an error (error is what we want to test) @@ -25,7 +27,7 @@ try: except OSError: print("OSError") -spi.init(SPI.MASTER) +spi.init(SPI.CONTROLLER) spi.send(1, timeout=100) print(spi.recv(1, timeout=100)) print(spi.send_recv(1, timeout=100)) diff --git a/tests/pyb/spi.py.exp b/tests/pyb/spi.py.exp index 473c173a5..661bace90 100644 --- a/tests/pyb/spi.py.exp +++ b/tests/pyb/spi.py.exp @@ -3,8 +3,8 @@ ValueError 0 SPI 1 SPI 2 SPI(1) -SPI(1, SPI.MASTER, baudrate= , polarity=1, phase=0, bits=8) -SPI(1, SPI.SLAVE, polarity=1, phase=1, bits=8) +SPI(1, SPI.CONTROLLER, baudrate= , polarity=1, phase=0, bits=8) +SPI(1, SPI.PERIPHERAL, polarity=1, phase=1, bits=8) OSError b'\xff' b'\xff' |
