mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-05-31 23:50:12 +08:00
feat(driver): Clean up header files dependency
This commit is contained in:
@ -12,8 +12,13 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "esp_common.h"
|
||||
#include "freertos/portmacro.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "esp8266/eagle_soc.h"
|
||||
#include "esp8266/pin_mux_register.h"
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
|
@ -12,8 +12,15 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "esp_common.h"
|
||||
#include "freertos/portmacro.h"
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "esp8266/ets_sys.h"
|
||||
#include "esp8266/eagle_soc.h"
|
||||
#include "esp8266/timer_register.h"
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
|
||||
#define US_TO_RTC_TIMER_TICKS(t) \
|
||||
((t) ? \
|
||||
|
@ -12,14 +12,17 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "c_types.h"
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "esp8266/ets_sys.h"
|
||||
#include "esp_misc.h"
|
||||
#include "gpio.h"
|
||||
#include "freertos/portmacro.h"
|
||||
|
||||
#include "gpio.h"
|
||||
#include "i2c_master.h"
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
|
||||
static uint8_t m_nLastSDA;
|
||||
static uint8_t m_nLastSCL;
|
||||
|
||||
@ -215,9 +218,9 @@ uint8_t i2c_master_getAck(void)
|
||||
bool i2c_master_checkAck(void)
|
||||
{
|
||||
if (i2c_master_getAck()) {
|
||||
return FALSE;
|
||||
return false;
|
||||
} else {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,12 +17,15 @@
|
||||
* @brief Defines and Macros for the SPI.
|
||||
*/
|
||||
|
||||
#include "spi_interface.h"
|
||||
#include "esp8266/eagle_soc.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#include "esp8266/ets_sys.h"
|
||||
#include "esp8266/pin_mux_register.h"
|
||||
#include "esp_libc.h"
|
||||
#include "freertos/portmacro.h"
|
||||
|
||||
#include "spi_interface.h"
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Make sure all of the definitions in this header have a C binding.
|
||||
|
@ -12,14 +12,21 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "esp_common.h"
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "esp8266/pin_mux_register.h"
|
||||
#include "esp8266/uart_register.h"
|
||||
#include "esp8266/rom_functions.h"
|
||||
|
||||
#include "esp_misc.h"
|
||||
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "freertos/queue.h"
|
||||
|
||||
#include "uart.h"
|
||||
#include "esp8266/rom_functions.h"
|
||||
|
||||
enum {
|
||||
UART_EVENT_RX_CHAR,
|
||||
|
@ -19,6 +19,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "esp8266/uart_register.h"
|
||||
|
||||
#define ETS_UART_INTR_ENABLE() _xt_isr_unmask(1 << ETS_UART_INUM)
|
||||
#define ETS_UART_INTR_DISABLE() _xt_isr_mask(1 << ETS_UART_INUM)
|
||||
#define UART_INTR_MASK 0x1ff
|
||||
|
@ -25,6 +25,8 @@
|
||||
#ifndef _EAGLE_SOC_H_
|
||||
#define _EAGLE_SOC_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
//Register Bits{{
|
||||
#define BIT31 0x80000000
|
||||
#define BIT30 0x40000000
|
||||
@ -64,8 +66,8 @@
|
||||
#define ETS_UNCACHED_ADDR(addr) (addr)
|
||||
#define ETS_CACHED_ADDR(addr) (addr)
|
||||
|
||||
#define READ_PERI_REG(addr) (*((volatile uint32 *)ETS_UNCACHED_ADDR(addr)))
|
||||
#define WRITE_PERI_REG(addr, val) (*((volatile uint32 *)ETS_UNCACHED_ADDR(addr))) = (uint32)(val)
|
||||
#define READ_PERI_REG(addr) (*((volatile uint32_t *)ETS_UNCACHED_ADDR(addr)))
|
||||
#define WRITE_PERI_REG(addr, val) (*((volatile uint32_t *)ETS_UNCACHED_ADDR(addr))) = (uint32_t)(val)
|
||||
#define CLEAR_PERI_REG_MASK(reg, mask) WRITE_PERI_REG((reg), (READ_PERI_REG(reg) & (~(mask))))
|
||||
#define SET_PERI_REG_MASK(reg, mask) WRITE_PERI_REG((reg), (READ_PERI_REG(reg) | (mask)))
|
||||
#define GET_PERI_REG_BITS(reg, hipos, lowpos) ((READ_PERI_REG(reg) >> (lowpos)) & ((1 << ((hipos) - (lowpos) + 1)) - 1))
|
||||
|
@ -25,6 +25,8 @@
|
||||
#ifndef __ETS_SYS_H__
|
||||
#define __ETS_SYS_H__
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* interrupt related */
|
||||
#define ETS_SPI_INUM 2
|
||||
#define ETS_GPIO_INUM 4
|
||||
@ -35,7 +37,7 @@
|
||||
#define ETS_FRC_TIMER1_INUM 9
|
||||
|
||||
extern char NMIIrqIsOn;
|
||||
extern uint32 WDEV_INTEREST_EVENT;
|
||||
extern uint32_t WDEV_INTEREST_EVENT;
|
||||
|
||||
#define INT_ENA_WDEV 0x3ff20c18
|
||||
#define WDEV_TSF0_REACH_INT (BIT(27))
|
||||
|
Reference in New Issue
Block a user