Commit Graph

3772 Commits (9d06547135c6549b2f28aa4c0b8cc9578afe0d06)

Author SHA1 Message Date
mtkrtk 1a3a19bb08 Fix analogin peripheral names 2016-02-29 17:06:32 +09:00
dc37 775c5c9eb2 Fix clock configuration for LPC1549.
Datasheet (Table 82) says MSEL bits should be 5, and the PSEL bits should
be 1, for the correct FCCO frequency of 288MHz. The current configuration
has FCCO = 144MHz, which is technically out of spec.
Tested on a custom LPC1549 board with crystal oscillator running at 12MHz.
2016-02-26 19:42:26 -06:00
Martin Kojtal bd0417cb15 Merge pull request #1520 from adustm/b_b96b_can
[STM B96B_F446VE] Add CAN feature
2016-02-26 17:07:15 +00:00
adustm d53f444a6f [STM32F7 family] revert RTC change in this PR that is due to new platform. It will be done through a separate PR. 2016-02-26 11:36:59 +00:00
adustm 3b3f89294e [NUCLEO_F746ZG] fix pins and system files after manual and automatic test phase 2016-02-26 11:36:57 +00:00
adustm 1ecd69bd87 [STMF7 family] add more SPI and I2C for the new NUCLEO_F746ZG platform 2016-02-26 11:36:54 +00:00
adustm d47d87c869 [NUCLEO_F746ZG] 8MHz, not 25 2016-02-26 11:36:52 +00:00
adustm 0068bb55d2 [NUCLEO_F746ZG] cmsis toolchain files 2016-02-26 11:36:46 +00:00
adustm 809afe7802 [NUCLEO_F746ZG] cmsis files 2016-02-26 11:36:44 +00:00
adustm 252056c17d [NUCLEO_F746ZG] HAL Files 2016-02-26 11:36:42 +00:00
adustm c6e57e50a0 [NUCLEO_F746ZG] Add new target to hal files 2016-02-26 11:36:37 +00:00
adustm 1535bf2874 [NUCLEO_F746ZG] support rtos for this new target 2016-02-26 11:36:35 +00:00
Martin Kojtal c00b00481f Merge pull request #1564 from neilt6/lpc1549-analogin-fix
[LPC1549] Improve AnalogIn Performance
2016-02-26 07:43:53 +00:00
Martin Kojtal fb3928665a Merge pull request #1560 from kgills/i2c_byte_write_fix
[MAX32600MBED MAXWSNENV] Fixing the return for i2c_byte_write.
2016-02-25 10:12:51 +00:00
Martin Kojtal 8577dc9680 Merge pull request #1558 from dbestm/dev_l476rg_rtc
l476rg rtc
2016-02-25 09:42:00 +00:00
Martin Kojtal 8e70fc70ed Merge pull request #1556 from mtkrtk/develop
[Renesas RZ/A1H] Enable SPI_3 on GR-PEACH
2016-02-25 09:33:38 +00:00
neilt6 6525b8ee3e [LPC1549] Improve AnalogIn Performance
Modified the LPC1549 AnalogIn implementation to use the ADCs in
synchronous mode, which is consistent with the LPC11U68 implementation.
This improves performance, and allows the IRC oscillator to be powered
down if necessary.
2016-02-24 14:07:09 -07:00
Kevin Gillespie 9bc9668287 Fixing the return for i2c_byte_write. 2016-02-22 15:45:54 -06:00
adustm fc84dd9234 [STM32F7 family] fix issue with RTC init
the logical test for RTC_ISR_INITS was wronlgy reported from other
STMfamilies.
MBED_16 test works with this modification.
2016-02-22 17:20:27 +01:00
adustm 20c34f47ad [B96B_F446VE] remove spaces (typo) 2016-02-22 15:29:05 +01:00
adustm 8e8af8fb62 [B96B_F446VE] Remove unused IRQ_RX1 interrupt (init / irq_set / ...) 2016-02-22 15:28:47 +01:00
adustm 4a4cb7fb07 [B96B_F446VE] Add more details about the timing_pts table 2016-02-22 15:27:51 +01:00
adustm 3df28ea0b8 [B96B_F446VE] remove unused IRQ_RX1 interrupt 2016-02-22 15:24:42 +01:00
dbestm ab3cda47b9 fix formatting 2016-02-22 14:28:20 +01:00
adustm 028465a9b8 [B96B_F446VE] change serial type
Use only the index, not the UARTName any more.
In case of app with 2 serial (using DMA) + 1 serial (stdio), we have found a bug. The dma handler is overwritten by the last initialized serial object.
Therefore read and write functions did not work anymore.
We have reworked this file to save 1 handler per UART IP, and align it with MBED OS file.
Tests have been passed. Same status as before (OK except MBED_37, manual test for SERIAL_ASYNC also OK).
2016-02-22 13:07:35 +00:00
mtkrtk 9211a3afea Enable SPI_3 2016-02-20 10:17:51 +09:00
bcostm c30cb0129e Update ARM_MICRO startup files
Fix issue #1348 with stack/heap  and with many ST shields.
2016-02-19 16:51:31 +01:00
bcostm a4cf478240 Set NVIC_RAM_VECTOR_ADDRESS to 0x10000000 2016-02-19 10:09:08 +01:00
modtronix-com b78542d10e Changed target name from NZ32SC151 to NZ32_SC151 2016-02-18 09:49:14 +00:00
Martin Kojtal b57f7d5684 Merge pull request #1545 from TomoYamanaka/master
Support of export function to the IAR.
2016-02-18 09:42:15 +00:00
tomoyuki yamanaka 60b7accf22 Additional changes to support of export function to the IAR.
In support of export function to the IAR, delete unnecessary extern declaration.
2016-02-17 11:39:01 +09:00
dbestm 37afc01c39 Merge remote-tracking branch 'refs/remotes/origin/master' into dev_l476rg_rtc 2016-02-16 17:44:02 +01:00
dbestm 8b04249028 [NUCLEO_L476RG] RTC+LSE
make the RTC works properly with LSE and add the possibility to use the
LSI (internal clock)
2016-02-16 17:30:54 +01:00
0xc0170 44df3e5bd7 mbed lib revision - 114 2016-02-16 15:49:36 +00:00
dbestm d63cc2109b [NUCLEO_F446RE] RTC+LSE+init 2016-02-15 17:21:32 +01:00
Martin Kojtal e641fd47cf Merge pull request #1547 from Parthasarathy/master
Fixed GCC Compiler warnings
2016-02-15 09:50:40 +00:00
Martin Kojtal 20948ad920 Merge pull request #1535 from sg-/remove-gcc-cw
Remove stale gcc tools
2016-02-15 08:54:17 +00:00
tomoyuki yamanaka 27caef30a4 Support of export function to the IAR.
We modified the following to support the export function to the IAR.
- In tools files, add RZ_A1H to the target of IAR.
- In tools files, add the tmpl files.
2016-02-15 14:49:31 +09:00
Parthasarathy.S a8e52a9fc0 Fixed style and build issue 2016-02-14 21:33:35 +05:30
Parthasarathy.S 86b8516024 Fixed build error 2016-02-14 21:33:33 +05:30
Parthasarathy.S d578a72b93 Fix for compiler warnings 2016-02-14 21:33:31 +05:30
Moin Shaik a736139336 Merge branch 'master' of https://github.com/mbedmicro/mbed into peripherals_driver_warnings_fix_ready 2016-02-14 21:33:29 +05:30
0xc0170 9dcb51ce87 Merge branch 'maclobdell-patch-1' 2016-02-12 08:46:36 +01:00
Mac Lobdell 8abc70e657 Fix SAML21J18A.sct
Remove extra new lines which caused comments to be exposed as code.
2016-02-12 08:45:55 +01:00
Paul Staron 91fae56245 Update Teensy3_1 OS_CLOCK
Corrected OS_CLOCK to 96MHz
2016-02-11 21:54:04 +00:00
sg- c7f84c86f7 Remove all references and use of code warrior GCC in docs, build and
exporters¦
2016-02-11 01:07:58 -06:00
Martin Kojtal c301abb233 Merge pull request #1522 from dinau/disco-uvision4-exporter
Add uVision4 exporters for DISCO-{F051R8, F100RB, F303VC, F407VG}
2016-02-11 07:53:34 +01:00
Martin Kojtal 66c0620619 Merge pull request #1521 from adustm/b_b96b_serial_flow_control
[STM B96B_F446VE] HW Control Flow for serial
2016-02-10 08:43:49 +01:00
0xc0170 4f59006467 mbed lib revision - 113 2016-02-02 07:44:54 +00:00
0xc0170 b28b71e97e Merge branch 'master' of https://github.com/leibin2014/mbed into leibin2014-master
Conflicts:
	libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F072RB/system_stm32f0xx.c
