mirror of
https://github.com/oopuuu/zTC1.git
synced 2026-05-12 03:04:45 +08:00
修复mico-sdk错误
This commit is contained in:
@@ -1,31 +1,31 @@
|
||||
/**
|
||||
* UNPUBLISHED PROPRIETARY SOURCE CODE
|
||||
* Copyright (c) 2016 MXCHIP Inc.
|
||||
*
|
||||
* The contents of this file may not be disclosed to third parties, copied or
|
||||
* duplicated in any form, in whole or in part, without the prior written
|
||||
* permission of MXCHIP Corporation.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __PLATFORM_CORE_h__
|
||||
#define __PLATFORM_CORE_h__
|
||||
|
||||
#include "common.h"
|
||||
|
||||
/**
|
||||
* Returns the current CPU cycle count.
|
||||
*
|
||||
* This function is used to accurately calculate sub-systick timing.
|
||||
*/
|
||||
extern uint32_t platform_get_cycle_count( void );
|
||||
|
||||
/**
|
||||
* Returns TRUE if the CPU is currently running in interrupt context
|
||||
*
|
||||
*/
|
||||
extern mico_bool_t platform_is_in_interrupt_context( void );
|
||||
|
||||
#endif // __PLATFORM_CORE_h__
|
||||
|
||||
/**
|
||||
* UNPUBLISHED PROPRIETARY SOURCE CODE
|
||||
* Copyright (c) 2016 MXCHIP Inc.
|
||||
*
|
||||
* The contents of this file may not be disclosed to third parties, copied or
|
||||
* duplicated in any form, in whole or in part, without the prior written
|
||||
* permission of MXCHIP Corporation.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __PLATFORM_CORE_h__
|
||||
#define __PLATFORM_CORE_h__
|
||||
|
||||
#include "common.h"
|
||||
|
||||
/**
|
||||
* Returns the current CPU cycle count.
|
||||
*
|
||||
* This function is used to accurately calculate sub-systick timing.
|
||||
*/
|
||||
extern uint32_t platform_get_cycle_count( void );
|
||||
|
||||
/**
|
||||
* Returns TRUE if the CPU is currently running in interrupt context
|
||||
*
|
||||
*/
|
||||
extern mico_bool_t platform_is_in_interrupt_context( void );
|
||||
|
||||
#endif // __PLATFORM_CORE_h__
|
||||
|
||||
|
||||
@@ -1,126 +1,126 @@
|
||||
/**
|
||||
* UNPUBLISHED PROPRIETARY SOURCE CODE
|
||||
* Copyright (c) 2016 MXCHIP Inc.
|
||||
*
|
||||
* The contents of this file may not be disclosed to third parties, copied or
|
||||
* duplicated in any form, in whole or in part, without the prior written
|
||||
* permission of MXCHIP Corporation.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Main
|
||||
*
|
||||
* @param[in] : void
|
||||
* @return : int
|
||||
*
|
||||
* @usage
|
||||
* \li Defined by RTOS or application and called by CRT0
|
||||
*/
|
||||
int main( void );
|
||||
|
||||
/**
|
||||
* Initialise system clock(s)
|
||||
* This function includes initialisation of PLL and switching to fast clock
|
||||
*
|
||||
* @param[in] : void
|
||||
* @return : void
|
||||
*
|
||||
* @usage
|
||||
* \li Defined internally in platforms/MCU/<MCU>/platform_init.c and called by CRT0
|
||||
* \li Weakly defined in platforms/MCU/<MCU>/platform_init.c. Users may override it as desired
|
||||
*/
|
||||
extern void platform_init_system_clocks( void );
|
||||
extern void init_clocks( void );
|
||||
|
||||
/**
|
||||
* Initialise memory subsystem
|
||||
* This function initialises memory subsystem such as external RAM
|
||||
*
|
||||
* @param[in] : void
|
||||
* @return : void
|
||||
*
|
||||
* @usage
|
||||
* \li Defined internally in platforms/MCU/<MCU>/platform_init.c and called by CRT0
|
||||
* \li Weakly defined in platforms/MCU/<MCU>/platform_init.c. Users may override it as desired
|
||||
*/
|
||||
extern void platform_init_memory( void );
|
||||
|
||||
/**
|
||||
* Initialise default MCU infrastructure
|
||||
* This function initialises default MCU infrastructure such as watchdog
|
||||
*
|
||||
* @param[in] : void
|
||||
* @return : void
|
||||
*
|
||||
* @usage
|
||||
* \li Defined and used internally in platforms/MCU/<MCU>/platform_init.c
|
||||
*/
|
||||
extern void platform_init_mcu_infrastructure( void );
|
||||
|
||||
/**
|
||||
* Initialise connectivity module(s)
|
||||
* This function initialises and puts connectivity modules (Wi-Fi, Bluetooth, etc) into their reset state
|
||||
*
|
||||
* @param[in] : void
|
||||
* @return : void
|
||||
*
|
||||
* @usage
|
||||
* \li Defined and used internally in platforms/MCU/<MCU>/platform_init.c
|
||||
*/
|
||||
extern void platform_init_connectivity_module( void );
|
||||
|
||||
/**
|
||||
* Initialise external devices
|
||||
* This function initialises and puts external peripheral devices on the board such as LEDs, buttons, sensors, etc into their reset state
|
||||
*
|
||||
* @param[in] : void
|
||||
* @return : void
|
||||
*
|
||||
* @usage :
|
||||
* \li MUST be defined in platforms/<Platform>/platform.c
|
||||
* \li Called by @ref platform_init_mcu_infrastructure()
|
||||
*/
|
||||
extern void platform_init_external_devices( void );
|
||||
|
||||
/**
|
||||
* Initialise priorities of interrupts used by the platform peripherals
|
||||
*
|
||||
* @param[in] : void
|
||||
* @return : void
|
||||
*
|
||||
* @usage
|
||||
* \li MUST be defined in platforms/<Platform>/platform.c
|
||||
* \li Called by @ref platform_init_mcu_infrastructure()
|
||||
*/
|
||||
extern void platform_init_peripheral_irq_priorities( void );
|
||||
|
||||
/**
|
||||
* Initialise priorities of interrupts used by the RTOS
|
||||
*
|
||||
* @param[in] : void
|
||||
* @return : void
|
||||
|
||||
* @usage
|
||||
* \li MUST be defined by the RTOS
|
||||
* \li Called by @ref platform_init_mcu_infrastructure()
|
||||
*/
|
||||
extern void platform_init_rtos_irq_priorities( void );
|
||||
|
||||
void init_clocks( void );
|
||||
void init_memory( void );
|
||||
void init_architecture( void) ;
|
||||
void init_platform( void) ;
|
||||
void init_platform_bootloader( void );
|
||||
void startApplication( uint32_t app_addr );
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C" */
|
||||
#endif
|
||||
/**
|
||||
* UNPUBLISHED PROPRIETARY SOURCE CODE
|
||||
* Copyright (c) 2016 MXCHIP Inc.
|
||||
*
|
||||
* The contents of this file may not be disclosed to third parties, copied or
|
||||
* duplicated in any form, in whole or in part, without the prior written
|
||||
* permission of MXCHIP Corporation.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Main
|
||||
*
|
||||
* @param[in] : void
|
||||
* @return : int
|
||||
*
|
||||
* @usage
|
||||
* \li Defined by RTOS or application and called by CRT0
|
||||
*/
|
||||
int main( void );
|
||||
|
||||
/**
|
||||
* Initialise system clock(s)
|
||||
* This function includes initialisation of PLL and switching to fast clock
|
||||
*
|
||||
* @param[in] : void
|
||||
* @return : void
|
||||
*
|
||||
* @usage
|
||||
* \li Defined internally in platforms/MCU/<MCU>/platform_init.c and called by CRT0
|
||||
* \li Weakly defined in platforms/MCU/<MCU>/platform_init.c. Users may override it as desired
|
||||
*/
|
||||
extern void platform_init_system_clocks( void );
|
||||
extern void init_clocks( void );
|
||||
|
||||
/**
|
||||
* Initialise memory subsystem
|
||||
* This function initialises memory subsystem such as external RAM
|
||||
*
|
||||
* @param[in] : void
|
||||
* @return : void
|
||||
*
|
||||
* @usage
|
||||
* \li Defined internally in platforms/MCU/<MCU>/platform_init.c and called by CRT0
|
||||
* \li Weakly defined in platforms/MCU/<MCU>/platform_init.c. Users may override it as desired
|
||||
*/
|
||||
extern void platform_init_memory( void );
|
||||
|
||||
/**
|
||||
* Initialise default MCU infrastructure
|
||||
* This function initialises default MCU infrastructure such as watchdog
|
||||
*
|
||||
* @param[in] : void
|
||||
* @return : void
|
||||
*
|
||||
* @usage
|
||||
* \li Defined and used internally in platforms/MCU/<MCU>/platform_init.c
|
||||
*/
|
||||
extern void platform_init_mcu_infrastructure( void );
|
||||
|
||||
/**
|
||||
* Initialise connectivity module(s)
|
||||
* This function initialises and puts connectivity modules (Wi-Fi, Bluetooth, etc) into their reset state
|
||||
*
|
||||
* @param[in] : void
|
||||
* @return : void
|
||||
*
|
||||
* @usage
|
||||
* \li Defined and used internally in platforms/MCU/<MCU>/platform_init.c
|
||||
*/
|
||||
extern void platform_init_connectivity_module( void );
|
||||
|
||||
/**
|
||||
* Initialise external devices
|
||||
* This function initialises and puts external peripheral devices on the board such as LEDs, buttons, sensors, etc into their reset state
|
||||
*
|
||||
* @param[in] : void
|
||||
* @return : void
|
||||
*
|
||||
* @usage :
|
||||
* \li MUST be defined in platforms/<Platform>/platform.c
|
||||
* \li Called by @ref platform_init_mcu_infrastructure()
|
||||
*/
|
||||
extern void platform_init_external_devices( void );
|
||||
|
||||
/**
|
||||
* Initialise priorities of interrupts used by the platform peripherals
|
||||
*
|
||||
* @param[in] : void
|
||||
* @return : void
|
||||
*
|
||||
* @usage
|
||||
* \li MUST be defined in platforms/<Platform>/platform.c
|
||||
* \li Called by @ref platform_init_mcu_infrastructure()
|
||||
*/
|
||||
extern void platform_init_peripheral_irq_priorities( void );
|
||||
|
||||
/**
|
||||
* Initialise priorities of interrupts used by the RTOS
|
||||
*
|
||||
* @param[in] : void
|
||||
* @return : void
|
||||
|
||||
* @usage
|
||||
* \li MUST be defined by the RTOS
|
||||
* \li Called by @ref platform_init_mcu_infrastructure()
|
||||
*/
|
||||
extern void platform_init_rtos_irq_priorities( void );
|
||||
|
||||
void init_clocks( void );
|
||||
void init_memory( void );
|
||||
void init_architecture( void) ;
|
||||
void init_platform( void) ;
|
||||
void init_platform_bootloader( void );
|
||||
void startApplication( uint32_t app_addr );
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C" */
|
||||
#endif
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
/**
|
||||
* UNPUBLISHED PROPRIETARY SOURCE CODE
|
||||
* Copyright (c) 2016 MXCHIP Inc.
|
||||
*
|
||||
* The contents of this file may not be disclosed to third parties, copied or
|
||||
* duplicated in any form, in whole or in part, without the prior written
|
||||
* permission of MXCHIP Corporation.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __PlatformInternal_h__
|
||||
#define __PlatformInternal_h__
|
||||
|
||||
#include "common.h"
|
||||
|
||||
void init_clocks( void );
|
||||
void init_memory( void );
|
||||
void init_architecture( void) ;
|
||||
void init_platform( void) ;
|
||||
void init_platform_bootloader( void );
|
||||
void startApplication( uint32_t app_addr );
|
||||
|
||||
#endif // __PlatformInternal_h__
|
||||
|
||||
/**
|
||||
* UNPUBLISHED PROPRIETARY SOURCE CODE
|
||||
* Copyright (c) 2016 MXCHIP Inc.
|
||||
*
|
||||
* The contents of this file may not be disclosed to third parties, copied or
|
||||
* duplicated in any form, in whole or in part, without the prior written
|
||||
* permission of MXCHIP Corporation.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __PlatformInternal_h__
|
||||
#define __PlatformInternal_h__
|
||||
|
||||
#include "common.h"
|
||||
|
||||
void init_clocks( void );
|
||||
void init_memory( void );
|
||||
void init_architecture( void) ;
|
||||
void init_platform( void) ;
|
||||
void init_platform_bootloader( void );
|
||||
void startApplication( uint32_t app_addr );
|
||||
|
||||
#endif // __PlatformInternal_h__
|
||||
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
/**
|
||||
* UNPUBLISHED PROPRIETARY SOURCE CODE
|
||||
* Copyright (c) 2016 MXCHIP Inc.
|
||||
*
|
||||
* The contents of this file may not be disclosed to third parties, copied or
|
||||
* duplicated in any form, in whole or in part, without the prior written
|
||||
* permission of MXCHIP Corporation.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __PlatformLogging_h__
|
||||
#define __PlatformLogging_h__
|
||||
|
||||
#include "common.h"
|
||||
#include "debug.h"
|
||||
|
||||
#ifndef MICO_PLATFORM_LOG_INFO_DISABLE
|
||||
#define platform_log(M, ...) custom_log("Platform", M, ##__VA_ARGS__)
|
||||
#define platform_log_trace() custom_log_trace("Platform")
|
||||
#else
|
||||
#define platform_log(M, ...)
|
||||
#define platform_log_trace()
|
||||
#endif
|
||||
|
||||
#endif // __PlatformLogging_h__
|
||||
|
||||
/**
|
||||
* UNPUBLISHED PROPRIETARY SOURCE CODE
|
||||
* Copyright (c) 2016 MXCHIP Inc.
|
||||
*
|
||||
* The contents of this file may not be disclosed to third parties, copied or
|
||||
* duplicated in any form, in whole or in part, without the prior written
|
||||
* permission of MXCHIP Corporation.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __PlatformLogging_h__
|
||||
#define __PlatformLogging_h__
|
||||
|
||||
#include "common.h"
|
||||
#include "debug.h"
|
||||
|
||||
#ifndef MICO_PLATFORM_LOG_INFO_DISABLE
|
||||
#define platform_log(M, ...) custom_log("Platform", M, ##__VA_ARGS__)
|
||||
#define platform_log_trace() custom_log_trace("Platform")
|
||||
#else
|
||||
#define platform_log(M, ...)
|
||||
#define platform_log_trace()
|
||||
#endif
|
||||
|
||||
#endif // __PlatformLogging_h__
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,113 +1,113 @@
|
||||
/**
|
||||
* UNPUBLISHED PROPRIETARY SOURCE CODE
|
||||
* Copyright (c) 2016 MXCHIP Inc.
|
||||
*
|
||||
* The contents of this file may not be disclosed to third parties, copied or
|
||||
* duplicated in any form, in whole or in part, without the prior written
|
||||
* permission of MXCHIP Corporation.
|
||||
*
|
||||
*/
|
||||
|
||||
/** @file
|
||||
* This file provide wlan IO pin define
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "platform_peripheral.h"
|
||||
#include "platform_config.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/******************************************************
|
||||
* Macros
|
||||
******************************************************/
|
||||
|
||||
/******************************************************
|
||||
* Constants
|
||||
******************************************************/
|
||||
|
||||
/******************************************************
|
||||
* Enumerations
|
||||
******************************************************/
|
||||
|
||||
/******************************************************
|
||||
* Type Definitions
|
||||
******************************************************/
|
||||
|
||||
/**
|
||||
* WLAN control pins
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
WIFI_PIN_POWER,
|
||||
WIFI_PIN_RESET,
|
||||
WIFI_PIN_32K_CLK,
|
||||
WIFI_PIN_BOOTSTRAP_0,
|
||||
WIFI_PIN_BOOTSTRAP_1,
|
||||
WIFI_PIN_CONTROL_MAX,
|
||||
} wifi_control_pin_t;
|
||||
|
||||
/**
|
||||
* WLAN SDIO pins
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
#ifdef SDIO_1_BIT
|
||||
WIFI_PIN_SDIO_IRQ,
|
||||
#else
|
||||
WIFI_PIN_SDIO_OOB_IRQ,
|
||||
#endif
|
||||
WIFI_PIN_SDIO_CLK,
|
||||
WIFI_PIN_SDIO_CMD,
|
||||
WIFI_PIN_SDIO_D0,
|
||||
#ifndef SDIO_1_BIT
|
||||
WIFI_PIN_SDIO_D1,
|
||||
WIFI_PIN_SDIO_D2,
|
||||
WIFI_PIN_SDIO_D3,
|
||||
#endif
|
||||
WIFI_PIN_SDIO_MAX,
|
||||
} wifi_sdio_pin_t;
|
||||
|
||||
/**
|
||||
* WLAN SPI pins
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
WIFI_PIN_SPI_IRQ,
|
||||
WIFI_PIN_SPI_CS,
|
||||
WIFI_PIN_SPI_CLK,
|
||||
WIFI_PIN_SPI_MOSI,
|
||||
WIFI_PIN_SPI_MISO,
|
||||
WIFI_PIN_SPI_MAX,
|
||||
} emw1062_spi_pin_t;
|
||||
|
||||
/******************************************************
|
||||
* Structures
|
||||
******************************************************/
|
||||
|
||||
/******************************************************
|
||||
* Global Variables
|
||||
******************************************************/
|
||||
|
||||
/* Externed from <MiCO-SDK>/platforms/<Platform>/platform.c */
|
||||
extern const platform_gpio_t wifi_control_pins[];
|
||||
extern const platform_gpio_t wifi_sdio_pins [];
|
||||
extern const platform_gpio_t wifi_spi_pins [];
|
||||
extern const platform_spi_t wifi_spi;
|
||||
|
||||
/******************************************************
|
||||
* Function Declarations
|
||||
******************************************************/
|
||||
|
||||
extern void platform_wifi_spi_rx_dma_irq( void );
|
||||
extern OSStatus host_platform_deinit_wlan_powersave_clock( void );
|
||||
|
||||
extern void set_wifi_chip_id(int type);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C" */
|
||||
#endif
|
||||
/**
|
||||
* UNPUBLISHED PROPRIETARY SOURCE CODE
|
||||
* Copyright (c) 2016 MXCHIP Inc.
|
||||
*
|
||||
* The contents of this file may not be disclosed to third parties, copied or
|
||||
* duplicated in any form, in whole or in part, without the prior written
|
||||
* permission of MXCHIP Corporation.
|
||||
*
|
||||
*/
|
||||
|
||||
/** @file
|
||||
* This file provide wlan IO pin define
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "platform_peripheral.h"
|
||||
#include "platform_config.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/******************************************************
|
||||
* Macros
|
||||
******************************************************/
|
||||
|
||||
/******************************************************
|
||||
* Constants
|
||||
******************************************************/
|
||||
|
||||
/******************************************************
|
||||
* Enumerations
|
||||
******************************************************/
|
||||
|
||||
/******************************************************
|
||||
* Type Definitions
|
||||
******************************************************/
|
||||
|
||||
/**
|
||||
* WLAN control pins
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
WIFI_PIN_POWER,
|
||||
WIFI_PIN_RESET,
|
||||
WIFI_PIN_32K_CLK,
|
||||
WIFI_PIN_BOOTSTRAP_0,
|
||||
WIFI_PIN_BOOTSTRAP_1,
|
||||
WIFI_PIN_CONTROL_MAX,
|
||||
} wifi_control_pin_t;
|
||||
|
||||
/**
|
||||
* WLAN SDIO pins
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
#ifdef SDIO_1_BIT
|
||||
WIFI_PIN_SDIO_IRQ,
|
||||
#else
|
||||
WIFI_PIN_SDIO_OOB_IRQ,
|
||||
#endif
|
||||
WIFI_PIN_SDIO_CLK,
|
||||
WIFI_PIN_SDIO_CMD,
|
||||
WIFI_PIN_SDIO_D0,
|
||||
#ifndef SDIO_1_BIT
|
||||
WIFI_PIN_SDIO_D1,
|
||||
WIFI_PIN_SDIO_D2,
|
||||
WIFI_PIN_SDIO_D3,
|
||||
#endif
|
||||
WIFI_PIN_SDIO_MAX,
|
||||
} wifi_sdio_pin_t;
|
||||
|
||||
/**
|
||||
* WLAN SPI pins
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
WIFI_PIN_SPI_IRQ,
|
||||
WIFI_PIN_SPI_CS,
|
||||
WIFI_PIN_SPI_CLK,
|
||||
WIFI_PIN_SPI_MOSI,
|
||||
WIFI_PIN_SPI_MISO,
|
||||
WIFI_PIN_SPI_MAX,
|
||||
} emw1062_spi_pin_t;
|
||||
|
||||
/******************************************************
|
||||
* Structures
|
||||
******************************************************/
|
||||
|
||||
/******************************************************
|
||||
* Global Variables
|
||||
******************************************************/
|
||||
|
||||
/* Externed from <MiCO-SDK>/platforms/<Platform>/platform.c */
|
||||
extern const platform_gpio_t wifi_control_pins[];
|
||||
extern const platform_gpio_t wifi_sdio_pins [];
|
||||
extern const platform_gpio_t wifi_spi_pins [];
|
||||
extern const platform_spi_t wifi_spi;
|
||||
|
||||
/******************************************************
|
||||
* Function Declarations
|
||||
******************************************************/
|
||||
|
||||
extern void platform_wifi_spi_rx_dma_irq( void );
|
||||
extern OSStatus host_platform_deinit_wlan_powersave_clock( void );
|
||||
|
||||
extern void set_wifi_chip_id(int type);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C" */
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user