Commit Graph

10 Commits

Author SHA1 Message Date
Daniel Campora
c754d8011d cc3200: Simplify SPI polarity and phase checks in constructor. 2015-05-27 09:45:32 +02:00
Daniel Campora
9414f92fa9 cc3200: Fix I2C and SPI module references. 2015-05-27 09:45:27 +02:00
Daniel Campora
fabe79f7af cc3200: Clean up exception handling. 2015-05-26 12:29:20 +02:00
Daniel Campora
124aa000af cc3200: Use polarity and phase instead of submode in the SPI construct. 2015-05-26 11:30:48 +02:00
Daniel Campora
2dd47239de cc3200: Make API more similar to stmhal.
In general the changes are:

1. Peripheral (UART, SPI, ADC, I2C, Timer) IDs start from 1, not zero.
2. Make I2C and SPI require the ID even when there's only one bus.
3. Make I2C and SPI accept 'mode' parameter even though only MASTER
   is supported.
2015-05-25 21:47:19 +02:00
Damien George
7f9d1d6ab9 py: Overhaul and simplify printf/pfenv mechanism.
Previous to this patch the printing mechanism was a bit of a tangled
mess.  This patch attempts to consolidate printing into one interface.

All (non-debug) printing now uses the mp_print* family of functions,
mainly mp_printf.  All these functions take an mp_print_t structure as
their first argument, and this structure defines the printing backend
through the "print_strn" function of said structure.

Printing from the uPy core can reach the platform-defined print code via
two paths: either through mp_sys_stdout_obj (defined pert port) in
conjunction with mp_stream_write; or through the mp_plat_print structure
which uses the MP_PLAT_PRINT_STRN macro to define how string are printed
on the platform.  The former is only used when MICROPY_PY_IO is defined.

With this new scheme printing is generally more efficient (less layers
to go through, less arguments to pass), and, given an mp_print_t*
structure, one can call mp_print_str for efficiency instead of
mp_printf("%s", ...).  Code size is also reduced by around 200 bytes on
Thumb2 archs.
2015-04-16 14:30:16 +00:00
Daniel Campora
2d717ad97a cc3200: Add callback support to the UART for RX interrupts. 2015-03-26 10:28:43 +01:00
Daniel Campora
e909e38871 cc3200: Remove superflous parameters from the SPI API. 2015-03-26 10:28:41 +01:00
Daniel Campora
7f41f650de cc3200: Remove superflous params from the I2C API. 2015-03-25 16:56:14 +01:00
danicampora
cd9bc14c8f cc3200: Add SPI module.
Only MASTER mode is supported. Transfer width is configurable to
8, 16 or 32 bits.
2015-03-21 11:26:47 +01:00