diff options
| author | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-04-12 15:24:50 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-04-12 15:24:50 -0700 |
| commit | 4a4f29b8f95aa67f63397ae4efe78c6994398ccf (patch) | |
| tree | 8ff1fc64edcfca06e5dc6d79a84c259197046cd3 /esp8266 | |
| parent | 8505de1ced9e567867f2530cee241b28f3456b60 (diff) | |
atmel-samd: Rework status LED implementation
* Track status pin use by user code separately so it can take over the pins and then give them back.
* Switch to hardware SPI for APA102 on Gemma and Trinket.
* Merge microcontroller/types.h into microcontroller/Pin.h to better match approach going forwards.
Diffstat (limited to 'esp8266')
| -rw-r--r-- | esp8266/common-hal/analogio/AnalogIn.h | 2 | ||||
| -rw-r--r-- | esp8266/common-hal/board/__init__.c | 2 | ||||
| -rw-r--r-- | esp8266/common-hal/busio/SPI.h | 2 | ||||
| -rw-r--r-- | esp8266/common-hal/busio/UART.h | 2 | ||||
| -rw-r--r-- | esp8266/common-hal/digitalio/DigitalInOut.h | 2 | ||||
| -rw-r--r-- | esp8266/common-hal/microcontroller/Pin.h | 10 | ||||
| -rw-r--r-- | esp8266/common-hal/microcontroller/__init__.c | 2 | ||||
| -rw-r--r-- | esp8266/common-hal/microcontroller/__init__.h | 2 | ||||
| -rw-r--r-- | esp8266/common-hal/microcontroller/types.h | 40 | ||||
| -rw-r--r-- | esp8266/common-hal/pulseio/PWMOut.h | 2 |
10 files changed, 18 insertions, 48 deletions
diff --git a/esp8266/common-hal/analogio/AnalogIn.h b/esp8266/common-hal/analogio/AnalogIn.h index a4edd233d..e2867db43 100644 --- a/esp8266/common-hal/analogio/AnalogIn.h +++ b/esp8266/common-hal/analogio/AnalogIn.h @@ -27,7 +27,7 @@ #ifndef __MICROPY_INCLUDED_ESP8266_COMMON_HAL_ANALOGIO_ANALOGIN_H__ #define __MICROPY_INCLUDED_ESP8266_COMMON_HAL_ANALOGIO_ANALOGIN_H__ -#include "common-hal/microcontroller/types.h" +#include "common-hal/microcontroller/Pin.h" #include "py/obj.h" diff --git a/esp8266/common-hal/board/__init__.c b/esp8266/common-hal/board/__init__.c index 3893e70f7..9365f0fd9 100644 --- a/esp8266/common-hal/board/__init__.c +++ b/esp8266/common-hal/board/__init__.c @@ -28,7 +28,7 @@ #include "py/runtime.h" #include "py/mphal.h" -#include "common-hal/microcontroller/types.h" +#include "common-hal/microcontroller/Pin.h" // Pins aren't actually defined here. They are in the board specific directory // such as boards/feather_huzzah/pins.c. diff --git a/esp8266/common-hal/busio/SPI.h b/esp8266/common-hal/busio/SPI.h index baff10b70..93d2fc79b 100644 --- a/esp8266/common-hal/busio/SPI.h +++ b/esp8266/common-hal/busio/SPI.h @@ -27,7 +27,7 @@ #ifndef __MICROPY_INCLUDED_ESP8266_COMMON_HAL_BUSIO_SPI_H__ #define __MICROPY_INCLUDED_ESP8266_COMMON_HAL_BUSIO_SPI_H__ -#include "common-hal/microcontroller/types.h" +#include "common-hal/microcontroller/Pin.h" #include "py/obj.h" diff --git a/esp8266/common-hal/busio/UART.h b/esp8266/common-hal/busio/UART.h index a87e7c9b2..febb81f89 100644 --- a/esp8266/common-hal/busio/UART.h +++ b/esp8266/common-hal/busio/UART.h @@ -27,7 +27,7 @@ #ifndef __MICROPY_INCLUDED_ESP8266_COMMON_HAL_BUSIO_UART_H__ #define __MICROPY_INCLUDED_ESP8266_COMMON_HAL_BUSIO_UART_H__ -#include "common-hal/microcontroller/types.h" +#include "common-hal/microcontroller/Pin.h" #include "py/obj.h" diff --git a/esp8266/common-hal/digitalio/DigitalInOut.h b/esp8266/common-hal/digitalio/DigitalInOut.h index 94de1bca5..13bc2af5b 100644 --- a/esp8266/common-hal/digitalio/DigitalInOut.h +++ b/esp8266/common-hal/digitalio/DigitalInOut.h @@ -27,7 +27,7 @@ #ifndef __MICROPY_INCLUDED_ESP8266_COMMON_HAL_DIGITALIO_DIGITALINOUT_H__ #define __MICROPY_INCLUDED_ESP8266_COMMON_HAL_DIGITALIO_DIGITALINOUT_H__ -#include "common-hal/microcontroller/types.h" +#include "common-hal/microcontroller/Pin.h" #include "py/obj.h" typedef struct { diff --git a/esp8266/common-hal/microcontroller/Pin.h b/esp8266/common-hal/microcontroller/Pin.h index a06e9c195..1381ab55a 100644 --- a/esp8266/common-hal/microcontroller/Pin.h +++ b/esp8266/common-hal/microcontroller/Pin.h @@ -27,6 +27,16 @@ #ifndef __MICROPY_INCLUDED_ESP8266_COMMON_HAL_MICROCONTROLLER_PIN_H__ #define __MICROPY_INCLUDED_ESP8266_COMMON_HAL_MICROCONTROLLER_PIN_H__ +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + qstr name; + uint8_t gpio_number; + uint8_t gpio_function; + uint32_t peripheral; +} mcu_pin_obj_t; + // Magic values for gpio_number. #define NO_GPIO 0xff #define SPECIAL_CASE 0xfe diff --git a/esp8266/common-hal/microcontroller/__init__.c b/esp8266/common-hal/microcontroller/__init__.c index f14143e7d..3a5ec92cd 100644 --- a/esp8266/common-hal/microcontroller/__init__.c +++ b/esp8266/common-hal/microcontroller/__init__.c @@ -25,7 +25,7 @@ */ #include "common-hal/microcontroller/Pin.h" -#include "common-hal/microcontroller/types.h" +#include "common-hal/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Pin.h" #include "eagle_soc.h" diff --git a/esp8266/common-hal/microcontroller/__init__.h b/esp8266/common-hal/microcontroller/__init__.h index c82df49e9..a5f7baa25 100644 --- a/esp8266/common-hal/microcontroller/__init__.h +++ b/esp8266/common-hal/microcontroller/__init__.h @@ -27,7 +27,7 @@ #ifndef __MICROPY_INCLUDED_ESP8266_COMMON_HAL_MICROCONTROLLER___INIT___H__ #define __MICROPY_INCLUDED_ESP8266_COMMON_HAL_MICROCONTROLLER___INIT___H__ -#include "common-hal/microcontroller/types.h" +#include "common-hal/microcontroller/Pin.h" extern const mcu_pin_obj_t pin_TOUT; extern const mcu_pin_obj_t pin_XPD_DCDC; diff --git a/esp8266/common-hal/microcontroller/types.h b/esp8266/common-hal/microcontroller/types.h deleted file mode 100644 index 8245cd303..000000000 --- a/esp8266/common-hal/microcontroller/types.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Scott Shawcroft - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef __MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_MICROCONTROLLER_TYPES_H__ -#define __MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_MICROCONTROLLER_TYPES_H__ - -#include "py/obj.h" - -typedef struct { - mp_obj_base_t base; - qstr name; - uint8_t gpio_number; - uint8_t gpio_function; - uint32_t peripheral; -} mcu_pin_obj_t; - -#endif // __MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_MICROCONTROLLER_TYPES_H__ diff --git a/esp8266/common-hal/pulseio/PWMOut.h b/esp8266/common-hal/pulseio/PWMOut.h index 7eb22e6e1..ababba657 100644 --- a/esp8266/common-hal/pulseio/PWMOut.h +++ b/esp8266/common-hal/pulseio/PWMOut.h @@ -27,7 +27,7 @@ #ifndef __MICROPY_INCLUDED_ESP8266_COMMON_HAL_PULSEIO_PWMOUT_H__ #define __MICROPY_INCLUDED_ESP8266_COMMON_HAL_PULSEIO_PWMOUT_H__ -#include "common-hal/microcontroller/types.h" +#include "common-hal/microcontroller/Pin.h" typedef struct { mp_obj_base_t base; |
