Commit Graph

5678 Commits (ffb1cc9ac4dd96a7493f3d1ed8101e200c3e0bfb)

Author SHA1 Message Date
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 764d54f2d5 Fix Pearl chip SKU and core ID in targets. 2016-01-12 17:25:52 +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 e44059a3c9 Add EFM32 Pearl Gecko exporters. 2016-01-12 17:24:30 +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