2016-02-01 18:20:15 +00:00
adustm c11325e11b [B96B_F446VE] add IRQ_RX1 interrupt
Can contains 2 fifos. Both generates its own interrupt.
IRQ_RX occurs when a message has arrived in FIFO-0 , FIFO-0 is full or
overrun.
IRQ_RX1 occurs when a message has arrived in FIFO-1 , FIFO-1 is full or
overrun.
2016-02-01 10:13:29 +01:00
dinau 6e45dafa0e Add uVision4 exporters for DISCO-{F051R8, F100RB, F303VC, F407VG}
(1) Add above exporters.
(2) Modified only comments in "cmsis_nvic.h" files.
2016-01-31 19:34:42 +09:00
Martin Kojtal 01e730cfb2 Merge pull request #1512 from neilt6/master
[LPC11U68, LPC1549] Fixed PwmOut SCT Bugs
2016-01-30 16:51:34 +00:00
adustm 6da4190be9 [STM B96B_F446VE] HW Control Flow for serial 2016-01-29 17:59:45 +01:00
Martin Kojtal d465cb53a3 Merge pull request #1506 from star297/master
Update rtc_api.c
2016-01-29 14:01:30 +00:00
Martin Kojtal d1cd09d7f1 Merge pull request #1517 from anpilog/stm32f0x_hsi_fix
Fix HSI configuration for STM32F0x.
2016-01-29 14:00:43 +00:00
adustm a58480e9eb [B96B_F446VE] Add the target for can test 2016-01-29 14:20:51 +01:00
Martin Kojtal bad9c12012 Merge pull request #1493 from adustm/b96b_asyn_serial_new
B96B async serial
2016-01-29 13:16:35 +00:00
adustm 0e739aaab3 [B96B_F446VE] remove specific B96B results
Requested by Martin: test is now failing, as B96B_F446VE gives
RX_COMPLETE event on top of errors and Char_Match
2016-01-29 14:12:55 +01:00
adustm 6ff8955d58 [B96B_F446VE] Add Can test files + bug fix in can_api.c 2016-01-29 14:09:25 +01:00
adustm fa5e1f7e73 [B96B_F446VE] remove unnecessary wait after code review
tested OK
2016-01-28 17:35:42 +01:00
adustm 1325d8c8c2 [B96B_F446VE] Add CAN Feature 2016-01-28 16:31:12 +01:00
anpilog 11d2f7e3da Fix HSI configuration for STM32F0x. If HSI is used then PF0 is locked by RCC. 2016-01-28 20:20:35 +08:00
Steven Cooreman aacdd047d1 Fix incorrect clock settings for running off of the HFRCO. 2016-01-28 11:43:07 +01:00
Steven Cooreman a675c20840 Apparently a copy-paste has gone wrong here 2016-01-28 11:27:18 +01:00
adustm 230ddcfab4 [B96B_F446VE] Add this platform to UT_SERIAL_ASYNCH unitary test 2016-01-26 14:57:06 +01:00
adustm 3712f7c6a7 [B96B_F446VE] use of static functions 2016-01-26 14:57:06 +01:00
adustm 5b0bfb1361 [B96B_ASYNC] some fixes to pass serial_asynch.cpp test
Flush errors and current data register at reading start
Allow separate serial obj for TX and RX (= do not initialize [TX/RX]_DMA
when not needed.
Char_match: make it work with long buffers and return the correct
position of the char_match.
2016-01-26 14:57:06 +01:00
adustm 3aaf866154 [B96B_F446VE] bug fix for serial_async unitary test
do not initialise dma tx/rx when it is not activated.
2016-01-26 14:57:06 +01:00
adustm 524f4a6ac7 [B96B_Serial_Async] Add asynchronous feature for the platform B96B 2016-01-26 14:57:06 +01:00
neilt6 132f1e75a5 [LPC11U68, LPC1549] Fixed PwmOut SCT Bugs
* Fixed period & pulse-width off-by-one errors
* Fixed 0% duty cycle output
* Improved duty cycle resolution at high frequencies
2016-01-21 09:30:14 -07:00
Martin Kojtal 813874ee2b Merge pull request #1507 from kgills/i2c_pinname_fix
[MAX32600MBED] Fixing a typo with the I2C pin names.
2016-01-20 08:10:00 +00:00
Kevin Gillespie 9d6336a6e9 Fixing a typo with the I2C pin names. 2016-01-19 16:17:54 -06:00
Paul Staron d9d5e97a97 Update rtc_api.c
Removed redundant RTC->CR define code + added RTC compensation code to calibrate RTC.
2016-01-17 20:42:14 +00:00
Martin Kojtal fa45092ecb Merge pull request #1505 from stevew817/feature/new/fast_i2c
[Silicon Labs] Allow faster I2C baudrates
2016-01-15 14:14:22 +01:00
Steven Cooreman 22c246c94d Fix comment 2016-01-15 13:21:07 +01:00
Steven Cooreman fffbe3201c Too quick on the commit 2016-01-15 13:18:32 +01:00
Steven Cooreman 8ea7d713d6 Extend I2C implementation to deal with higher frequencies 2016-01-15 13:14:08 +01:00
Steven Cooreman 7d8b2c0ca4 Fix regression towards older platforms (did not have RXBLOCK set, resulting in receiving characters even with RX set to NC) by condensing code. 2016-01-15 12:02:25 +01:00
leibin 4d66e2d0b1 The predivider should be 2 here. 2016-01-15 16:53:33 +08:00
Martin Kojtal 45dbe35006 Merge pull request #1490 from ytsuboi/add-TY51822r3
[TY51822r3] add platform
2016-01-15 07:47:49 +00:00
Martin Kojtal 6010f32619 Merge pull request #1482 from mjrgh/master
Remove doubling of buffer size in realiseEndpoint()
2016-01-15 07:42:32 +00:00
Martin Kojtal 0b57f8a29a Merge pull request #1481 from mjrgh/patch-2
Fix interrupt handler for endpoints > 2
2016-01-15 07:41:28 +00:00
Martin Kojtal 919364e6e7 Merge pull request #1501 from stevew817/pearl_support_rebased
[Silicon Labs] Add support for the new EFM32 Pearl Gecko
2016-01-15 07:33:40 +00:00
Steven Cooreman 3d8637cdfb Fixes to serial_api:
* Allow pins to be configured as NC without failing or asserting
* Fix putc() to not return before the entire character has been physically shifted out.
* Use MBED_ASSERT
* Fix baudrate calculation to avoid wrong configuration on startup for stdio
2016-01-14 16:45:39 +01:00
Steven Cooreman 6ab14faf91 Fix wrong copy-paste in digitalInOut test 2016-01-14 16:43:02 +01:00
Steven Cooreman 9d35328001 Clean up failed merge 2016-01-13 09:57:38 +01:00
Steven Cooreman 037dd8c455 Add back the manual placement of the DMA section for GCC to optimize the RAM layout w.r.t. alignment. 2016-01-12 17:25:58 +01:00
Steven Cooreman a0ba4e6489 Pull up EFM32 linker and startup files to latest SDK version. 2016-01-12 17:25:55 +01:00
Steven Cooreman 91ad34addb Update emlib to 4.2.1 to get a critical fix for DCDC on Pearl 2016-01-12 17:25:50 +01:00
Mikko Polojarvi 2ba71ea761 SiLabs: Remove emlib LDMA modifications
Emlib should now match the standard SiLabs release. Required extensions
have been moved to dma_api and marked with LDMAx_ prefix.
2016-01-12 17:25:46 +01:00
Steven Cooreman cb2a653bba Typo in AnalogOut 2016-01-12 17:25:43 +01:00
Steven Cooreman 41e2d8b75f Remove static define that would result in erroneous code when unset, and remove said code. 2016-01-12 17:25:41 +01:00
Steven Cooreman 48b20be0e6 Demote LDMA interrupt priority. We assume that completion of a DMA transfer means the transaction is finished already, and its handling is thus less time-sensitive than being in the middle of an interrupt-driven Serial or SPI transaction. 2016-01-12 17:25:38 +01:00
Steven Cooreman 468ddc86bd Fix error in comment 2016-01-12 17:25:36 +01:00
Steven Cooreman 7df5e479a2 Fix version mismatch between included emlib and readme 2016-01-12 17:25:34 +01:00
Steven Cooreman cfc1eea36b No need to set up the interrupt handler every single time in lp_ticker. 2016-01-12 17:25:31 +01:00
Steven Cooreman 495f7a4e45 Removed unnecessary code in _putc. 2016-01-12 17:25:29 +01:00
Steven Cooreman 924d931553 Cleanup and bugfixes of the PWM implementation.
* Setting the PWM period now correctly updates all other channels to keep their duty cycle
* No longer keep values in RAM that can be read directly from a register
* Setting the PWM duty cycle to 100% no longer makes the signal glitch on every period
* Code condensation
2016-01-12 17:25:26 +01:00
Steven Cooreman 919cf3d14e Light documentation on the sleep API 2016-01-12 17:25:24 +01:00
Steven Cooreman f5d44116e8 Reduce I2C object footprint 2016-01-12 17:25:21 +01:00
Steven Cooreman 0847fd5e2e Fixes to Pearl pinmap:
* Added PD9 back in (for some reason it was at some point removed from the pinmap, not sure why because it is a usable pin when you remove the on-board sensor or use the Pearl chip standalone)
* Fixed PWM locations to match the pin-CC channel combinations.
2016-01-12 17:25:18 +01:00
Steven Cooreman 8563fe8c54 Sync port_api.c with port_api.h 2016-01-12 17:25:16 +01:00
Steven Cooreman db45cd476f analogout_api: clean up functions that are no longer part of the API. 2016-01-12 17:25:14 +01:00
Steven Cooreman b233828ebb Cleanup in AnalogIn: remove functions that are unnecessary and no longer part of the API. 2016-01-12 17:25:11 +01:00
Steven Cooreman f20e96008d Update serial_api to not rely on the maximum number of serial peripherals, but rather allocate resources depending on how many peripherals the chip actually has. Should help with memory usage and clarity, also gets rid of a random badly-named #define in objects. 2016-01-12 17:25:09 +01:00
Steven Cooreman a59c73c4de Fixes to analogOut:
* Implement _free
* Make sure the pin is set to disabled
2016-01-12 17:25:06 +01:00
Steven Cooreman b4c171802e Silence GCC 2016-01-12 17:25:04 +01:00
Steven Cooreman dc2e6317ba lp_ticker code condensation 2016-01-12 17:25:01 +01:00
Steven Cooreman 8fac7bb8e6 Pinmap update for Pearl:
* Remove DAC reference
* Assign part of the pins to each PWM CC channel
* Add APORT4X pins to the ADC map
2016-01-12 17:24:58 +01:00
Steven Cooreman 1631aac5aa Remove unnecessary checking of bit before setting GPIO 2016-01-12 17:24:56 +01:00
Steven Cooreman f4133b8d36 Update modules.h to reflect the actual configuration of Pearl Gecko. 2016-01-12 17:24:54 +01:00
Steven Cooreman d7a4ebba21 Removed useless #error in analogin 2016-01-12 17:24:52 +01:00
Steven Cooreman 3f61aafd0a removed a line of code duplication 2016-01-12 17:24:49 +01:00
Steven Cooreman 8bec4e22bb PWM refactoring to be less confusing with all the #ifdef for routes 2016-01-12 17:24:47 +01:00
Steven Cooreman 653e91df5d Get rid of the check_usart_clock function which is unused and unnecessary. Usart-specific clocking resides in either spi or serial (or both) api files. 2016-01-12 17:24:44 +01:00
Steven Cooreman 05ce194f25 Move to CMSIS defines to check for presence of certain LF clock trees 2016-01-12 17:24:42 +01:00
Aksel Skauge Mellbye f05fd7fcea EFM32 Pearl Gecko Serial: Remove dynamic peripheral allocation. 2016-01-12 17:24:40 +01:00
Aksel Skauge Mellbye c0ec7ad8d9 EFM32 Pearl Gecko SPI: Remove dynamic resource allocation.
Allocate peripherals to specific subsets of pins. USART0 is available on port A, B and D, while USART1 is available on port C and F.
2016-01-12 17:24:37 +01:00
Aksel Skauge Mellbye 9dff016946 EFM32 Pearl Gecko test pins. 2016-01-12 17:24:35 +01:00
Aksel Skauge Mellbye d2609676ba EFM32: Fix HFRCO support for P2 devices. 2016-01-12 17:24:32 +01:00
Aksel Skauge Mellbye 8634cf54d6 EFM32 Pearl Gecko IAR support. 2016-01-12 17:22:14 +01:00
Mikko Polojarvi efadf47be6 SiLabs Pearl: Support for clocking via RC oscillators
Allows clocking the device from RC oscillators (HFRCO, LFRCO).
Note that we can not use the em_cmu.h enums directly as the
preprocessor can not do comparisons on them.

Related changes in serial_api, so that LEUART clock is within
acceptable limits on Pearl.

Contains quite a bit of indentation changes to make the preprocessor
logic more readable so recommend viewing the diff in ignore whitespace
mode.
2016-01-12 17:22:12 +01:00
Mikko Polojarvi 73cf96369d SiLabs: serial_api: Allow LEUART IRQ to fire both handlers
When LEUART IRQ fires, check both RX and TX side for active interrupts
and handle both of them.
2016-01-12 17:22:09 +01:00
Mikko Polojarvi cd08228278 SiLabs: serial_api: Add missing object to sleep fix
Commit 49f63130 'SiLabs: serial_api: Keep track of sleep mode changes'
did not include the added field to struct serial_s.
2016-01-12 17:22:07 +01:00
Mikko Polojarvi 6c3418a0c0 SiLabs: serial_api: Fix memory underflow read in DMA handling
Code would index DMA irq fired array without checking the DMA handle,
which would be -1 when DMA was not used.
2016-01-12 17:22:04 +01:00
Mikko Polojarvi a6e137f188 SiLabs: serial_api: Keep track of sleep mode changes
Keep a counter of sleeps blocked for every device, and do not try
to unblock sleep modes we did not block. This fixes problems where
serial events would cause EM1/EM2 to be unblocked too early,
causing the MCU to go to EM3 and not being able to wake up.
2016-01-12 17:22:02 +01:00
Mikko Polojarvi 1c47e974ff SiLabs Zero: Fix clocking when using LEUART for USB board controller
When initializing for use with the board controller, the LEUART must
be clocked from HF clock as the baud rate is otherwise too high.

Do this by first initializing to "standard" 9600, then call serial_baud
which will handle setting up the clocks and dividers.
2016-01-12 17:21:59 +01:00
Mikko Polojarvi ff494c4000 SiLabs: serial_api: Unblock sleep correctly on TX side
Previous commit that added _intern versions of abort functions
did not change calls of TX abort, so sleep would never unblock.
2016-01-12 17:21:57 +01:00
Mikko Polojarvi 96ff20491c SiLabs Pearl: Minimize line glitches when doing LEUART-USART switch
Switch caused a phantom 0xFF frame to appear on the line when we switched
from LEUART to USART due to a baud rate was increase. This was short
enough that it was only visible at high (~115kbps) speeds.

As a fix, skip disabling the GPIO pins (as their configuration does not
change), and defer disabling the LEUART routing until at the very last
moment. Additionally, do not call serial_format, but immediately
initialize the UART to correct params.
2016-01-12 17:21:54 +01:00
jhokajar 2961d4cc33 SiLabs: analogout_api:
Analog_out fixed. Channel enabled in analogout_init.
2016-01-12 17:21:52 +01:00
Mikko Polojarvi 83401e502b SiLabs Pearl: Correct HFXO frequency
Move to the final HFXO frequency, 40MHz.
2016-01-12 17:21:50 +01:00
Mikko Polojarvi 3b3e52f0a1 SiLabs: serial_api: Fixes for sleep, transmitter disable and uart switch
- Do not attempt to disable the transmitter. Did not find a robust
   way to do so - see comment in file for more info.

 - Do not unblock sleep when abort is called externally, this leads
   to jams as EM1 block gets disabled and the next sleep call places
   the hardware to directly to EM3.

 - Retain more status when switching over from LEUART to USART in
   Pearl: keep registered IRQ handlers and other IRQ status.
2016-01-12 17:21:47 +01:00
jhokajar e48994e9cf Silabs: SPI
Changed SPI implementation: #1 To avoid clearing data from buffers, during splitted DMA transfer
RX/TX buffer clear is done only when transfer is started.
USART transmit is completed instead of DMA/LDMA transfer completed.
2016-01-12 17:21:44 +01:00
jhokajar a9f0fdb200 SiLabs Pearl: SPI
When doing a large transfer over the LDMA it is required to wait TX to be completed
before transferring the next part of the data. Added a loop, to wait until TXC flag is set in function USART_STATUS_TXC.
+ minor code cleanup and EM1 sleep is allowed again.

Second, the TX interrupt was not cleared after processing, causing
it to stay in an infinite loop.
2016-01-12 17:21:42 +01:00
Mikko Polojarvi a7ef4ca830 SiLabs: serial_api: Fix LEUART interrupt dispatch
Conditional when dispatching LEUART irq would always select the RX
side due to a bitwise AND being typoed as a logical AND.

Second, the TX interrupt was not cleared after processing, causing
it to stay in an infinite loop.
2016-01-12 17:21:40 +01:00
Mikko Polojarvi b8ab9fbfed SiLabs Pearl: Use any free UART for stdio
Remove limitation that only a specific UART can be used for the
USB board controller serial line.
2016-01-12 17:21:37 +01:00
Mikko Polojarvi 86376495a6 SiLabs: port_api: Allow individual values on output pins and fix init
Previously, all pins in an mbed Port were set to the same value.
Use GPIO_PortOutSetVal to directly write the desired value to
the pins.

During port initialization the pin mode for input pins was set incorrectly.
Now, input pins are directly set to Input (gpioModeInput) and output pins to
PushPull (gpioModePushPull).
2016-01-12 17:21:35 +01:00
jhokajar 3fc661944a SiLabs Pearl: SPI fixes
Added rx/tx clear before DMA transmit begins. RX DMA descriptor
    fixed
2016-01-12 17:21:33 +01:00
Mikko Polojarvi 81a9dd9031 SiLabs: I2C: Always set master mode on initialization
If an I2C block was reused after being a slave the status would not
be cleared completely, so explicitly initialize to master mode always.
2016-01-12 17:21:30 +01:00
Mikko Polojarvi 316e8733df SiLabs Pearl: I2C: Do not try to force specific locations of pins
Pearl can freely select pins, so do not force both SDA and SCL pins
to have the same "location".
2016-01-12 17:21:27 +01:00
Mikko Polojarvi c1e5c0b907 SiLabs: GPIO interrupts disabled/enabled incorrectly
GPIO_IntEnable/Disable was called with incorrect params due
to missing parens. Operator precedence of & vs << caused the
call to be blank if the port (MSB) nibble of pin was not zero.
2016-01-12 17:21:25 +01:00
jhokajar ee329e5df7 Silabs Pearl: SPI LDMA descriptor fix
Changed correct LDMA descriptor for RX.
2016-01-12 17:21:23 +01:00
jhokajar 2160134d48 Silabs: SPI DMA fix
DMA tranfer was not working in Geckos using DMA. Changed transfer
length calculation in function spi_activate_dma.
2016-01-12 17:21:20 +01:00
jhokajar 0dfca1ad86 SiLabs Pearl: More SPI fixes for 9-16 bit frames
spi_buffer_tx_write fixed to work correctly with 9-16 bit frames,
if transfer length > 1. If frame is 9-16 bit client can use uint16_t or
uint32_t buffer for data storage, spi_api's default is to use uint16_t.

Added precompiler condition USE_UINT16_BUFFER to change assumption for
DMA and IRQ -transfers.
2016-01-12 17:21:18 +01:00
Mikko Polojarvi 6bb98769b0 SiLabs: Update emlib to 4.2.0
Emlib and HW headers updated. ADC pinmap changed to match new
definitions. Pearl linker files updated.
2016-01-12 17:21:15 +01:00
Mikko Polojarvi e865f1fe6f SiLabs Pearl: Keep UART enabled during single byte transfers
We need to explicitly enable the transmitter on Pearl when using the
serial_putc function, to match the disable in the asynch abort.
2016-01-12 17:17:24 +01:00
jhokajar 15b4341162 SiLabs Pearl: SPI fixes for 9-16 bit long frames
LDMA descriptor fixed to support 9-16 bit long frames. Prevented
sleepstate EM1, because USART requires EM0, and entering to EM1
during transfer can crash the system.
2016-01-12 17:17:22 +01:00
jhokajar 3e593439ae SiLabs Pearl: SPI support for 9-16 bit long frames
Added LDMA-transfer support for 9-16 bit long SPI-frames.
2016-01-12 17:17:19 +01:00
Mikko Polojarvi 838b0a6c56 SiLabs Pearl: Allow serial transmitter disable on Pearl
Previous comment on issuing a TXDIS command was incorrect. Actual
root cause was a non-DMA RX interrupt causing the code to run the
TXC handling code as long as the TX DMA interrupt had fired,
which was too early.

Reenable usage of TXDIS on Pearl.
2016-01-12 17:17:17 +01:00
Mikko Polojarvi f6b0c37982 SiLabs Pearl: Support for ARM compiler toolchain
Startup files and linker scripts added for standard and
micro variants of the ARM compiler toochain.
2016-01-12 17:17:14 +01:00
jhokajar 73db782a73 SiLabs: spi implementation
Added implementation for spi_irq_handler_asynch
2016-01-12 17:17:12 +01:00
Mikko Polojarvi 6067de0428 SiLabs Pearl: Rename files and dirs to correct STK code
Pearl STK is offically known as SLSTK3401A, but we well go
with the same naming convention as with Happy so Pearl's
name in Mbed will be STK3401.

Renames all files and directories that previously had the
placeholder STKXXXX. Build, target and export scripts
modified accordingly.
2016-01-12 17:17:10 +01:00
Mikko Polojarvi 20a5bc2ab6 SiLabs: Fix compiler warnings and other cleanup
- Compiler warnings fixed
 - Some private functions marked static
 - Removed unneeded comments
 - Some trailing whitespace stripped
2016-01-12 17:01:41 +01:00
Mikko Polojarvi 9149e88dd1 SiLabs Pearl: Serial support for LEUART-USART switch
Serial HAL now allocates the LEUART first, and will switch
to using a standard UART only if the parameters require it.

Note that this switch can currently only happen one way, from
LEUART to USART. So once a higher baudrate or invalid frame
bit amount has been used, that instance of Serial object
will be locked to using an USART.

TODO: Parts of the UART (re)initialization code are now spread
between three places. They should be combined into single,
generic function.
2016-01-12 17:01:38 +01:00
Mikko Polojarvi 09c94d3091 SiLabs: Fix incorrect TX active conditional in serial_api
Part of condition to detect active TX was not only incorrect
but also not needed in the first place. TX active state is
now always detected only via active TXBL/TXC interrupt.
2016-01-12 17:01:36 +01:00
Mikko Polojarvi 763ce3dbbc SiLabs Pearl: Free(er), dynamic allocation of UARTs
UARTs are no longer fixed to certain pins on Pearl, so
we need to allocate them as needed, and allow for free
pin selection.

TX and RX pin locations in the main serial struct have been
separated, and pin routing modified accordingly.

serial_api_HAL.h interface keeps track of which UARTS are
currently in use, and provides alloc/free functions. Serial
and SPI components modified to use the new API.

TODO: Magic to support LEUART. This code will also need to
be able to dynamically switch from LEUART to standard USART
if the user later sets params (baud rate or format) that can
not be supported on LEUART.
2016-01-12 17:01:34 +01:00
Mikko Polojarvi 0e75dd3257 SiLabs: Fix infinite interrupt loop when using LEUART with DMA
Issuing a CLEARTX to LEUART command together or after TXEN caused
the DMA transfer to jam or cause repeated interrupts.

Also cleanup duplicated interrupt clears and add correct LEUART
branches when disabling RX/TX.
2016-01-12 17:01:30 +01:00
Mikko Polojarvi e30c1e1468 SiLabs: Compilation fix for incorrect LFE clock flagging
cmuClock_LFE conditional compliation was using the incorrect flag.
2016-01-12 17:01:28 +01:00
Mikko Polojarvi 97e5eabffa SiLabs: Multiple fixes for serial_api
- Allow emlib to read the HFPER clock when initializing
   USART. This corrects the baud rate on the serial line.

 - Always use the TXC interrupt to signal when a transmission
   is over when using (L)DMA. Removes a race condition
   between flipping from TXBL to TXC, and TXC activating.

 - With the previous change, serial_tx_active can now poll
   the TXBL/TXC interrupts to see if a transmission is active.
   previous code would fail in cases that the DMA transfer
   had ended, but TX was still active, occasionally leading
   to partial transfers when CLEARTX command was issued on
   the next transfer.

 - Add some sync points (SYNCBUSY poll) when twiddling around
   LEUART registers.

Known issue: Using LEUART and DMA transfer on (at least) Leopard
causes the device to enter an infinite DMA interrupt loop.
2016-01-12 17:01:26 +01:00
jhokajar f6a66ff7e2 SiLabs: Correct low power timer setup
When the requested timeout was not a integer multiple of the
LF clock tick the timestamp was set too short due to rounding,
sometimes causing the ticker event to be missed.
2016-01-12 17:01:24 +01:00
jhokajar ab26722b01 SiLabs: Low power timer / RTC initialization fix
Read as not returning correct values, because RTCC (or RTC in other
Gecko's) was not initiated. This was a problem in every Gecko.

If RTCC is initiated for lptimer it is done without binding it to
irqhandler (since irq not needed). Also implementation for geckos
using RTC added.

Tested with pearl and happy geckos
2016-01-12 17:01:22 +01:00
jhokajar 22879f972d SiLabs Pearl: lpticker wakeup 2016-01-12 17:01:20 +01:00
Mikko Polojarvi a31071275a SiLabs: Fix interrupt amount configurations
Number of interrupt slots reported by different files before this commit:

            giant  happy  leopard  pearl  wonder  zero
spec        39     21     39       34     39      17
nvic        39     21     39       34     40      19
startup.s   39     21     40       34     40      19
gcc link    40     21     41       34     40      19
arm link    40     22     40       -      40      16
reserved    0      0      1        0      0       2

  spec - reference manual
  nvic.h - cmsis_nvic.h
  startup.s - assembler startup files
  gcc link - efm32*.ld linker script for GCC
  arm link - efm32*.sct linker script for ARM (RVCT)
  reserved - number of 'reserved' slots at the end of irq table in startup.s files

Fixed amounts to reflect those in the startup files, including reserved
slots:

Giant
    Reduce amount in GCC and ARM linker files to 39

Happy
    Fix comment in GCC linker file
    Reduce amount in ARM linker file to 21

Leopard
    Increase amount to 40 in cmsis_nvic.h
    Reduce amount to 40 in GCC linker file (this bug caused by
    emlib 4.1.0 port commit 1923e8b4)

Wonder
    No changes, but note that ref. manual does not list FPUEH
    interrupt that is included in startup files at index 39

Zero
    Increase amount to 19 in ARM linker file
2016-01-12 17:01:17 +01:00
jhokajar 7f051e9a22 SiLabs Pearl: SPI LDMA support
SPI dma forced to compile. Continuing improvements...
2016-01-12 17:01:15 +01:00
jhokajar 745d72aeea SiLabs Pearl: SPI pinmappings
Correct routing for SPI pins on Pearl
2016-01-12 17:01:13 +01:00
jhokajar 97a1674a94 SiLabs Pearl: I2C GPIO fix
GPIO pins were uninitialized. Fixed and tested.
2016-01-12 17:01:11 +01:00
Mikko Polojarvi 6095a67b95 SiLabs Pearl: LDMA fixes for serial
LDMA now functional for both RX/TX.

One hack remains - need to check if TXC interrupt check can be
removed from older platforms, or if flagging is necessary.
2016-01-12 17:01:09 +01:00
jhokajar fc49b0e2ac SiLabs Pearl: PWM output functionality
Any channel can be used. It is possible to have 4 pwm outputs
active at a same time, if PinMap_PWM configuration is done properly.

Future improvement proposal: dynamic channel selection!
2016-01-12 17:01:07 +01:00
jhokajar 973141e2e7 SiLabs Pearl: ADC fixes
Channel selection shifted to right place. Now It seems to work
at least with channel PC11. Weird thing is, that floating pin gives
result 0.4. Should be 0.0.
2016-01-12 17:01:04 +01:00
Mikko Polojarvi 7be6799638 SiLabs Pearl: LDMA support for serial_api
LDMA support for serial HAL. Adds callback support for emlib LDMA
code so that most of the old serial code can be reused.

Note: Serial shows some signs of life on the bus, but DMA mode
is completely untested.
2016-01-12 17:01:03 +01:00
Mikko Polojarvi e3e385e16d SiLabs Pearl: Serial HAL USART/LEUART pin routing
Serial pin routing for Pearl. Note that this currently requires
the pins to be in the same "location", even though this is not
needed by the Pearl HW.
2016-01-12 17:01:00 +01:00
jhokajar d238a83042 SiLabs Pearl: AnalogIn support
analogin_api.c changed to make it compile.

Compilation error will be generated if _ADC_SINGLECTRL_POSSEL_MASK ||
_ADC_SINGLECTRL_INPUTSEL_MASK is not defined. This is because NEGATIVE
voltage measurement is not supported by MBED API.
2016-01-12 17:00:58 +01:00
Mikko Polojarvi bafd8e28b8 SiLabs Pearl: LDMA initialization
LDMA support for the dma_api module
2016-01-12 17:00:56 +01:00
Mikko Polojarvi c4018e4ea8 SiLabs Pearl: Correct includes and interrupt names in RTC
Conditionals for including em_rtc.h and em_rtcc.h.
Use the correct interrupt name in RTCC code.
2016-01-12 17:00:54 +01:00
Mikko Polojarvi 21a242049f SiLabs Pearl: Fix I2C pin routing
Use new ROUTEPEN/ROUTELOC0 registers for selecting I2C pins.
2016-01-12 17:00:52 +01:00
Mikko Polojarvi 4990751ace SiLabs Pearl: Correct STDIO_UART definition
Normal UARTs not present, use USART.
2016-01-12 17:00:50 +01:00
Mikko Polojarvi 2cb2ada9b6 SiLabs Pearl: Mbed support for linker script
Mbed needs to have interrupt vectors in RAM so reserve space at
the beginning of memory, and export the relevant symbols.
2016-01-12 17:00:48 +01:00
jhokajar c89d5cae9d SiLabs Pearl: Update pinmap for ADC and DAC
ADC pinmap updated, PinMap_DAC removed, since DEVICE_ANALOGOUT not supported
2016-01-12 17:00:46 +01:00
Mikko Polojarvi 6e7589c5b8 SiLabs Pearl: Remove configuration for HW not present in Pearl
Removed DAC/AnalogOut, I2C1, UART0/1, LEUART1, USART2,
GPIO Drive support and GPIO port E.
2016-01-12 17:00:44 +01:00
Mikko Polojarvi dcc6b61ed5 SiLabs Pearl: lp_ticker HAL adaptation
Use RTCC API for lp_ticker on Pearl. Basic adaptation, but more
work is required.

Now frees RTC when ticker is not used (detected through interrupt
disable), so that sleep modes below EM2 do not remain
permanently blocked.
2016-01-12 17:00:42 +01:00
Mikko Polojarvi bf4cf1a5ec SiLabs Pearl: RTCC support 2016-01-12 17:00:40 +01:00
Mikko Polojarvi e2c33dd166 SiLabs Pearl: GPIO HAL fixes
Pearl GPIO block does not support DOUTSET/DOUTCLR,
so use read+DOUTTGL instead.
2016-01-12 17:00:38 +01:00
Mikko Polojarvi 15ed788fe7 SiLabs Pearl: Pin mappings for PWM
PWM pin mappings. Since the pins can be freely chosen (unlike
in previous HW), there should be no need to use the other channels.

Also corrected frequency for HFXO in ref devices.
2016-01-12 17:00:35 +01:00
Mikko Polojarvi 199f5fa402 SiLabs: Emlib 4.1.0 headers update for Zero Gecko 2016-01-12 17:00:33 +01:00
Mikko Polojarvi 0c066f5c1a SiLabs: Emlib 4.1.0 headers update for Wonder Gecko 2016-01-12 17:00:30 +01:00
Mikko Polojarvi 19a060791c SiLabs: Emlib 4.1.0 headers update for Leopard Gecko 2016-01-12 17:00:27 +01:00
Mikko Polojarvi 567afac8ea SiLabs: Emlib 4.1.0 headers update for Happy Gecko 2016-01-12 17:00:25 +01:00
Mikko Polojarvi 485a08db77 SiLabs: Emlib 4.1.0 headers update for Giant Gecko 2016-01-12 17:00:22 +01:00
Mikko Polojarvi 9234010fb8 SiLabs: Update emlib to 4.1.0
New version with support for Pearl & co.
2016-01-12 17:00:19 +01:00
Mikko Polojarvi e5e896b68d SiLabs Pearl: Initial commit
Leopard Gecko used as baseline.

TODO

 - Peripheral/GPIO pin mappings etc for Pearl are marked "Pearl ok",
   rest are wrong

 - Missing new (4.1.0+) emlib
2016-01-12 17:00:16 +01:00
0xc0170 2d4024eccb mbed lib revision - 112 2016-01-12 09:56:03 +00:00
adustm 26e3c61983 [STM all] Fix #1480: change location of check for RTC already initialised
Need to keep PWR_CLK_ENABLE and LSE LSI oscillator configuration.
Just skip the HAL_RTC_Init in case INITS flag is already set.
2016-01-12 09:30:33 +00:00
Martin Kojtal 42ceddf229 Merge pull request #1467 from mbedmicro/fix_m7core
Fix m7core
2016-01-11 16:55:37 +00:00
Martin Kojtal ab7d3f1d2c Merge pull request #1497 from c1728p9/fix_raw_serial_microlib
Fix RawSerial when used with ARMCC microlib
2016-01-11 16:55:05 +00:00
ytsuboi 9b7d776d40 [TY51822r3] add description on comment, fixed years 2016-01-11 22:57:46 +09:00
0xc0170 50719edaf5 RTOS - M4 files reuse for M7 2016-01-11 13:50:59 +00:00
adustm 4ac44bdea6 [STM_F0] clock the APB2ENR_SYSCFGEN in RCC so that SYSCFG->CFGR1 value can be taken into account in NVIC_SetVector 2016-01-11 09:31:50 +00:00
Russ f8ada507af Fix RawSerial when used with ARMCC microlib
The function vsnprintf does not properly handle a size of zero for
the destination buffer, and will write data to it.  If the buffer is
set to null this will cause a hardfault.  This patch adds a workaround
for this bug by using a buffer of size 1.
2016-01-10 19:01:46 -06:00
ytsuboi 9a9885e5fa [TY51822r3] add platform 2016-01-06 23:17:24 +09:00