Commit graph

90 commits

Author SHA1 Message Date
Alex Stewart
8c9a77efe8 Added first half of RE'd user_interface.c 2016-07-06 17:21:34 +10:00
Alex Stewart
2ecbf1d584 First batch of opensdk additions
Replacements for:
    libmain/misc.o
    libmain/os_cpu_a.o
    libmain/spi_flash.o
    libmain/timers.o
    libmain/uart.o
    libmain/xtensa_context.o
2016-07-06 17:21:34 +10:00
Angus Gratton
230aa9fd37 Add new "RAM" storage macro for putting constant data in RAM
Also update comments in common_macros.h following #142
2016-05-28 12:39:56 +10:00
Angus Gratton
3ba19d7c4e Merge pull request #137 from SuperHouse/feature/better_crash_dumps
Better crash dumps
2016-05-17 09:38:19 +10:00
Angus Gratton
1e9296f60c Fatal exceptions: Cleanly deal with exceptions that occur inside fatal_exception_handler_inner()
In case of heap corruption or some other major problem, dumping details
in the exception handler can cause a crash loop - so fail out if we seem
to be going in circles.
2016-05-17 09:27:31 +10:00
Angus Gratton
981c87899b Add heap information to fatal exception & abort dumps 2016-05-15 22:30:01 +10:00
Angus Gratton
efedd24624 fatal exception handler: Only dump "registers" from stack for fatal user exceptions 2016-05-15 22:30:01 +10:00
Angus Gratton
36886412e6 Add abort() implementation
Also reduces the IRAM footprint of the fatal exception handler, as only
the prelude (which disables interrupts & enables the flash mapping) is
in IRAM now.

Closes #54, relevant to #133.
2016-05-15 22:30:01 +10:00
Angus Gratton
52f9b13faf Break out debug dump functions into their own compilation unit 2016-05-15 22:30:01 +10:00
Angus Gratton
fd20b1a530 Add PHY hardware management for Bluetooth Coexistence pin choice 2016-05-15 22:21:10 +10:00
Angus Gratton
b61d06e940 Wrap structure around phy_info PHY initialisation settings
Add notes based on testing some of the values found there.
2016-05-15 22:21:10 +10:00
UncleRus
3a62a0af0c esp/gpio.h c++ compatibility 2016-03-22 01:51:50 +05:00
UncleRus
42018f0315 SPI big endian swap bug fix, spi_get_settings()/spi_set_settings() 2016-03-18 03:27:36 +05:00
UncleRus
b0fb8736a8 Comments updated 2016-03-13 16:48:05 +05:00
UncleRus
22ceb08b49 Tabs to spaces. Again. 2016-03-13 02:25:15 +05:00
UncleRus
b4554b5806 SPI mode bug fixed, SPI endianness bugs fixed, new spi_transfer() 2016-03-13 01:59:52 +05:00
UncleRus
9dc565ff7c Separate send/receive buffers 2016-03-08 04:00:11 +05:00
UncleRus
b5c2120efc Removed redeclaration of peripheral bus freq 2016-03-06 01:24:59 +05:00
UncleRus
bd40f75d37 Hardware SPI driver 2016-03-05 02:29:01 +05:00
Alex Stewart
8279b5cfd1 Added some clarifications to comments in esp/gpio.h 2016-02-22 09:32:12 -08:00
Alex Stewart
c36feab845 Separate pullup config out of gpio_enable()
Created `gpio_set_pullup` to configure pullups independently of direction.
Removed GPIO_INPUT_PULLUP direction type.
Added misc other helper functions in iomux.h
2016-02-21 18:34:11 -08:00
Angus Gratton
812c2fef21 Removed INLINED (force inline) macro.
Progress towards #57.
2015-11-28 18:01:03 +11:00
Angus Gratton
2887896c76 timers.h: Return error codes instead of true/false for failures 2015-11-28 16:33:39 +11:00
Angus Gratton
336bad573d timers.h: Remove compile-time-auto-inlining complexity
Fixes bug mentioned in #72 (oops!), also progress towards #57.
2015-11-28 16:32:52 +11:00
Angus Gratton
5301174290 registers.h: Add i2s, SLC, RTC register headers 2015-11-20 17:56:38 +11:00
Angus Gratton
d63a341c4c RTC registers: Add some notes about other register values
Still patchy, but more towards #8.
2015-11-20 17:49:46 +11:00
Angus Gratton
925753819e Add in-progress RTC register header (some registers still undocumented)
Author for this work is @foogod, extracted from 1da996e (open-libmain branch).

