summaryrefslogtreecommitdiff
path: root/tests/pyb
AgeCommit message (Collapse)Author
2024-01-22tests: Move port-specific test directories into tests/ports/ directory.Damien George
To keep them all together, mirroring the top-level directory structure. Signed-off-by: Damien George <damien@micropython.org>
2023-02-02top: Update Python formatting to black "2023 stable style".Jim Mussared
See https://black.readthedocs.io/en/stable/the_black_code_style/index.html Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-04-02tests/pyb: Update CAN tests to match revised CAN API.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-07-18stm32: Replace master/slave with controller/peripheral in I2C and SPI.David P
Replace "master" with "controller" and "slave" with "peripheral" in comments, errors, and debug messages. Add CONTROLLER and PERIPHERAL constants to pyb.SPI and pyb.I2C classes; retain MASTER and SLAVE constants for backward compatiblity.
2020-03-30tests: Format all Python code with black, except tests in basics subdir.David Lechner
This adds the Python files in the tests/ directory to be formatted with ./tools/codeformat.py. The basics/ subdirectory is excluded for now so we aren't changing too much at once. In a few places `# fmt: off`/`# fmt: on` was used where the code had special formatting for readability or where the test was actually testing the specific formatting.
2019-12-20tests/pyb: Adjust UART and Timer tests to work on PYBD_SF6.Damien George
2019-12-13tests/pyb: Refactor pyboard tests to work on PYBv1, PYBLITEv1 and PYBD.Damien George
2019-10-31stm32/timer: Fix Timer.freq() calc so mult doesn't overflow uint32_t.Damien George
Fixes issue #5280.
2019-05-14tests/pyb: Update UART expected output now that default timeout is 0.Damien George
Follow up to commit 34942d0a72980173eca51b201f271f67bcae46b5
2018-12-05stm32/uart: Add rxbuf keyword arg to UART constructor and init method.Damien George
As per the machine.UART documentation, this is used to set the length of the RX buffer. The legacy read_buf_len argument is retained for backwards compatibility, with rxbuf overriding it if provided.
2018-12-04stm32/uart: Always show the flow setting when printing a UART object.Damien George
Also change the order of printing of flow so it is after stop (so bits, parity, stop are one after the other), and reduce code size by using mp_print_str instead of mp_printf where possible. See issue #1981.
2018-06-08tests/pyb: Make i2c and pyb1 pyboard tests run again.Damien George
For i2c.py: the accelerometer now uses the new I2C driver so need to explicitly init the legacy i2c object to get the test working. For pyb1.py: the legacy pyb.hid() call will crash if the USB_HID object is not initialised.
2018-05-02tests/pyb: Update tests to run correctly on PYBv1.0.Damien George
In adcall.py the pyb module may not be imported, so use ADCAll directly. In dac.py the DAC object now prints more info, so update .exp file. In spi.py the SPI should be deinitialised upon exit, so the test can run a second time correctly.
2018-04-11tests/pyb: Add test for pyb.ADCAll class.Damien George
2018-04-11stm32/dac: Add buffering argument to constructor and init() method.Damien George
This can be used to select the output buffer behaviour of the DAC. The default values are chosen to retain backwards compatibility with existing behaviour. Thanks to @peterhinch for the initial idea to add this feature.
2018-04-11stm32/adc: Add read_timed_multi() static method, with docs and tests.Peter Hinch
2018-04-11tests/pyb/adc.py: Fix test so that it really does test ADC values.Damien George
Reading into a bytearray will truncate values to 0xff so the assertions checking read_timed() would previously always succeed. Thanks to @peterhinch for finding this problem and providing the solution.
2018-03-19tests/pyb/can: Update to test pyb.CAN restart, state, info, inplace recvDamien George
2018-03-16tests/pyb: Update CAN test to expect that auto_restart is printed.Damien George
2017-06-10tests: Convert remaining "sys.exit()" to "raise SystemExit".Paul Sokolovsky
2017-05-29various: Spelling fixesVille Skyttä
2017-02-06tests/pyb: Adjust tests so they can run on PYB and PYBLITE.Damien George
A few tests still fail on PYBLITE, and that's due to differences in the available peripheral block numbers on the different MCUs (eg I2C(2) exists on one, but it's I2C(3) on the other).
2017-02-06stmhal: Add pyb.fault_debug() function, to control hard-fault behaviour.Damien George
This new function controls what happens on a hard-fault: - debugging disabled: board will do a reset - debugging enabled: board will print registers and stack and flash LEDs The default is disabled, ie to do a reset. This is different to previous behaviour which flashed the LEDs and waited indefinitely.
2017-01-04tests/pyb/uart: Update test to match recent change to UART timeout_char.Damien George
2016-11-11stmhal/i2c: Add option to I2C to enable/disable use of DMA transfers.Damien George
New keyword option in constructor and init() method is "dma=<bool>". DMA is now disabled by default for I2C transfers because it currently does not handle I2C bus errors very well (eg if slave device doesn't ACK or NACK correctly during a transfer).
2016-09-09tests/pyb: Update exp file for previously updated extint test.Damien George
2016-09-09tests/pyb: Add test for ExtInt when doing swint while disabled.Damien George
2016-06-03tests/pyb/rtc: Make RTC test on pyboard more reliable by calling init().Damien George
2016-05-10stmhal: Convert to use internal errno symbols; enable uerrno module.Damien George
2016-05-08stmhal/can: Allow to get existing CAN obj if constructed without args.Henrik Sölver
Initialisation of CAN objects should now behave as other peripheral objects. Fixes issue #2001.
2016-02-10tests/pyb: Add simple test for stm module on pyboard.Damien George
2016-01-30tests: For pyboard, add test for I2C error handling and recovery.Damien George
2016-01-29tests: Update pyboard LED test.Damien George
2015-11-30stmhal: Make uart.write() function correctly for timeout=0.Damien George
In non-blocking mode (timeout=0), uart.write() can now transmit all of its data without raising an exception. uart.read() also works correctly in this mode. As part of this patch, timout_char now has a minimum value which is long enough to transfer 1 character. Addresses issue #1533.
2015-11-30stmhal: uart.any() function now returns number of bytes available.Ryan Shaw
2015-11-02stmhal/can: Fix a bug in filter handling.Henrik Sölver
Reported here: http://forum.micropython.org/viewtopic.php?f=2&t=845
2015-10-09tests: In pyb RTC tests, check wakeup register values.Peter Hinch
2015-08-05tests: Add test for pyboard SPI in slave mode, recv with no master.Damien George
See PR #1414.
2015-05-28tests: Add tests to create valid and invalid UART, I2C, SPI, CAN busses.Damien George
2015-05-21lib: Fix some issues in timeutilsDave Hylands
In particular, dates prior to Mar 1, 2000 are screwed up. The easiest way to see this is to do: >>> import time >>> time.localtime(0) (2000, 1, 1, 0, 0, 0, 5, 1) >>> time.localtime(1) (2000, 1, 2, 233, 197, 197, 6, 2) With this patch, we instead get: >>> import time >>> time.localtime(1) (2000, 1, 1, 0, 0, 1, 5, 1) Doh - In C % is NOT a modulo operator, it's a remainder operator.
2015-05-11sthmal/rtc.c: Add calibration() method to get/set RTC fine-tuning value.blmorris
2015-04-18stmhal: Add support for sending and receiving CAN RTR messages.Henrik
2015-04-16stmhal: Allow sending CAN messages with timeout=0.Damien George
Thanks to Henrik Sölver for this patch.
2015-04-11stmhal: Make LED object print LED(x) for consistency with constructor.Damien George
2015-03-20tests: Make pyb/timer test check callback timing properly.Damien George
2015-03-13stmhal: Fix adc.read_timed so buffer store respects element size.Damien George
Addresses issue #1154.
2015-02-27tests: Update pyb/uart.py test since baudrate of 1200 is too low.Damien George
2015-02-23tests: Add more tests for pyb.Timer class.Damien George
2015-02-15stmhal: Add support for CAN rx callbacks.Henrik Sölver
2015-02-13stmhal: Add uart.sendbreak() method, to send a break condition.Damien George