summaryrefslogtreecommitdiff
path: root/stmhal
AgeCommit message (Collapse)Author
2016-10-04stmhal/usb: Add support to receive USB HID messages from host.Philip Potter
2016-10-04stmhal/usbdev: Add OUT endpoint to HID interface.Philip Potter
2016-10-04stmhal: Fix linker map for STM32L476 chips.Dave Hylands
In particular, this makes the L4 .isr_vector section 16K in size so it's the same as the F4/F7 MCUs. The patch also moves the L4 filesystem to the end of flash, which allows for 512K filesystem on the 1Mb devices like the STM32L476DISC.
2016-10-04stmhal/spi: Enable use of fast software SPI.Damien George
2016-10-04extmod/machine_spi: Use delay_half, not baudrate, for internal timing.Damien George
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.
2016-10-04stmhal/spi: Use software SPI if no periph id given, even if pins given.Damien George
It's simpler to just default to always using software SPI if no specific peripheral id/name is given. To use hardware SPI users must specify a hardware peripheral id as the first parameter to the SPI constructor.
2016-10-03stmhal/mphalport: Fix mp_hal_pin_write to use correct pin_mask.Damien George
2016-10-03stmhal/spi: Make machine.SPI class conform to correct API.Damien George
Includes both software and hardware SPI implementations.
2016-10-03stmhal/mphalport: Implement mp_hal_pin_{input,output,write}.Damien George
2016-10-03stmhal/spi: Simplify spi_transfer function to take only one buf len arg.Damien George
2016-10-03extmod/machine_spi: Simplify SPI xfer function to only take one buf len.Damien George
There is no need to take src_len and dest_len arguments. The case of reading-only with a single output byte (originally src_len=1, dest_len>1) is now handled by using the output buffer as the input buffer, and using memset to fill the output byte into this buffer. This simplifies the implementations of the spi_transfer protocol function.
2016-09-30lib/cmsis: move CMSIS headers to lib/Krzysztof Blazewicz
Files in lib/cmsis are generic for all Cortex-M MCU's files left in stmhal/cmsis are all STM32 specific.
2016-09-28stmhal: Remove CMSIS STM32F2xx files, they are unused/unsupported.Damien George
2016-09-27stmhal: Add virtual com port support for STM32L476DISC.Nicholas Graumann
2016-09-27stmhal/modmachine: Fix clearing of reset-cause flags.Damien George
To reset the flags we should write to the single bit only, not the entire register (otherwise all other settings in the register are cleared). Fixes #2457.
2016-09-22stmhal: Remove STM32CubeF2 HAL files, they are unused/unsupported.Krzysztof Blazewicz
2016-09-22stmhal: Put common definitions from linker files to common.ld.Krzysztof Blazewicz
2016-09-22all: Remove 'name' member from mp_obj_module_t struct.Damien George
One can instead lookup __name__ in the modules dict to get the value.
2016-09-20stmhal: Use attribute to avoid inlining.Stefan Agner
Use MP_NOINLINE macro to avoid inlining of init_flash_fs. This helps to keep stack usage of main() low.
2016-09-19stmhal/boards: For OLIMEX_E407, enable UART1 and fix I2C1 mapping.Damien George
UART1 can be used even if the switch is enabled. The schematics for this board make I2C1 available on PB8/PB9, even though it can also be mapped to PB6/PB7. See #2396 and #2427.
2016-09-14stmhal/boards: Add pllvalues.py script to compute PLL values for sysclk.Damien George
The algorithm here should mirror that in the machine.freq() function.
2016-09-09stmhal/extint: Force 0 to 1 transition on swint().Krzysztof Blazewicz
If a user tries to call `swint()` while interrupt is disabled the flag in SWIER is set but the interrupt is not triggered and therefore the SWIER bit is not cleared. When the interrupt is again enabled the next call to `swint()` won't trigger the IRQ because a 0 to 1 transition will not occur.
2016-09-09stmhal/{accel,lcd}: use GPIO_{set,clear}_pinKrzysztof Blazewicz
different HAL versions implement GPIO differently (BSRR vs BSRRH+BSRRL), this way both drivers are portable between different HAL's
2016-09-09stmhal/lcd: De-assert chip select after completing SPI transmission.Tom Soulanille
The LCD interface library fails to deassert the chip select of the LCD after an SPI transmission. Consequently using the SPI with other peripherals disturbs the state of the LCD. This patch changes lcd.lcd_out() to deassert CS after each transmission to the LCD.
2016-09-08stmhal,cc3200,esp8266: Consistently use PWRON_RESET constant.Damien George
machine.POWER_ON is renamed to machine.PWRON_RESET to match other reset-cause constants that all end in _RESET. The cc3200 port keeps a legacy definition of POWER_ON for backwards compatibility.
2016-09-06stmhal/modmachine: Implement machine.reset_cause() function, and consts.Damien George
2016-09-06stmhal/wdt: Implement keyword args to WDT constructor.Damien George
2016-09-05stmhal/dac: Fix DAC (re-)initialisation by resetting DMA.Peter Hinch
Fixes issue #2176.
2016-09-05unix,stmhal,esp8266: When find'ing frozen files follow symbolic links.Damien George
It's useful to be able to use symbolic links to add files and directories to the set of scripts to be frozen.
2016-09-05py: Add MICROPY_USE_INTERNAL_PRINTF option, defaults to enabled.Delio Brignoli
This new config option allows to control whether MicroPython uses its own internal printf or not (if not, an external one should be linked in). Accompanying this new option is the inclusion of lib/utils/printf.c in the core list of source files, so that ports no longer need to include it themselves.
2016-09-04stmhal: Set STM32F7DISC CPU Frequency to 216 MHzDave Hylands
This set the CPU frequency to 216 MHz (the max) and leaves the USB Frequency at 48 MHz. These settings were copied from one of the HAL examples.
2016-09-04stmhal: Add machine.WDT class.Damien George
Usage: import machine wdt = machine.WDT(0, 5000) # 5 second timeout wdt.feed() Thanks to Moritz for the initial implementation.
2016-09-01stmhal/spi: Support new machine SPI methods in legacy SPI object.Damien George
2016-09-01stmhal/spi: Factor out SPI transfer code to a single function.Damien George
2016-08-31unix,stmhal,esp8266: When find'ing frozen files don't use extra slash.Damien George
This extra forward slash for the starting-point directory is unnecessary and leads to additional slashes on Max OS X which mean that the frozen files cannot be imported. Fixes #2374.
2016-08-29stmhal: Update boot.py files to use VCP instead of CDC.Philip Potter
2016-08-26stmhal/modusocket: set self->nic to MP_OBJ_NULL after socket closeKrzysztof Blazewicz
This patch makes second and next calls to <socket>.close() a no-op. It prevents GC from closing the underlying resource after user already used <socket>.close() explicitly. fixes #2355
2016-08-25stmhal: Update pin print to print new constantsDave Hylands
This updates the print function for machine.Pin to print out the new constants from the Hardware API defintion rather than the legacy definitions.
2016-08-25stmhal: Make ADC channel 16 available on L4 MCUs.Matt Brejza
2016-08-22stmhal: Remove obsolete code for special handling of TIM3 irq settings.Damien George
TIM3 is no longer special, or at least does not have special IRQ settings.
2016-08-22stmhal: Fix timer capture/compare interrupt handling for TIM1 and TIM8.Dave Hylands
It turns out that TIM1 and TIM8 have their own Capture/Compare interrupt vector. For all of the other timers, the capture/compare interrupt vector is the same as the update vector. So we need to add handlers for these vectors and enable them when using capture/compare callbacks. During testing of this, I also found that passing a channel callback into the channel constructor would not enable interrupts properly. I tested using: ``` >>> pyb.Timer(1, freq=4).channel(1, pyb.Timer.OC_TOGGLE, callback=lambda t: print('.', end='')) ``` I tested the above with channels 1, 4, and 8
2016-08-15ports: Remove typedef of machine_ptr_t, it's no longer needed.Damien George
This type was used only for the typedef of mp_obj_t, which is now defined by the object representation. So we can now remove this unused typedef, to simplify the mpconfigport.h file.
2016-08-11stmhal/adc.c: Get ADC working on STM32L4 MCUs.Tobias Badertscher
Fixing Issue #2243. Main problems were: - HAL_ADC_GetState(adcHandle) may return other bits set (not only HAL_ADC_STATE_EOC_REG) when called - so I AND-ed it out as proposed by mattbrejza in Issue #2243. - ADC Pin has to be configured as GPIO_MODE_ANALOG_ADC_CONTROL not only GPIO_MODE_ANALOG. - Resolved ADC resolution L4 specific (Use L4 define ADC_RESOLUTION_12B). - Changed setting of Init.EOCSelection toADC_EOC_SINGLE_CONV for L4. - Added call to ADC_MultiModeTypeDef as this is done on a STM32Cube generated project too. - Clean up: Configuration of ADC is done only in ONE function not the same is done in two functions. Test is done on PA5 pin of STM32L4Discovery-Kit which is connected to the DOWN button. Thanks to mattbrejza for discovering the bug.
2016-08-11stmhal/boards: Update STM32L476 pin defs to include ADC channels.Damien George
This patch introduces proper ADC Pin definitions in stm32l476_af.csv. Originally provided by @tobbad.
2016-08-04stmhal: Fix I2C mappings for STM32F429DISC board.David Siorpaes
2016-07-30stmhal: Make SPI NSS pin definition optional.Dave Hylands
Some boards (like the GHI Electronics G30 Dev Board) don't use NSS at all and rather just use GPIO chip selects.
2016-07-30stmhal: fixing malloc when used with external librariesMatt Brejza
2016-06-29stmhal: Enable SD card on L4 MCUs.dpslwk
2016-06-29stmhal: Correct DMA to allow SD card on L4 MCUs.dpslwk
2016-06-29stmhal: Update HALCOMMITS due to change to haldpslwk