Progress towards #8.
2015-11-20 17:31:11 +11:00
Angus Gratton
547c57c840 Add SLC interrupt number 1. Closes #69 2015-11-20 17:25:15 +11:00
Dag Ågren
cad1655330 Add static asserts and create slc.h header for descriptor struct 2015-11-19 21:14:16 +02:00
Dag Agren
1f1bb4d190 Add I2S and SLC register headers 2015-11-16 00:20:16 +02:00
Angus Gratton
5cd31c649a GPIO2 UART iomux values: Remove _BLINK from macro name
This pin acts as a real TX not an activity LED as some pages suggest.
2015-10-28 20:31:50 +11:00
Angus Gratton
0165592231 iomux: Fix bug setting IOMUX_FUNC(4)
Function masking value was incorrect
2015-10-28 20:31:44 +11:00
Angus Gratton
cd68622292 Merge branch 'master' into uart_h 2015-10-06 18:37:28 +11:00
Angus Gratton
dc0fa4e207 Merge pull request #50 from SuperHouse/fix/interrupts
Fix/interrupts
2015-10-06 18:36:03 +11:00
Angus Gratton
3ceadfc0a6 uart.h: Add uart_get_baud/uart_set_baud functions, change default baud rate from 74906 to 115200 2015-10-06 17:49:00 +11:00
Alex Stewart
707d0ed981 Fix issue #52. Add esp/uart.h 2015-10-05 21:51:57 -07:00
Angus Gratton
afd58bc1ff core headers: Add C++ linker compatibility 2015-10-05 18:33:32 +11:00
Angus Gratton
89c481c606 Simplify interrupt and RTOS timer tick handlers
RTOS Timer tick handler is now the same as any other ISR.

This causes a few subtle behaviour changes that seem OK but are worth noting:

* RTOS tick handler sdk__xt_timer_int() is now called from one stack
  frame deeper (inside _xt_isr_handler()), whereas before it was called
  from the level above in UserHandleInterrupt. I can't see any way that
  the extra ~40 bytes of stack use here hurt, though.

* sdk__xt_timer_int() was previous called after all other interrupts
  flagged in the handler, now it's called before the TIMER FRC1 & FRC2
  handlers. The tick handler doesn't appear to do anything particularly
  timing intensive, though.

* GPIO interrupt (value 3) is now lower priority than the SPI
  interrupt (value 2), whereas before it would have been called before
  SPI if both interrupts triggered at once.
2015-09-29 13:21:04 +10:00
Angus Gratton
ed8470631f Consolidate interrupt management in core as esp/interrupts.h & esp_interrupts.c 2015-09-28 22:15:40 +10:00
Angus Gratton
87f77b1021 Refactor Hardware RNG functions to esp/hwrand.h
As suggested by @foogod, thanks!
2015-09-24 20:48:16 +10:00
Angus Gratton
09405a9095 Merge branch 'master' into feature/mbedtls 2015-09-24 20:40:36 +10:00
Alex Stewart
ba7492756c Merge branch 'master' into open-startup 2015-09-20 14:05:54 -07:00
Angus Gratton
b03f279f74 mbedTLS: Add ESP8266 hardware entropy source discovered by @foogod
Addresses #3, provided turns out to be an effective HWRNG.
2015-09-20 21:15:30 +10:00
Angus Gratton
3aff91c85c Rename GPIO_CONF_PUSH_PULL to GPIO_CONF_OPEN_DRAIN
Seems I got the functionality of this bit inverted when
initially testing.

In testing it also seems open drain mode is ignored on some pins, which
still source current. Needs more investigation though (may be pullups
internal to the ESP modules or set by default in software.)

Relates to #45
2015-09-20 21:13:38 +10:00
Angus Gratton
f31daa7f9a iomux: Fix setting of invalid bits when masking in iomux fields
Fixes regression from 2a939e97

Part of issue #45
2015-09-20 21:13:38 +10:00
Angus Gratton
6c06e5e91e common_macros: Include sys/cdefs.h, defines _Static_assert among others 2015-09-20 21:13:38 +10:00
Angus Gratton
7be365ef08 gpio.h: Explicit cast to enum type (needed for g++) 2015-09-20 21:13:38 +10:00
Michael Jacobsen
372827ac42 Mostly updated header files for use in C++ 2015-09-20 21:13:38 +10:00
Angus Gratton
8b90dbd9e5 Merge branch 'feature/c++' 2015-09-12 16:27:26 +10:00
Angus Gratton
c45e84d61d Rename GPIO_CONF_PUSH_PULL to GPIO_CONF_OPEN_DRAIN
Seems I got the functionality of this bit inverted when
initially testing.

In testing it also seems open drain mode is ignored on some pins, which
still source current. Needs more investigation though (may be pullups
internal to the ESP modules or set by default in software.)

Relates to #45
2015-09-12 16:21:26 +10:00