[refactor] remove bflb_platform.h from bl602 and bl702 driver,include it in anywhere used
This commit is contained in:
parent
e212f9de4a
commit
9c67a54e24
@ -8,8 +8,6 @@ PROJECT(${BOARD} C CXX ASM)
|
|||||||
# set(CMAKE_VERBOSE_MAKEFILE ON)
|
# set(CMAKE_VERBOSE_MAKEFILE ON)
|
||||||
ENABLE_LANGUAGE(ASM)
|
ENABLE_LANGUAGE(ASM)
|
||||||
|
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/common/misc)
|
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/drivers/${CHIP}_driver/risc-v/Core/Include)
|
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/bsp/bsp_common/platform)
|
include_directories(${CMAKE_SOURCE_DIR}/bsp/bsp_common/platform)
|
||||||
|
|
||||||
if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/bsp/board/${CHIP})
|
if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/bsp/board/${CHIP})
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "hal_clock.h"
|
#include "hal_clock.h"
|
||||||
#include "bl602_glb.h"
|
#include "bl602_glb.h"
|
||||||
#include "bl602_config.h"
|
#include "bl602_config.h"
|
||||||
|
#include "bflb_platform.h"
|
||||||
|
|
||||||
struct pin_mux_cfg {
|
struct pin_mux_cfg {
|
||||||
uint8_t pin;
|
uint8_t pin;
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "hal_clock.h"
|
#include "hal_clock.h"
|
||||||
#include "bl702_glb.h"
|
#include "bl702_glb.h"
|
||||||
#include "bl702_config.h"
|
#include "bl702_config.h"
|
||||||
|
#include "bflb_platform.h"
|
||||||
|
|
||||||
struct pin_mux_cfg {
|
struct pin_mux_cfg {
|
||||||
uint8_t pin;
|
uint8_t pin;
|
||||||
|
@ -433,7 +433,7 @@ void ES8388_I2C_Init(void)
|
|||||||
* @return None
|
* @return None
|
||||||
*
|
*
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
BL_Err_Type ES8388_Reg_Dump(void)
|
void ES8388_Reg_Dump(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
uint8_t tmp;
|
uint8_t tmp;
|
||||||
@ -446,7 +446,6 @@ BL_Err_Type ES8388_Reg_Dump(void)
|
|||||||
bflb_platform_printf("Reg[%02d]=0x%02x \n", i, tmp);
|
bflb_platform_printf("Reg[%02d]=0x%02x \n", i, tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
return SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@} end of group ES8388_Private_Functions */
|
/*@} end of group ES8388_Private_Functions */
|
||||||
|
@ -181,7 +181,7 @@ typedef struct
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
void ES8388_Init(ES8388_Cfg_Type *cfg);
|
void ES8388_Init(ES8388_Cfg_Type *cfg);
|
||||||
BL_Err_Type ES8388_Reg_Dump(void);
|
void ES8388_Reg_Dump(void);
|
||||||
int ES8388_Set_Voice_Volume(int volume);
|
int ES8388_Set_Voice_Volume(int volume);
|
||||||
|
|
||||||
/*@} end of group ES8388_Public_Functions */
|
/*@} end of group ES8388_Public_Functions */
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
#include "hal_emac.h"
|
#include "hal_emac.h"
|
||||||
#include <FreeRTOS.h>
|
#include <FreeRTOS.h>
|
||||||
#include "semphr.h"
|
#include "semphr.h"
|
||||||
|
#include "bflb_platform.h"
|
||||||
/* Private typedef -----------------------------------------------------------*/
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
/* Private define ------------------------------------------------------------*/
|
/* Private define ------------------------------------------------------------*/
|
||||||
/* Network interface name */
|
/* Network interface name */
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include "bsp_il9341.h"
|
#include "bsp_il9341.h"
|
||||||
#include "hal_spi.h"
|
#include "hal_spi.h"
|
||||||
#include "hal_dma.h"
|
#include "hal_dma.h"
|
||||||
@ -625,7 +625,7 @@ void LCD_DrawChinese(uint16_t x, uint16_t y, uint8_t *character, uint16_t bk_col
|
|||||||
// color为字体颜色,bk_color为背景颜色,num为最大显示数量(汉字算两个)
|
// color为字体颜色,bk_color为背景颜色,num为最大显示数量(汉字算两个)
|
||||||
void LCD_DrawFont(uint16_t x, uint16_t y, uint16_t color, uint16_t bk_color, uint8_t *str, uint8_t num)
|
void LCD_DrawFont(uint16_t x, uint16_t y, uint16_t color, uint16_t bk_color, uint8_t *str, uint8_t num)
|
||||||
{
|
{
|
||||||
uint8_t i, j, k, l, x0 = x;
|
uint8_t i, j, k, x0 = x;
|
||||||
uint8_t temp, m;
|
uint8_t temp, m;
|
||||||
|
|
||||||
for (i = 0; i < num && *str; i++, str++) {
|
for (i = 0; i < num && *str; i++, str++) {
|
||||||
@ -701,7 +701,7 @@ void LCD_DrawFont(uint16_t x, uint16_t y, uint16_t color, uint16_t bk_color, uin
|
|||||||
|
|
||||||
void LCD_DrawFont_64x32(uint16_t x, uint16_t y, uint16_t color, uint16_t bk_color, uint8_t *str, uint8_t num)
|
void LCD_DrawFont_64x32(uint16_t x, uint16_t y, uint16_t color, uint16_t bk_color, uint8_t *str, uint8_t num)
|
||||||
{
|
{
|
||||||
uint16_t i, j, k, l, x0 = x;
|
uint16_t i, j, k, x0 = x;
|
||||||
uint8_t temp, m;
|
uint8_t temp, m;
|
||||||
|
|
||||||
for (i = 0; i < num && *str; i++, str++) {
|
for (i = 0; i < num && *str; i++, str++) {
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include "bsp_image_sensor.h"
|
#include "bsp_image_sensor.h"
|
||||||
#include "bl702_glb.h"
|
#include "bl702_glb.h"
|
||||||
#include "hal_gpio.h"
|
#include "hal_gpio.h"
|
||||||
|
@ -52,7 +52,7 @@ int lcd_auto_swap_set(uint8_t flag)
|
|||||||
* @param color_num color num
|
* @param color_num color num
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
int lcd_swap_color_data16(uint16_t *dst, uint16_t *src, size_t color_num)
|
int lcd_swap_color_data16(uint16_t *dst, uint16_t *src, uint32_t color_num)
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < color_num; i++) {
|
for (size_t i = 0; i < color_num; i++) {
|
||||||
dst[i] = (src[i] << 8) | (src[i] >> 8);
|
dst[i] = (src[i] << 8) | (src[i] >> 8);
|
||||||
|
@ -61,7 +61,7 @@ extern struct device *lcd_dev_ifs;
|
|||||||
extern uint8_t lcd_auto_swap_flag;
|
extern uint8_t lcd_auto_swap_flag;
|
||||||
|
|
||||||
int lcd_auto_swap_set(uint8_t flag);
|
int lcd_auto_swap_set(uint8_t flag);
|
||||||
int lcd_swap_color_data16(uint16_t *dst, uint16_t *src, size_t num);
|
int lcd_swap_color_data16(uint16_t *dst, uint16_t *src, uint32_t num);
|
||||||
int lcd_init(void);
|
int lcd_init(void);
|
||||||
int lcd_set_dir(uint8_t dir, uint8_t mir_flag);
|
int lcd_set_dir(uint8_t dir, uint8_t mir_flag);
|
||||||
int lcd_get_dir();
|
int lcd_get_dir();
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include "hal_spi.h"
|
#include "hal_spi.h"
|
||||||
#include "hal_gpio.h"
|
#include "hal_gpio.h"
|
||||||
#include "font.h"
|
#include "font.h"
|
||||||
|
#include "bflb_platform.h"
|
||||||
|
|
||||||
#define SSD1306_USING_I2C 0
|
#define SSD1306_USING_I2C 0
|
||||||
#define SSD1306_USING_SPI 1
|
#define SSD1306_USING_SPI 1
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "drv_mmheap.h"
|
#include "drv_mmheap.h"
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
#include "ring_buffer.h"
|
#include "ring_buffer.h"
|
||||||
|
#include "bflb_platform.h"
|
||||||
|
|
||||||
extern uint32_t __HeapBase;
|
extern uint32_t __HeapBase;
|
||||||
extern uint32_t __HeapLimit;
|
extern uint32_t __HeapLimit;
|
||||||
|
@ -28,8 +28,12 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "misc.h"
|
#include <stdio.h>
|
||||||
//#include "mcu_sdk_version.h"
|
#include <string.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#define MSG(a, ...) bflb_platform_printf(a, ##__VA_ARGS__)
|
#define MSG(a, ...) bflb_platform_printf(a, ##__VA_ARGS__)
|
||||||
#define MSG_DBG(a, ...) bflb_platform_printf(a, ##__VA_ARGS__)
|
#define MSG_DBG(a, ...) bflb_platform_printf(a, ##__VA_ARGS__)
|
||||||
@ -78,13 +82,6 @@ extern "C" {
|
|||||||
#define LOG_E(fmt, ...) dbg_log_line("E", 31, fmt, ##__VA_ARGS__)
|
#define LOG_E(fmt, ...) dbg_log_line("E", 31, fmt, ##__VA_ARGS__)
|
||||||
#define LOG_RAW(...) bflb_platform_printf(__VA_ARGS__)
|
#define LOG_RAW(...) bflb_platform_printf(__VA_ARGS__)
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
void check_failed(uint8_t *file, uint32_t line);
|
|
||||||
#define CHECK_PARAM(expr) ((expr) ? (void)0 : check_failed((uint8_t *)__FILE__, __LINE__))
|
|
||||||
#else
|
|
||||||
#define CHECK_PARAM(expr) ((void)0)
|
|
||||||
#endif /* DEBUG */
|
|
||||||
|
|
||||||
void bflb_platform_init(uint32_t baudrate);
|
void bflb_platform_init(uint32_t baudrate);
|
||||||
void bflb_platform_printf(char *fmt, ...);
|
void bflb_platform_printf(char *fmt, ...);
|
||||||
void bflb_platform_print_set(uint8_t disable);
|
void bflb_platform_print_set(uint8_t disable);
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include "hal_spi.h"
|
#include "hal_spi.h"
|
||||||
#include "hal_gpio.h"
|
#include "hal_gpio.h"
|
||||||
#include "hal_dma.h"
|
#include "hal_dma.h"
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include "hal_gpio.h"
|
#include "hal_gpio.h"
|
||||||
#include "uart_interface.h"
|
#include "uart_interface.h"
|
||||||
#include "hal_usb.h"
|
#include "hal_usb.h"
|
||||||
|
@ -20,9 +20,9 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include "wm8978.h"
|
|
||||||
#include "hal_i2c.h"
|
#include "hal_i2c.h"
|
||||||
|
#include "bsp_wm8978.h"
|
||||||
|
|
||||||
struct device *wm8978_i2c = NULL;
|
struct device *wm8978_i2c = NULL;
|
||||||
|
|
@ -23,7 +23,8 @@
|
|||||||
|
|
||||||
#ifndef __WM8978_H
|
#ifndef __WM8978_H
|
||||||
#define __WM8978_H
|
#define __WM8978_H
|
||||||
#include "bflb_platform.h"
|
|
||||||
|
#include "stdint.h"
|
||||||
|
|
||||||
#define WM8978_ADDR 0X1A
|
#define WM8978_ADDR 0X1A
|
||||||
|
|
@ -302,7 +302,26 @@ void *mmheap_realloc(struct heap_info *pRoot, void *src_addr, size_t want_size)
|
|||||||
}
|
}
|
||||||
return pReturn;
|
return pReturn;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
*
|
||||||
|
* @param pRoot
|
||||||
|
* @param num
|
||||||
|
* @param size
|
||||||
|
* @return void*
|
||||||
|
*/
|
||||||
|
void *mmheap_calloc(struct heap_info *pRoot, size_t num, size_t size)
|
||||||
|
{
|
||||||
|
void *pReturn = NULL;
|
||||||
|
|
||||||
|
pReturn = (void *)mmheap_alloc(pRoot, size * num);
|
||||||
|
|
||||||
|
if (pReturn) {
|
||||||
|
memset(pReturn, 0, num * size);
|
||||||
|
}
|
||||||
|
|
||||||
|
return pReturn;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @brief mmheap_free
|
* @brief mmheap_free
|
||||||
*
|
*
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "bflb_platform.h"
|
|
||||||
|
|
||||||
#ifndef MMHEAP_LOCK
|
#ifndef MMHEAP_LOCK
|
||||||
#define MMHEAP_LOCK()
|
#define MMHEAP_LOCK()
|
||||||
@ -39,12 +38,12 @@
|
|||||||
#ifndef MMHEAP_ASSERT
|
#ifndef MMHEAP_ASSERT
|
||||||
#define MMHEAP_ASSERT(A) \
|
#define MMHEAP_ASSERT(A) \
|
||||||
if (!(A)) \
|
if (!(A)) \
|
||||||
bflb_platform_printf("mmheap malloc error:drv_mmheap,%d\r\n", __LINE__)
|
printf("mmheap malloc error:drv_mmheap,%d\r\n", __LINE__)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MMHEAP_MALLOC_FAIL
|
#ifndef MMHEAP_MALLOC_FAIL
|
||||||
#define MMHEAP_MALLOC_FAIL() bflb_platform_printf("mmheap malloc fail:drv_mmheap,%d\r\n", __LINE__)
|
#define MMHEAP_MALLOC_FAIL() printf("mmheap malloc fail:drv_mmheap,%d\r\n", __LINE__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@ -117,6 +116,23 @@ void *mmheap_alloc(struct heap_info *pRoot, size_t want_size);
|
|||||||
* @return the new pointer to the allocated memory.
|
* @return the new pointer to the allocated memory.
|
||||||
*/
|
*/
|
||||||
void *mmheap_realloc(struct heap_info *pRoot, void *src_addr, size_t want_size);
|
void *mmheap_realloc(struct heap_info *pRoot, void *src_addr, size_t want_size);
|
||||||
|
/**
|
||||||
|
* @brief Cealloc memory from the heap.
|
||||||
|
* Change the size of the memory block pointed to by ptr to size bytes.
|
||||||
|
*
|
||||||
|
* @attention
|
||||||
|
* <ul>
|
||||||
|
* <li> if ptr is NULL, then the call is equivalent to mmheap_alloc(size), for all values of size.
|
||||||
|
* <li> if ptr is if size is equal to zero, and ptr is not NULL, then the call is equivalent to mmheap_free(ptr).
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @param[in] pRoot heap info.
|
||||||
|
* @param[in] num size number.
|
||||||
|
* @param[in] size new size of the memory space.
|
||||||
|
*
|
||||||
|
* @return the new pointer to the allocated memory.
|
||||||
|
*/
|
||||||
|
void *mmheap_calloc(struct heap_info *pRoot, size_t num, size_t size);
|
||||||
/**
|
/**
|
||||||
* @brief Free the memory.
|
* @brief Free the memory.
|
||||||
* Free the memory space pointed to by ptr, which must have been returned by a previous call to mmheap_alloc(), mmheap_aligned_alloc(), or mmheap_realloc().
|
* Free the memory space pointed to by ptr, which must have been returned by a previous call to mmheap_alloc(), mmheap_aligned_alloc(), or mmheap_realloc().
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Std driver attribute macro*/
|
/* Std driver attribute macro*/
|
||||||
#ifndef BFLB_USE_CUSTOM_LD_SECTIONS
|
#ifndef BFLB_USE_CUSTOM_LD_SECTIONS
|
||||||
//#define ATTR_UNI_SYMBOL
|
//#define ATTR_UNI_SYMBOL
|
||||||
#define ATTR_STRINGIFY(x) #x
|
#define ATTR_STRINGIFY(x) #x
|
||||||
#define ATTR_TOSTRING(x) ATTR_STRINGIFY(x)
|
#define ATTR_TOSTRING(x) ATTR_STRINGIFY(x)
|
||||||
|
@ -43,6 +43,13 @@
|
|||||||
#define CHECK_PARAM(expr) ((void)0)
|
#define CHECK_PARAM(expr) ((void)0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Null Type definition
|
||||||
|
*/
|
||||||
|
#ifndef NULL
|
||||||
|
#define NULL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Error type definition
|
* @brief Error type definition
|
||||||
*/
|
*/
|
||||||
@ -100,27 +107,6 @@ typedef enum {
|
|||||||
typedef void(intCallback_Type)(void);
|
typedef void(intCallback_Type)(void);
|
||||||
typedef void (*pFunc)(void);
|
typedef void (*pFunc)(void);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Null Type definition
|
|
||||||
*/
|
|
||||||
#ifndef NULL
|
|
||||||
#define NULL 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define BL602_MemCpy arch_memcpy
|
|
||||||
#define BL602_MemSet arch_memset
|
|
||||||
#define BL602_MemCmp arch_memcmp
|
|
||||||
#define BL602_MemCpy4 arch_memcpy4
|
|
||||||
#define BL602_MemCpy_Fast arch_memcpy_fast
|
|
||||||
#define BL602_MemSet4 arch_memset4
|
|
||||||
|
|
||||||
#define BL702_MemCpy arch_memcpy
|
|
||||||
#define BL702_MemSet arch_memset
|
|
||||||
#define BL702_MemCmp arch_memcmp
|
|
||||||
#define BL702_MemCpy4 arch_memcpy4
|
|
||||||
#define BL702_MemCpy_Fast arch_memcpy_fast
|
|
||||||
#define BL702_MemSet4 arch_memset4
|
|
||||||
|
|
||||||
#define ARCH_MemCpy arch_memcpy
|
#define ARCH_MemCpy arch_memcpy
|
||||||
#define ARCH_MemSet arch_memset
|
#define ARCH_MemSet arch_memset
|
||||||
#define ARCH_MemCmp arch_memcmp
|
#define ARCH_MemCmp arch_memcmp
|
||||||
@ -128,6 +114,13 @@ typedef void (*pFunc)(void);
|
|||||||
#define ARCH_MemCpy_Fast arch_memcpy_fast
|
#define ARCH_MemCpy_Fast arch_memcpy_fast
|
||||||
#define ARCH_MemSet4 arch_memset4
|
#define ARCH_MemSet4 arch_memset4
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
void check_failed(uint8_t *file, uint32_t line);
|
||||||
|
#define CHECK_PARAM(expr) ((expr) ? (void)0 : check_failed((uint8_t *)__FILE__, __LINE__))
|
||||||
|
#else
|
||||||
|
#define CHECK_PARAM(expr) ((void)0)
|
||||||
|
#endif /* DEBUG */
|
||||||
|
|
||||||
void *arch_memcpy(void *dst, const void *src, uint32_t n);
|
void *arch_memcpy(void *dst, const void *src, uint32_t n);
|
||||||
void *arch_memset(void *s, uint8_t c, uint32_t n);
|
void *arch_memset(void *s, uint8_t c, uint32_t n);
|
||||||
int arch_memcmp(const void *s1, const void *s2, uint32_t n);
|
int arch_memcmp(const void *s1, const void *s2, uint32_t n);
|
||||||
|
@ -36,10 +36,7 @@
|
|||||||
#ifndef __PARTITION_H__
|
#ifndef __PARTITION_H__
|
||||||
#define __PARTITION_H__
|
#define __PARTITION_H__
|
||||||
|
|
||||||
#include "stdint.h"
|
|
||||||
#include "string.h"
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
//#include "bflb_bsp_driver_glue.h"
|
|
||||||
|
|
||||||
/** @addtogroup BFLB_Common_Driver
|
/** @addtogroup BFLB_Common_Driver
|
||||||
* @{
|
* @{
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#ifndef __PID_H__
|
#ifndef __PID_H__
|
||||||
#define __PID_H__
|
#define __PID_H__
|
||||||
|
|
||||||
#include "stdio.h"
|
#include "stdint.h"
|
||||||
|
|
||||||
typedef struct pid_alg {
|
typedef struct pid_alg {
|
||||||
float set_val;
|
float set_val;
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "timestamp.h"
|
#include "timestamp.h"
|
||||||
#include "misc.h"
|
|
||||||
|
|
||||||
#define FOUR_YEAR_DAY ((365 << 2) + 1) //The total number of days in a 4-year cycle
|
#define FOUR_YEAR_DAY ((365 << 2) + 1) //The total number of days in a 4-year cycle
|
||||||
#define TIMEZONE (8) //Beijing time Zone adjustment
|
#define TIMEZONE (8) //Beijing time Zone adjustment
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#define _TIMESTAMP_
|
#define _TIMESTAMP_
|
||||||
|
|
||||||
#include "stdint.h"
|
#include "stdint.h"
|
||||||
|
#include "stddef.h"
|
||||||
#include "stdbool.h"
|
#include "stdbool.h"
|
||||||
|
|
||||||
typedef struct _rtc_time_t
|
typedef struct _rtc_time_t
|
||||||
@ -36,6 +37,7 @@ typedef struct _rtc_time_t
|
|||||||
uint8_t minute;
|
uint8_t minute;
|
||||||
uint8_t second;
|
uint8_t second;
|
||||||
}rtc_time;
|
}rtc_time;
|
||||||
|
|
||||||
void unixtime2bejingtime(uint32_t unixtime,rtc_time* beijing_time);
|
void unixtime2bejingtime(uint32_t unixtime,rtc_time* beijing_time);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -99,7 +99,7 @@
|
|||||||
/* Automatically defrag. on free. Defrag. means joining the adjacent free cells. */
|
/* Automatically defrag. on free. Defrag. means joining the adjacent free cells. */
|
||||||
#define LV_MEM_AUTO_DEFRAG 1
|
#define LV_MEM_AUTO_DEFRAG 1
|
||||||
#else /*LV_MEM_CUSTOM*/
|
#else /*LV_MEM_CUSTOM*/
|
||||||
#define LV_MEM_CUSTOM_INCLUDE "stdio.h" /*Header for the dynamic memory function*/
|
#define LV_MEM_CUSTOM_INCLUDE "stdlib.h" /*Header for the dynamic memory function*/
|
||||||
#define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/
|
#define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/
|
||||||
#define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
|
#define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
|
||||||
#endif /*LV_MEM_CUSTOM*/
|
#endif /*LV_MEM_CUSTOM*/
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* Change Logs:
|
* Change Logs:
|
||||||
* Date Author Notes
|
* Date Author Notes
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include <rthw.h>
|
#include <rthw.h>
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
#include "hal_uart.h"
|
#include "hal_uart.h"
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* Change Logs:
|
* Change Logs:
|
||||||
* Date Author Notes
|
* Date Author Notes
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include <rthw.h>
|
#include <rthw.h>
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
#include "hal_uart.h"
|
#include "hal_uart.h"
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
#define _USB_DC_H
|
#define _USB_DC_H
|
||||||
|
|
||||||
#include "stdint.h"
|
#include "stdint.h"
|
||||||
#include "bflb_platform.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -5,7 +5,9 @@
|
|||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "stdint.h"
|
#include "stdint.h"
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
|
#include "stdlib.h"
|
||||||
#include "usb_slist.h"
|
#include "usb_slist.h"
|
||||||
|
#include "bflb_platform.h"
|
||||||
|
|
||||||
#ifndef __packed
|
#ifndef __packed
|
||||||
#define __packed __attribute__((__packed__))
|
#define __packed __attribute__((__packed__))
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#include "bflb_platform.h"
|
#include "bflb_platform.h"
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
static uint8_t *mallocBuf = NULL;
|
static uint8_t *mallocBuf = NULL;
|
||||||
static uint32_t malloced = 0;
|
static uint32_t malloced = 0;
|
||||||
static uint32_t bufsize = 0;
|
static uint32_t bufsize = 0;
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#define __HAL_CLOCK__H__
|
#define __HAL_CLOCK__H__
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "bl602_config.h"
|
||||||
|
|
||||||
/*XTAL_TYPE*/
|
/*XTAL_TYPE*/
|
||||||
#define XTAL_NONE 0
|
#define XTAL_NONE 0
|
||||||
|
@ -23,9 +23,7 @@
|
|||||||
#ifndef __HAL_COMMON__H__
|
#ifndef __HAL_COMMON__H__
|
||||||
#define __HAL_COMMON__H__
|
#define __HAL_COMMON__H__
|
||||||
|
|
||||||
#include "drv_device.h"
|
|
||||||
#include "bl602_common.h"
|
#include "bl602_common.h"
|
||||||
#include "bl602_config.h"
|
|
||||||
|
|
||||||
void cpu_global_irq_enable(void);
|
void cpu_global_irq_enable(void);
|
||||||
void cpu_global_irq_disable(void);
|
void cpu_global_irq_disable(void);
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
#define __HAL_DMA__H__
|
#define __HAL_DMA__H__
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl602_config.h"
|
||||||
|
|
||||||
#define DMA_CHANNEL_GET_STATUS 0x10
|
#define DMA_CHANNEL_GET_STATUS 0x10
|
||||||
#define DMA_CHANNEL_START 0x11
|
#define DMA_CHANNEL_START 0x11
|
||||||
|
@ -37,6 +37,8 @@
|
|||||||
#define __HAL_GPIO__H__
|
#define __HAL_GPIO__H__
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl602_config.h"
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
GPIO_PIN_0 = 0,
|
GPIO_PIN_0 = 0,
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
#define __HAL_SEC_HASH__H__
|
#define __HAL_SEC_HASH__H__
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl602_config.h"
|
||||||
|
|
||||||
enum sec_hash_index_type {
|
enum sec_hash_index_type {
|
||||||
SEC_HASH0_INDEX,
|
SEC_HASH0_INDEX,
|
||||||
|
@ -37,6 +37,8 @@
|
|||||||
#define __HAL_UART__H__
|
#define __HAL_UART__H__
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl602_config.h"
|
||||||
|
|
||||||
#define UART_FIFO_LEN 32
|
#define UART_FIFO_LEN 32
|
||||||
|
|
||||||
|
@ -133,11 +133,13 @@ BL_Err_Type ATTR_TCM_SECTION flash_init(void)
|
|||||||
g_flash_cfg.ioMode = g_flash_cfg.ioMode & 0x0f;
|
g_flash_cfg.ioMode = g_flash_cfg.ioMode & 0x0f;
|
||||||
|
|
||||||
ret = flash_config_init(&g_flash_cfg, (uint8_t *)&jedec_id);
|
ret = flash_config_init(&g_flash_cfg, (uint8_t *)&jedec_id);
|
||||||
|
#if 0
|
||||||
MSG("flash ID = %08x\r\n", jedec_id);
|
MSG("flash ID = %08x\r\n", jedec_id);
|
||||||
bflb_platform_dump((uint8_t *)&g_flash_cfg, sizeof(g_flash_cfg));
|
bflb_platform_dump((uint8_t *)&g_flash_cfg, sizeof(g_flash_cfg));
|
||||||
if (ret != SUCCESS) {
|
if (ret != SUCCESS) {
|
||||||
MSG("flash config init fail!\r\n");
|
MSG("flash config init fail!\r\n");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
g_flash_cfg.clkDelay = clkDelay;
|
g_flash_cfg.clkDelay = clkDelay;
|
||||||
g_flash_cfg.clkInvert = clkInvert;
|
g_flash_cfg.clkInvert = clkInvert;
|
||||||
|
|
||||||
|
@ -449,7 +449,7 @@ static int sec_ecdsa_verify_point_mul(uint8_t id, const uint32_t *m)
|
|||||||
#endif
|
#endif
|
||||||
} else if (pka_p1_eq_inf == 0 && pka_p2_eq_inf == 1) {
|
} else if (pka_p1_eq_inf == 0 && pka_p2_eq_inf == 1) {
|
||||||
//sum = X1
|
//sum = X1
|
||||||
MSG("sum = X1\r\n");
|
//MSG("sum = X1\r\n");
|
||||||
} else if (pka_p1_eq_inf == 0 && pka_p2_eq_inf == 0) {
|
} else if (pka_p1_eq_inf == 0 && pka_p2_eq_inf == 0) {
|
||||||
//sum = X1 + X2
|
//sum = X1 + X2
|
||||||
sec_ecdsa_point_add(id);
|
sec_ecdsa_point_add(id);
|
||||||
@ -458,7 +458,7 @@ static int sec_ecdsa_verify_point_mul(uint8_t id, const uint32_t *m)
|
|||||||
sec_ecdsa_dump_temp_result();
|
sec_ecdsa_dump_temp_result();
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
MSG("Error! infinite point + infinite point\r\n");
|
//MSG("Error! infinite point + infinite point\r\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,8 @@
|
|||||||
#include "bl602_glb.h"
|
#include "bl602_glb.h"
|
||||||
#include "uart_config.h"
|
#include "uart_config.h"
|
||||||
|
|
||||||
|
#define UART_CLOCK (40000000)
|
||||||
|
|
||||||
#ifdef BSP_USING_UART0
|
#ifdef BSP_USING_UART0
|
||||||
void UART0_IRQ(void);
|
void UART0_IRQ(void);
|
||||||
#endif
|
#endif
|
||||||
@ -74,17 +76,18 @@ int uart_open(struct device *dev, uint16_t oflag)
|
|||||||
/* disable uart before config */
|
/* disable uart before config */
|
||||||
UART_Disable(uart_device->id, UART_TXRX);
|
UART_Disable(uart_device->id, UART_TXRX);
|
||||||
|
|
||||||
uint32_t uart_clk = peripheral_clock_get(PERIPHERAL_CLOCK_UART);
|
//uint32_t uart_clk = peripheral_clock_get(PERIPHERAL_CLOCK_UART);
|
||||||
|
|
||||||
uart_cfg.baudRate = uart_device->baudrate;
|
uart_cfg.baudRate = uart_device->baudrate;
|
||||||
uart_cfg.dataBits = uart_device->databits;
|
uart_cfg.dataBits = uart_device->databits;
|
||||||
uart_cfg.stopBits = uart_device->stopbits;
|
uart_cfg.stopBits = uart_device->stopbits;
|
||||||
uart_cfg.parity = uart_device->parity;
|
uart_cfg.parity = uart_device->parity;
|
||||||
uart_cfg.uartClk = uart_clk;
|
uart_cfg.uartClk = UART_CLOCK;
|
||||||
uart_cfg.ctsFlowControl = UART_CTS_FLOWCONTROL_ENABLE;
|
uart_cfg.ctsFlowControl = UART_CTS_FLOWCONTROL_ENABLE;
|
||||||
uart_cfg.rtsSoftwareControl = UART_RTS_FLOWCONTROL_ENABLE;
|
uart_cfg.rtsSoftwareControl = UART_RTS_FLOWCONTROL_ENABLE;
|
||||||
uart_cfg.byteBitInverse = UART_MSB_FIRST_ENABLE;
|
uart_cfg.byteBitInverse = UART_MSB_FIRST_ENABLE;
|
||||||
|
|
||||||
|
GLB_Set_UART_CLK(ENABLE, HBN_UART_CLK_160M, 160000000 / UART_CLOCK - 1);
|
||||||
/* uart init with default configuration */
|
/* uart init with default configuration */
|
||||||
UART_Init(uart_device->id, &uart_cfg);
|
UART_Init(uart_device->id, &uart_cfg);
|
||||||
|
|
||||||
@ -170,8 +173,10 @@ int uart_control(struct device *dev, int cmd, void *args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (uart_device->id == UART0_ID) {
|
if (uart_device->id == UART0_ID) {
|
||||||
|
Interrupt_Handler_Register(UART0_IRQn, UART0_IRQ);
|
||||||
CPU_Interrupt_Enable(UART0_IRQn);
|
CPU_Interrupt_Enable(UART0_IRQn);
|
||||||
} else if (uart_device->id == UART1_ID) {
|
} else if (uart_device->id == UART1_ID) {
|
||||||
|
Interrupt_Handler_Register(UART1_IRQn, UART1_IRQ);
|
||||||
CPU_Interrupt_Enable(UART1_IRQn);
|
CPU_Interrupt_Enable(UART1_IRQn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "bl602.h"
|
#include "bl602_common.h"
|
||||||
#include "bflb_platform.h"
|
#include "bflb_platform.h"
|
||||||
|
|
||||||
pFunc __Interrupt_Handlers[IRQn_LAST] = { 0 };
|
pFunc __Interrupt_Handlers[IRQn_LAST] = { 0 };
|
||||||
@ -305,6 +305,10 @@ void Interrupt_Handler_Register(IRQn_Type irq, pFunc interruptFun)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void System_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void clic_enable_interrupt(uint32_t source)
|
void clic_enable_interrupt(uint32_t source)
|
||||||
{
|
{
|
||||||
*(volatile uint8_t *)(CLIC_HART0_ADDR + CLIC_INTIE + source) = 1;
|
*(volatile uint8_t *)(CLIC_HART0_ADDR + CLIC_INTIE + source) = 1;
|
||||||
|
@ -80,16 +80,9 @@ void SystemInit(void)
|
|||||||
|
|
||||||
/*identify flash config automaticly*/
|
/*identify flash config automaticly*/
|
||||||
extern BL_Err_Type flash_init(void);
|
extern BL_Err_Type flash_init(void);
|
||||||
extern void bflb_platform_print_set(uint8_t disable);
|
|
||||||
void System_Post_Init(void)
|
void System_Post_Init(void)
|
||||||
{
|
{
|
||||||
PDS_Trim_RC32M();
|
PDS_Trim_RC32M();
|
||||||
HBN_Trim_RC32K();
|
HBN_Trim_RC32K();
|
||||||
bflb_platform_print_set(1);
|
|
||||||
flash_init();
|
flash_init();
|
||||||
bflb_platform_print_set(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void System_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority)
|
|
||||||
{
|
|
||||||
}
|
}
|
@ -2,7 +2,7 @@
|
|||||||
#define __BL602_COMMON_H__
|
#define __BL602_COMMON_H__
|
||||||
|
|
||||||
#include "bl602.h"
|
#include "bl602.h"
|
||||||
#include "bflb_platform.h"
|
#include "misc.h"
|
||||||
|
|
||||||
#ifndef __NOP
|
#ifndef __NOP
|
||||||
#define __NOP() __ASM volatile("nop") /* This implementation generates debug information */
|
#define __NOP() __ASM volatile("nop") /* This implementation generates debug information */
|
||||||
@ -57,6 +57,32 @@ __ALWAYS_STATIC_INLINE void __disable_irq(void)
|
|||||||
__ASM volatile("csrc mstatus, 8");
|
__ASM volatile("csrc mstatus, 8");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @defgroup COMMON_Public_Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DRIVER_INT_PERIPH
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define IS_INT_PERIPH(INT_PERIPH) ((INT_PERIPH) < IRQn_LAST)
|
||||||
|
|
||||||
|
/*@} end of group DRIVER_INT_PERIPH */
|
||||||
|
|
||||||
|
/** @defgroup DRIVER_INT_MASK
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define IS_BL_MASK_TYPE(type) (((type) == MASK) || ((type) == UNMASK))
|
||||||
|
|
||||||
|
/*@} end of group COMMON_Public_Constants */
|
||||||
|
|
||||||
|
/*@} end of group DRIVER_Public_Macro */
|
||||||
|
#define BL602_MemCpy arch_memcpy
|
||||||
|
#define BL602_MemSet arch_memset
|
||||||
|
#define BL602_MemCmp arch_memcmp
|
||||||
|
#define BL602_MemCpy4 arch_memcpy4
|
||||||
|
#define BL602_MemCpy_Fast arch_memcpy_fast
|
||||||
|
#define BL602_MemSet4 arch_memset4
|
||||||
|
|
||||||
#define arch_delay_us BL602_Delay_US
|
#define arch_delay_us BL602_Delay_US
|
||||||
#define arch_delay_ms BL602_Delay_MS
|
#define arch_delay_ms BL602_Delay_MS
|
||||||
|
|
||||||
|
@ -1,49 +0,0 @@
|
|||||||
#ifndef __BL602_IT_H__
|
|
||||||
#define __BL602_IT_H__
|
|
||||||
|
|
||||||
#include "bl602.h"
|
|
||||||
#include "bl_common.h"
|
|
||||||
|
|
||||||
/** @addtogroup BL606_Peripheral_Driver
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** @addtogroup COMMON
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** @defgroup COMMON_Public_Types
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*@} end of group COMMON_Public_Types */
|
|
||||||
|
|
||||||
/** @defgroup COMMON_Public_Constants
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** @defgroup DRIVER_INT_PERIPH
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
#define IS_INT_PERIPH(INT_PERIPH) ((INT_PERIPH) < IRQn_LAST)
|
|
||||||
|
|
||||||
/*@} end of group DRIVER_INT_PERIPH */
|
|
||||||
|
|
||||||
/** @defgroup DRIVER_INT_MASK
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
#define IS_BL_MASK_TYPE(type) (((type) == MASK) || ((type) == UNMASK))
|
|
||||||
|
|
||||||
/*@} end of group COMMON_Public_Constants */
|
|
||||||
|
|
||||||
/*@} end of group DRIVER_Public_Macro */
|
|
||||||
|
|
||||||
/** @defgroup DRIVER_Public_FunctionDeclaration
|
|
||||||
* @brief DRIVER functions declaration
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
void Interrupt_Handler_Register(IRQn_Type irq, pFunc interruptFun);
|
|
||||||
|
|
||||||
/*@} end of group DRIVER_COMMON */
|
|
||||||
|
|
||||||
#endif /* __BL602_COMMON_H__ */
|
|
@ -665,6 +665,11 @@ static const ATTR_TCM_CONST_SECTION Flash_Info_t flashInfos[]={
|
|||||||
//.name="ZD_25Q16B",
|
//.name="ZD_25Q16B",
|
||||||
.cfg=&flashCfg_ZD_25Q16B,
|
.cfg=&flashCfg_ZD_25Q16B,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.jedecID=0x1460CD,
|
||||||
|
//.name="TH_25Q80HB",
|
||||||
|
.cfg=&flashCfg_FM_25Q08,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
/*@} end of group SF_CFG_EXT_Private_Variables */
|
/*@} end of group SF_CFG_EXT_Private_Variables */
|
||||||
|
@ -284,7 +284,7 @@ BL_Err_Type UART_Init(UART_ID_Type uartId, UART_CFG_Type *uartCfg)
|
|||||||
|
|
||||||
BL_WR_REG(UARTx, UART_DATA_CONFIG, tmpValTxCfg);
|
BL_WR_REG(UARTx, UART_DATA_CONFIG, tmpValTxCfg);
|
||||||
|
|
||||||
#if 1 //#ifndef BFLB_USE_HAL_DRIVER
|
#ifndef BFLB_USE_HAL_DRIVER
|
||||||
Interrupt_Handler_Register(UART0_IRQn, UART0_IRQHandler);
|
Interrupt_Handler_Register(UART0_IRQn, UART0_IRQHandler);
|
||||||
Interrupt_Handler_Register(UART1_IRQn, UART1_IRQHandler);
|
Interrupt_Handler_Register(UART1_IRQn, UART1_IRQHandler);
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,6 +6,7 @@ extern "C"{
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
|
||||||
enum acomp_channel_type {
|
enum acomp_channel_type {
|
||||||
ACOMP_CHANNEL_ADC_CHANNEL0, /*!< Analog compare channel,ADC input channel 0 */
|
ACOMP_CHANNEL_ADC_CHANNEL0, /*!< Analog compare channel,ADC input channel 0 */
|
||||||
|
@ -28,6 +28,8 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl702_config.h"
|
||||||
|
|
||||||
#define DEVICE_CTRL_ADC_CHANNEL_START 0x10
|
#define DEVICE_CTRL_ADC_CHANNEL_START 0x10
|
||||||
#define DEVICE_CTRL_ADC_CHANNEL_STOP 0x11
|
#define DEVICE_CTRL_ADC_CHANNEL_STOP 0x11
|
||||||
|
@ -29,6 +29,8 @@ extern "C"{
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl702_config.h"
|
||||||
#include "bl702_cam.h"
|
#include "bl702_cam.h"
|
||||||
|
|
||||||
#define DEVICE_OFLAG_INT 0x01
|
#define DEVICE_OFLAG_INT 0x01
|
||||||
|
@ -28,6 +28,7 @@ extern "C"{
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "bl702_config.h"
|
||||||
|
|
||||||
/*XTAL_TYPE*/
|
/*XTAL_TYPE*/
|
||||||
#define XTAL_NONE 0
|
#define XTAL_NONE 0
|
||||||
|
@ -27,9 +27,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "drv_device.h"
|
|
||||||
#include "bl702_common.h"
|
#include "bl702_common.h"
|
||||||
#include "bl702_config.h"
|
|
||||||
|
|
||||||
void cpu_global_irq_enable(void);
|
void cpu_global_irq_enable(void);
|
||||||
void cpu_global_irq_disable(void);
|
void cpu_global_irq_disable(void);
|
||||||
|
@ -28,6 +28,8 @@ extern "C"{
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl702_config.h"
|
||||||
|
|
||||||
enum dac_index_type {
|
enum dac_index_type {
|
||||||
#ifdef BSP_USING_DAC0
|
#ifdef BSP_USING_DAC0
|
||||||
|
@ -28,6 +28,8 @@ extern "C"{
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl702_config.h"
|
||||||
|
|
||||||
#define DMA_CHANNEL_GET_STATUS 0x10
|
#define DMA_CHANNEL_GET_STATUS 0x10
|
||||||
#define DMA_CHANNEL_START 0x11
|
#define DMA_CHANNEL_START 0x11
|
||||||
|
@ -29,6 +29,8 @@ extern "C"{
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl702_config.h"
|
||||||
#include "bl702_emac.h"
|
#include "bl702_emac.h"
|
||||||
|
|
||||||
typedef struct emac_device {
|
typedef struct emac_device {
|
||||||
|
@ -28,6 +28,8 @@ extern "C"{
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl702_config.h"
|
||||||
|
|
||||||
enum gpio_pin_type {
|
enum gpio_pin_type {
|
||||||
GPIO_PIN_0 = 0,
|
GPIO_PIN_0 = 0,
|
||||||
|
@ -28,6 +28,8 @@ extern "C"{
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl702_config.h"
|
||||||
|
|
||||||
enum i2c_index_type {
|
enum i2c_index_type {
|
||||||
#ifdef BSP_USING_I2C0
|
#ifdef BSP_USING_I2C0
|
||||||
|
@ -28,10 +28,14 @@ extern "C"{
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl702_config.h"
|
||||||
|
|
||||||
#define DEVICE_CTRL_I2S_GET_TX_FIFO 0x10
|
#define DEVICE_CTRL_I2S_GET_TX_FIFO 0x10
|
||||||
#define DEVICE_CTRL_I2S_GET_RX_FIFO 0x11
|
#define DEVICE_CTRL_I2S_GET_RX_FIFO 0x11
|
||||||
|
|
||||||
|
#define DEVICE_CTRL_I2S_SET_SAMPL_FREQ 0x12
|
||||||
|
|
||||||
enum i2s_index_type {
|
enum i2s_index_type {
|
||||||
#ifdef BSP_USING_I2S0
|
#ifdef BSP_USING_I2S0
|
||||||
I2S0_INDEX,
|
I2S0_INDEX,
|
||||||
|
@ -22,11 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef __HAL_KEYSCAN__H__
|
#ifndef __HAL_KEYSCAN__H__
|
||||||
#define __HAL_KEYSCAN__H__
|
#define __HAL_KEYSCAN__H__
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"{
|
extern "C"{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl702_config.h"
|
||||||
|
|
||||||
#define DEVICE_CTRL_KEYSCAN_GET_KEYCODE 0x10
|
#define DEVICE_CTRL_KEYSCAN_GET_KEYCODE 0x10
|
||||||
|
|
||||||
|
@ -22,11 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef __HAL_MJPEG__H__
|
#ifndef __HAL_MJPEG__H__
|
||||||
#define __HAL_MJPEG__H__
|
#define __HAL_MJPEG__H__
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"{
|
extern "C"{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl702_config.h"
|
||||||
|
|
||||||
#define MJPEG_PACKET_ADD_NONE 0
|
#define MJPEG_PACKET_ADD_NONE 0
|
||||||
#define MJPEG_PACKET_ADD_DEFAULT 1 << 0
|
#define MJPEG_PACKET_ADD_DEFAULT 1 << 0
|
||||||
|
@ -22,10 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef __HAL_PWM__H__
|
#ifndef __HAL_PWM__H__
|
||||||
#define __HAL_PWM__H__
|
#define __HAL_PWM__H__
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"{
|
extern "C"{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl702_config.h"
|
||||||
|
|
||||||
#define DEVICE_CTRL_PWM_FREQUENCE_CONFIG 0x10
|
#define DEVICE_CTRL_PWM_FREQUENCE_CONFIG 0x10
|
||||||
#define DEVICE_CTRL_PWM_DUTYCYCLE_CONFIG 0x11
|
#define DEVICE_CTRL_PWM_DUTYCYCLE_CONFIG 0x11
|
||||||
|
@ -23,10 +23,14 @@
|
|||||||
|
|
||||||
#ifndef __HAL_QDEC__H__
|
#ifndef __HAL_QDEC__H__
|
||||||
#define __HAL_QDEC__H__
|
#define __HAL_QDEC__H__
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"{
|
extern "C"{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl702_config.h"
|
||||||
|
|
||||||
#define DEVICE_CTRL_GET_SAMPLE_VAL (0x10)
|
#define DEVICE_CTRL_GET_SAMPLE_VAL (0x10)
|
||||||
#define DEVICE_CTRL_GET_SAMPLE_DIR (0x11)
|
#define DEVICE_CTRL_GET_SAMPLE_DIR (0x11)
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef __HAL_RTC__H__
|
#ifndef __HAL_RTC__H__
|
||||||
#define __HAL_RTC__H__
|
#define __HAL_RTC__H__
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"{
|
extern "C"{
|
||||||
#endif
|
#endif
|
||||||
@ -31,6 +32,7 @@ extern "C"{
|
|||||||
void rtc_init(uint64_t sleep_time);
|
void rtc_init(uint64_t sleep_time);
|
||||||
void rtc_set_timestamp(uint64_t time_stamp);
|
void rtc_set_timestamp(uint64_t time_stamp);
|
||||||
uint64_t rtc_get_timestamp(void);
|
uint64_t rtc_get_timestamp(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef __HAL_SEC_AES__H__
|
#ifndef __HAL_SEC_AES__H__
|
||||||
#define __HAL_SEC_AES__H__
|
#define __HAL_SEC_AES__H__
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"{
|
extern "C"{
|
||||||
#endif
|
#endif
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef __HAL_SEC_DSA__H__
|
#ifndef __HAL_SEC_DSA__H__
|
||||||
#define __HAL_SEC_DSA__H__
|
#define __HAL_SEC_DSA__H__
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"{
|
extern "C"{
|
||||||
#endif
|
#endif
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef __HAL_SEC_ECDSA__H__
|
#ifndef __HAL_SEC_ECDSA__H__
|
||||||
#define __HAL_SEC_ECDSA__H__
|
#define __HAL_SEC_ECDSA__H__
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"{
|
extern "C"{
|
||||||
#endif
|
#endif
|
||||||
|
@ -22,11 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef __HAL_SEC_HASH__H__
|
#ifndef __HAL_SEC_HASH__H__
|
||||||
#define __HAL_SEC_HASH__H__
|
#define __HAL_SEC_HASH__H__
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"{
|
extern "C"{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl702_config.h"
|
||||||
|
|
||||||
enum sec_hash_index_type {
|
enum sec_hash_index_type {
|
||||||
SEC_HASH0_INDEX,
|
SEC_HASH0_INDEX,
|
||||||
|
@ -22,11 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef __HAL_SPI__H__
|
#ifndef __HAL_SPI__H__
|
||||||
#define __HAL_SPI__H__
|
#define __HAL_SPI__H__
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"{
|
extern "C"{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl702_config.h"
|
||||||
|
|
||||||
#define DEVICE_CTRL_SPI_CONFIG_CLOCK 0x10
|
#define DEVICE_CTRL_SPI_CONFIG_CLOCK 0x10
|
||||||
|
|
||||||
|
@ -26,7 +26,10 @@
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"{
|
extern "C"{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl702_config.h"
|
||||||
|
|
||||||
enum timer_index_type {
|
enum timer_index_type {
|
||||||
#ifdef BSP_USING_TIMER0
|
#ifdef BSP_USING_TIMER0
|
||||||
|
@ -22,11 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef __HAL_UART__H__
|
#ifndef __HAL_UART__H__
|
||||||
#define __HAL_UART__H__
|
#define __HAL_UART__H__
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"{
|
extern "C"{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl702_config.h"
|
||||||
|
|
||||||
#define UART_FIFO_LEN 128
|
#define UART_FIFO_LEN 128
|
||||||
|
|
||||||
|
@ -22,12 +22,15 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef __HAL_USB__H__
|
#ifndef __HAL_USB__H__
|
||||||
#define __HAL_USB__H__
|
#define __HAL_USB__H__
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"{
|
extern "C"{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
#include "ring_buffer.h"
|
#include "ring_buffer.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl702_config.h"
|
||||||
|
|
||||||
#define DEVICE_CTRL_USB_DC_SET_ACK 0X10
|
#define DEVICE_CTRL_USB_DC_SET_ACK 0X10
|
||||||
#define DEVICE_CTRL_USB_DC_ENUM_ON 0X11
|
#define DEVICE_CTRL_USB_DC_ENUM_ON 0X11
|
||||||
@ -125,6 +128,16 @@ enum usb_dc_event_type {
|
|||||||
/** USB connection resumed by the HOST */
|
/** USB connection resumed by the HOST */
|
||||||
USB_DC_EVENT_RESUME,
|
USB_DC_EVENT_RESUME,
|
||||||
|
|
||||||
|
/** USB interface selected */
|
||||||
|
USB_DC_EVENT_SET_INTERFACE,
|
||||||
|
/** USB interface selected */
|
||||||
|
USB_DC_EVENT_SET_REMOTE_WAKEUP,
|
||||||
|
/** USB interface selected */
|
||||||
|
USB_DC_EVENT_CLEAR_REMOTE_WAKEUP,
|
||||||
|
/** Set Feature ENDPOINT_HALT received */
|
||||||
|
USB_DC_EVENT_SET_HALT,
|
||||||
|
/** Clear Feature ENDPOINT_HALT received */
|
||||||
|
USB_DC_EVENT_CLEAR_HALT,
|
||||||
/** setup packet received */
|
/** setup packet received */
|
||||||
USB_DC_EVENT_SETUP_NOTIFY,
|
USB_DC_EVENT_SETUP_NOTIFY,
|
||||||
/** ep0 in packet received */
|
/** ep0 in packet received */
|
||||||
|
@ -22,10 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef __HAL_WDT__H__
|
#ifndef __HAL_WDT__H__
|
||||||
#define __HAL_WDT__H__
|
#define __HAL_WDT__H__
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"{
|
extern "C"{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hal_common.h"
|
#include "hal_common.h"
|
||||||
|
#include "drv_device.h"
|
||||||
|
#include "bl702_config.h"
|
||||||
|
|
||||||
#define DEVICE_CTRL_GET_WDT_COUNTER (0x10)
|
#define DEVICE_CTRL_GET_WDT_COUNTER (0x10)
|
||||||
#define DEVICE_CTRL_RST_WDT_COUNTER (0x11)
|
#define DEVICE_CTRL_RST_WDT_COUNTER (0x11)
|
||||||
|
@ -62,7 +62,7 @@ void hal_enter_usb_iap(void)
|
|||||||
{
|
{
|
||||||
BL_WR_WORD(HBN_BASE + HBN_RSV0_OFFSET, 0x00425355); //"\0BSU"
|
BL_WR_WORD(HBN_BASE + HBN_RSV0_OFFSET, 0x00425355); //"\0BSU"
|
||||||
|
|
||||||
bflb_platform_delay_ms(1000);
|
arch_delay_ms(1000);
|
||||||
RomDriver_GLB_SW_System_Reset();
|
RomDriver_GLB_SW_System_Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,7 +75,8 @@ void ATTR_TCM_SECTION hal_jump2app(uint32_t flash_offset)
|
|||||||
L1C_Cache_Flush_Ext();
|
L1C_Cache_Flush_Ext();
|
||||||
app_main();
|
app_main();
|
||||||
} else {
|
} else {
|
||||||
MSG("Illegal app flash offset:%d\r\n", flash_offset);
|
while(1)
|
||||||
|
{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,10 @@
|
|||||||
#include "bl702_glb.h"
|
#include "bl702_glb.h"
|
||||||
#include "hal_emac.h"
|
#include "hal_emac.h"
|
||||||
|
|
||||||
|
#ifndef MSG
|
||||||
|
#define MSG(a,...)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define EMAC_USE_INSIDE_CLOCK (0)
|
#define EMAC_USE_INSIDE_CLOCK (0)
|
||||||
#define TAG "EMAC_BD: "
|
#define TAG "EMAC_BD: "
|
||||||
|
|
||||||
|
@ -132,11 +132,13 @@ BL_Err_Type ATTR_TCM_SECTION flash_init(void)
|
|||||||
g_flash_cfg.ioMode = g_flash_cfg.ioMode & 0x0f;
|
g_flash_cfg.ioMode = g_flash_cfg.ioMode & 0x0f;
|
||||||
|
|
||||||
ret = flash_config_init(&g_flash_cfg, (uint8_t *)&jedec_id);
|
ret = flash_config_init(&g_flash_cfg, (uint8_t *)&jedec_id);
|
||||||
|
#if 0
|
||||||
MSG("flash ID = %08x\r\n", jedec_id);
|
MSG("flash ID = %08x\r\n", jedec_id);
|
||||||
bflb_platform_dump((uint8_t *)&g_flash_cfg, sizeof(g_flash_cfg));
|
bflb_platform_dump((uint8_t *)&g_flash_cfg, sizeof(g_flash_cfg));
|
||||||
if (ret != SUCCESS) {
|
if (ret != SUCCESS) {
|
||||||
MSG("flash config init fail!\r\n");
|
MSG("flash config init fail!\r\n");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
g_flash_cfg.clkDelay = clkDelay;
|
g_flash_cfg.clkDelay = clkDelay;
|
||||||
g_flash_cfg.clkInvert = clkInvert;
|
g_flash_cfg.clkInvert = clkInvert;
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ static void GPIO_IRQ(void)
|
|||||||
} while ((SET == GLB_Get_GPIO_IntStatus(int_cfg->pin)) && timeOut);
|
} while ((SET == GLB_Get_GPIO_IntStatus(int_cfg->pin)) && timeOut);
|
||||||
|
|
||||||
if (!timeOut) {
|
if (!timeOut) {
|
||||||
MSG("WARNING: Clear GPIO interrupt status fail.\r\n");
|
//MSG("WARNING: Clear GPIO interrupt status fail.\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
GLB_GPIO_IntClear(int_cfg->pin, RESET);
|
GLB_GPIO_IntClear(int_cfg->pin, RESET);
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "hal_i2s.h"
|
#include "hal_i2s.h"
|
||||||
|
#include "hal_clock.h"
|
||||||
#include "hal_dma.h"
|
#include "hal_dma.h"
|
||||||
#include "bl702_i2s.h"
|
#include "bl702_i2s.h"
|
||||||
#include "bl702_glb.h"
|
#include "bl702_glb.h"
|
||||||
@ -38,40 +39,7 @@ int i2s_open(struct device *dev, uint16_t oflag)
|
|||||||
I2S_CFG_Type i2sCfg = { 0 };
|
I2S_CFG_Type i2sCfg = { 0 };
|
||||||
I2S_FifoCfg_Type fifoCfg = { 0 };
|
I2S_FifoCfg_Type fifoCfg = { 0 };
|
||||||
|
|
||||||
GLB_Set_Chip_Out_0_CLK_Sel(GLB_CHIP_CLK_OUT_I2S_REF_CLK);
|
i2sCfg.audioFreqHz = system_clock_get(SYSTEM_CLOCK_AUPLL);
|
||||||
GLB_Set_I2S_CLK(ENABLE, GLB_I2S_OUT_REF_CLK_NONE);
|
|
||||||
|
|
||||||
/*Finding the right frequency*/
|
|
||||||
if (12288000 % (i2s_device->sampl_freq_hz) == 0) {
|
|
||||||
i2sCfg.audioFreqHz = 12288000;
|
|
||||||
PDS_Set_Audio_PLL_Freq(AUDIO_PLL_12288000_HZ);
|
|
||||||
} else if (11289600 % (i2s_device->sampl_freq_hz) == 0) {
|
|
||||||
i2sCfg.audioFreqHz = 11289600;
|
|
||||||
PDS_Set_Audio_PLL_Freq(AUDIO_PLL_11289600_HZ);
|
|
||||||
} else if (5644800 % (i2s_device->sampl_freq_hz) == 0) {
|
|
||||||
i2sCfg.audioFreqHz = 5644800;
|
|
||||||
PDS_Set_Audio_PLL_Freq(AUDIO_PLL_5644800_HZ);
|
|
||||||
} else {
|
|
||||||
switch (I2S_ADUIO_PLL_DEFAULT) {
|
|
||||||
case AUDIO_PLL_12288000_HZ:
|
|
||||||
i2sCfg.audioFreqHz = 12288000;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case AUDIO_PLL_11289600_HZ:
|
|
||||||
i2sCfg.audioFreqHz = 11289600;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case AUDIO_PLL_5644800_HZ:
|
|
||||||
i2sCfg.audioFreqHz = 5644800;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return ERROR;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
PDS_Set_Audio_PLL_Freq(I2S_ADUIO_PLL_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
i2sCfg.sampleFreqHz = i2s_device->sampl_freq_hz;
|
i2sCfg.sampleFreqHz = i2s_device->sampl_freq_hz;
|
||||||
|
|
||||||
@ -242,6 +210,8 @@ int i2s_control(struct device *dev, int cmd, void *args)
|
|||||||
{
|
{
|
||||||
i2s_device_t *i2s_device = (i2s_device_t *)dev;
|
i2s_device_t *i2s_device = (i2s_device_t *)dev;
|
||||||
|
|
||||||
|
I2S_CFG_Type i2sCfg;
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case DEVICE_CTRL_SET_INT:
|
case DEVICE_CTRL_SET_INT:
|
||||||
for (uint16_t i = 0, j = 1; i < 8; i++, j <<= 1) {
|
for (uint16_t i = 0, j = 1; i < 8; i++, j <<= 1) {
|
||||||
@ -291,6 +261,32 @@ int i2s_control(struct device *dev, int cmd, void *args)
|
|||||||
case DEVICE_CTRL_I2S_GET_RX_FIFO:
|
case DEVICE_CTRL_I2S_GET_RX_FIFO:
|
||||||
return I2S_GetRxFIFO_AvlCnt();
|
return I2S_GetRxFIFO_AvlCnt();
|
||||||
|
|
||||||
|
case DEVICE_CTRL_I2S_SET_SAMPL_FREQ:
|
||||||
|
switch (i2s_device->frame_size) {
|
||||||
|
case I2S_FRAME_LEN_8:
|
||||||
|
i2sCfg.frameSize = I2S_SIZE_FRAME_8;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case I2S_FRAME_LEN_16:
|
||||||
|
i2sCfg.frameSize = I2S_SIZE_FRAME_16;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case I2S_FRAME_LEN_24:
|
||||||
|
i2sCfg.frameSize = I2S_SIZE_FRAME_24;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case I2S_FRAME_LEN_32:
|
||||||
|
i2sCfg.frameSize = I2S_SIZE_FRAME_32;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return ERROR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
i2sCfg.audioFreqHz = system_clock_get(SYSTEM_CLOCK_AUPLL);
|
||||||
|
i2sCfg.sampleFreqHz = (uint32_t)args;
|
||||||
|
I2S_SetBclkPeriod(&i2sCfg);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return ERROR;
|
return ERROR;
|
||||||
break;
|
break;
|
||||||
|
@ -449,7 +449,7 @@ static int sec_ecdsa_verify_point_mul(uint8_t id, const uint32_t *m)
|
|||||||
#endif
|
#endif
|
||||||
} else if (pka_p1_eq_inf == 0 && pka_p2_eq_inf == 1) {
|
} else if (pka_p1_eq_inf == 0 && pka_p2_eq_inf == 1) {
|
||||||
//sum = X1
|
//sum = X1
|
||||||
MSG("sum = X1\r\n");
|
//MSG("sum = X1\r\n");
|
||||||
} else if (pka_p1_eq_inf == 0 && pka_p2_eq_inf == 0) {
|
} else if (pka_p1_eq_inf == 0 && pka_p2_eq_inf == 0) {
|
||||||
//sum = X1 + X2
|
//sum = X1 + X2
|
||||||
sec_ecdsa_point_add(id);
|
sec_ecdsa_point_add(id);
|
||||||
@ -458,7 +458,7 @@ static int sec_ecdsa_verify_point_mul(uint8_t id, const uint32_t *m)
|
|||||||
sec_ecdsa_dump_temp_result();
|
sec_ecdsa_dump_temp_result();
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
MSG("Error! infinite point + infinite point\r\n");
|
//MSG("Error! infinite point + infinite point\r\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,7 +124,6 @@ int wdt_write(struct device *dev, uint32_t pos, const void *buffer, uint32_t siz
|
|||||||
uint16_t wdt_timeout = (uint16_t)(uint32_t)buffer;
|
uint16_t wdt_timeout = (uint16_t)(uint32_t)buffer;
|
||||||
|
|
||||||
WDT_Disable();
|
WDT_Disable();
|
||||||
MSG("wdt timeout %d \r\n", wdt_timeout);
|
|
||||||
WDT_SetCompValue(wdt_timeout);
|
WDT_SetCompValue(wdt_timeout);
|
||||||
WDT_Enable();
|
WDT_Enable();
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "bl702_common.h"
|
#include "bl702_common.h"
|
||||||
#include "bl702.h"
|
#include "bflb_platform.h"
|
||||||
|
|
||||||
pFunc __Interrupt_Handlers[IRQn_LAST] = { 0 };
|
pFunc __Interrupt_Handlers[IRQn_LAST] = { 0 };
|
||||||
|
|
||||||
|
@ -135,12 +135,9 @@ void SystemInit(void)
|
|||||||
}
|
}
|
||||||
/*identify flash config automaticly*/
|
/*identify flash config automaticly*/
|
||||||
extern BL_Err_Type flash_init(void);
|
extern BL_Err_Type flash_init(void);
|
||||||
extern void bflb_platform_print_set(uint8_t disable);
|
|
||||||
void System_Post_Init(void)
|
void System_Post_Init(void)
|
||||||
{
|
{
|
||||||
PDS_Trim_RC32M();
|
PDS_Trim_RC32M();
|
||||||
HBN_Trim_RC32K();
|
HBN_Trim_RC32K();
|
||||||
bflb_platform_print_set(1);
|
|
||||||
flash_init();
|
flash_init();
|
||||||
bflb_platform_print_set(0);
|
|
||||||
}
|
}
|
@ -79,6 +79,7 @@ BL_Err_Type AON_Power_Off_MBG(void);
|
|||||||
BL_Err_Type AON_Power_On_XTAL(void);
|
BL_Err_Type AON_Power_On_XTAL(void);
|
||||||
BL_Err_Type AON_Set_Xtal_CapCode(uint8_t capIn, uint8_t capOut);
|
BL_Err_Type AON_Set_Xtal_CapCode(uint8_t capIn, uint8_t capOut);
|
||||||
uint8_t AON_Get_Xtal_CapCode(void);
|
uint8_t AON_Get_Xtal_CapCode(void);
|
||||||
|
BL_Err_Type AON_Set_Xtal_CapCode_Extra(uint8_t extra);
|
||||||
BL_Err_Type AON_Power_Off_XTAL(void);
|
BL_Err_Type AON_Power_Off_XTAL(void);
|
||||||
/*----------*/
|
/*----------*/
|
||||||
BL_Err_Type AON_Power_On_BG(void);
|
BL_Err_Type AON_Power_On_BG(void);
|
||||||
@ -97,6 +98,10 @@ BL_Err_Type AON_LowPower_Enter_PDS0(void);
|
|||||||
BL_Err_Type AON_LowPower_Exit_PDS0(void);
|
BL_Err_Type AON_LowPower_Exit_PDS0(void);
|
||||||
/*----------*/
|
/*----------*/
|
||||||
BL_Err_Type AON_Set_LDO11_SOC_Sstart_Delay(uint8_t delay);
|
BL_Err_Type AON_Set_LDO11_SOC_Sstart_Delay(uint8_t delay);
|
||||||
|
/*----------*/
|
||||||
|
BL_Err_Type AON_Set_DCDC18_Top_0(uint8_t voutSel, uint8_t vpfm);
|
||||||
|
BL_Err_Type AON_Set_Xtal_Cfg(uint8_t gmBoost, uint8_t ampCtrl, uint8_t fastStartup);
|
||||||
|
/*----------*/
|
||||||
|
|
||||||
/*@} end of group AON_Public_Functions */
|
/*@} end of group AON_Public_Functions */
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define __BL702_COMMON_H__
|
#define __BL702_COMMON_H__
|
||||||
|
|
||||||
#include "bl702.h"
|
#include "bl702.h"
|
||||||
#include "bflb_platform.h"
|
#include "misc.h"
|
||||||
|
|
||||||
#ifndef __NOP
|
#ifndef __NOP
|
||||||
#define __NOP() __ASM volatile("nop") /* This implementation generates debug information */
|
#define __NOP() __ASM volatile("nop") /* This implementation generates debug information */
|
||||||
@ -57,6 +57,32 @@ __ALWAYS_STATIC_INLINE void __disable_irq(void)
|
|||||||
__ASM volatile("csrc mstatus, 8");
|
__ASM volatile("csrc mstatus, 8");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @defgroup COMMON_Public_Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DRIVER_INT_PERIPH
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define IS_INT_PERIPH(INT_PERIPH) ((INT_PERIPH) < IRQn_LAST)
|
||||||
|
|
||||||
|
/*@} end of group DRIVER_INT_PERIPH */
|
||||||
|
|
||||||
|
/** @defgroup DRIVER_INT_MASK
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define IS_BL_MASK_TYPE(type) (((type) == MASK) || ((type) == UNMASK))
|
||||||
|
|
||||||
|
/*@} end of group COMMON_Public_Constants */
|
||||||
|
|
||||||
|
/*@} end of group DRIVER_Public_Macro */
|
||||||
|
#define BL702_MemCpy arch_memcpy
|
||||||
|
#define BL702_MemSet arch_memset
|
||||||
|
#define BL702_MemCmp arch_memcmp
|
||||||
|
#define BL702_MemCpy4 arch_memcpy4
|
||||||
|
#define BL702_MemCpy_Fast arch_memcpy_fast
|
||||||
|
#define BL702_MemSet4 arch_memset4
|
||||||
|
|
||||||
#define arch_delay_us BL702_Delay_US
|
#define arch_delay_us BL702_Delay_US
|
||||||
#define arch_delay_ms BL702_Delay_MS
|
#define arch_delay_ms BL702_Delay_MS
|
||||||
|
|
||||||
|
@ -1,49 +0,0 @@
|
|||||||
#ifndef __BL702_IT_H__
|
|
||||||
#define __BL702_IT_H__
|
|
||||||
|
|
||||||
#include "bl702.h"
|
|
||||||
#include "bl_common.h"
|
|
||||||
|
|
||||||
/** @addtogroup BL606_Peripheral_Driver
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** @addtogroup COMMON
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** @defgroup COMMON_Public_Types
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*@} end of group COMMON_Public_Types */
|
|
||||||
|
|
||||||
/** @defgroup COMMON_Public_Constants
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** @defgroup DRIVER_INT_PERIPH
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
#define IS_INT_PERIPH(INT_PERIPH) ((INT_PERIPH) < IRQn_LAST)
|
|
||||||
|
|
||||||
/*@} end of group DRIVER_INT_PERIPH */
|
|
||||||
|
|
||||||
/** @defgroup DRIVER_INT_MASK
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
#define IS_BL_MASK_TYPE(type) (((type) == MASK) || ((type) == UNMASK))
|
|
||||||
|
|
||||||
/*@} end of group COMMON_Public_Constants */
|
|
||||||
|
|
||||||
/*@} end of group DRIVER_Public_Macro */
|
|
||||||
|
|
||||||
/** @defgroup DRIVER_Public_FunctionDeclaration
|
|
||||||
* @brief DRIVER functions declaration
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
void Interrupt_Handler_Register(IRQn_Type irq, pFunc interruptFun);
|
|
||||||
|
|
||||||
/*@} end of group DRIVER_COMMON */
|
|
||||||
|
|
||||||
#endif /* __BL602_COMMON_H__ */
|
|
@ -104,8 +104,7 @@
|
|||||||
*
|
*
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
#ifndef BFLB_USE_ROM_DRIVER
|
#ifndef BFLB_USE_ROM_DRIVER
|
||||||
__WEAK
|
__WEAK BL_Err_Type ATTR_CLOCK_SECTION AON_Power_On_MBG(void)
|
||||||
BL_Err_Type ATTR_CLOCK_SECTION AON_Power_On_MBG(void)
|
|
||||||
{
|
{
|
||||||
uint32_t tmpVal = 0;
|
uint32_t tmpVal = 0;
|
||||||
|
|
||||||
@ -129,8 +128,7 @@ BL_Err_Type ATTR_CLOCK_SECTION AON_Power_On_MBG(void)
|
|||||||
*
|
*
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
#ifndef BFLB_USE_ROM_DRIVER
|
#ifndef BFLB_USE_ROM_DRIVER
|
||||||
__WEAK
|
__WEAK BL_Err_Type ATTR_CLOCK_SECTION AON_Power_Off_MBG(void)
|
||||||
BL_Err_Type ATTR_CLOCK_SECTION AON_Power_Off_MBG(void)
|
|
||||||
{
|
{
|
||||||
uint32_t tmpVal = 0;
|
uint32_t tmpVal = 0;
|
||||||
|
|
||||||
@ -152,8 +150,7 @@ BL_Err_Type ATTR_CLOCK_SECTION AON_Power_Off_MBG(void)
|
|||||||
*
|
*
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
#ifndef BFLB_USE_ROM_DRIVER
|
#ifndef BFLB_USE_ROM_DRIVER
|
||||||
__WEAK
|
__WEAK BL_Err_Type ATTR_CLOCK_SECTION AON_Power_On_XTAL(void)
|
||||||
BL_Err_Type ATTR_CLOCK_SECTION AON_Power_On_XTAL(void)
|
|
||||||
{
|
{
|
||||||
uint32_t tmpVal = 0;
|
uint32_t tmpVal = 0;
|
||||||
uint32_t timeOut = 0;
|
uint32_t timeOut = 0;
|
||||||
@ -188,8 +185,7 @@ BL_Err_Type ATTR_CLOCK_SECTION AON_Power_On_XTAL(void)
|
|||||||
*
|
*
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
#ifndef BFLB_USE_ROM_DRIVER
|
#ifndef BFLB_USE_ROM_DRIVER
|
||||||
__WEAK
|
__WEAK BL_Err_Type ATTR_CLOCK_SECTION AON_Set_Xtal_CapCode(uint8_t capIn, uint8_t capOut)
|
||||||
BL_Err_Type ATTR_CLOCK_SECTION AON_Set_Xtal_CapCode(uint8_t capIn, uint8_t capOut)
|
|
||||||
{
|
{
|
||||||
uint32_t tmpVal = 0;
|
uint32_t tmpVal = 0;
|
||||||
|
|
||||||
@ -221,6 +217,29 @@ uint8_t ATTR_CLOCK_SECTION AON_Get_Xtal_CapCode(void)
|
|||||||
return BL_GET_REG_BITS_VAL(tmpVal, AON_XTAL_CAPCODE_IN_AON);
|
return BL_GET_REG_BITS_VAL(tmpVal, AON_XTAL_CAPCODE_IN_AON);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************/ /**
|
||||||
|
* @brief Set XTAL cap code
|
||||||
|
*
|
||||||
|
* @param extra: cap cpde extra aon
|
||||||
|
*
|
||||||
|
* @return SUCCESS or ERROR
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
BL_Err_Type ATTR_CLOCK_SECTION AON_Set_Xtal_CapCode_Extra(uint8_t extra)
|
||||||
|
{
|
||||||
|
uint32_t tmpVal = 0;
|
||||||
|
|
||||||
|
tmpVal = BL_RD_REG(AON_BASE, AON_XTAL_CFG);
|
||||||
|
if (extra) {
|
||||||
|
tmpVal = BL_SET_REG_BIT(tmpVal, AON_XTAL_CAPCODE_EXTRA_AON);
|
||||||
|
} else {
|
||||||
|
tmpVal = BL_CLR_REG_BIT(tmpVal, AON_XTAL_CAPCODE_EXTRA_AON);
|
||||||
|
}
|
||||||
|
BL_WR_REG(AON_BASE, AON_XTAL_CFG, tmpVal);
|
||||||
|
|
||||||
|
return SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************************/ /**
|
/****************************************************************************/ /**
|
||||||
* @brief Power off XTAL
|
* @brief Power off XTAL
|
||||||
*
|
*
|
||||||
@ -230,8 +249,7 @@ uint8_t ATTR_CLOCK_SECTION AON_Get_Xtal_CapCode(void)
|
|||||||
*
|
*
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
#ifndef BFLB_USE_ROM_DRIVER
|
#ifndef BFLB_USE_ROM_DRIVER
|
||||||
__WEAK
|
__WEAK BL_Err_Type ATTR_CLOCK_SECTION AON_Power_Off_XTAL(void)
|
||||||
BL_Err_Type ATTR_CLOCK_SECTION AON_Power_Off_XTAL(void)
|
|
||||||
{
|
{
|
||||||
uint32_t tmpVal = 0;
|
uint32_t tmpVal = 0;
|
||||||
|
|
||||||
@ -511,6 +529,52 @@ BL_Err_Type ATTR_TCM_SECTION AON_Set_LDO11_SOC_Sstart_Delay(uint8_t delay)
|
|||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************/ /**
|
||||||
|
* @brief
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
BL_Err_Type AON_Set_DCDC18_Top_0(uint8_t voutSel, uint8_t vpfm)
|
||||||
|
{
|
||||||
|
uint32_t tmpVal = 0;
|
||||||
|
|
||||||
|
tmpVal = BL_RD_REG(AON_BASE, AON_DCDC18_TOP_0);
|
||||||
|
//dcdc18_vout_sel_aon, 1.425V*1.05=1.5V
|
||||||
|
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, AON_DCDC18_VOUT_SEL_AON, voutSel);
|
||||||
|
//dcdc18_vpfm_aon
|
||||||
|
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, AON_DCDC18_VPFM_AON, vpfm);
|
||||||
|
BL_WR_REG(AON_BASE, AON_DCDC18_TOP_0, tmpVal);
|
||||||
|
|
||||||
|
return SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************/ /**
|
||||||
|
* @brief
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
BL_Err_Type AON_Set_Xtal_Cfg(uint8_t gmBoost, uint8_t ampCtrl, uint8_t fastStartup)
|
||||||
|
{
|
||||||
|
uint32_t tmpVal = 0;
|
||||||
|
|
||||||
|
tmpVal = BL_RD_REG(AON_BASE, AON_XTAL_CFG);
|
||||||
|
//xtal_gm_boost
|
||||||
|
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, AON_XTAL_GM_BOOST_AON, gmBoost);
|
||||||
|
//xtal_amp_ctrl
|
||||||
|
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, AON_XTAL_AMP_CTRL_AON, ampCtrl);
|
||||||
|
//xtal_fast_startup
|
||||||
|
tmpVal = BL_SET_REG_BITS_VAL(tmpVal, AON_XTAL_FAST_STARTUP_AON, fastStartup);
|
||||||
|
BL_WR_REG(AON_BASE, AON_XTAL_CFG, tmpVal);
|
||||||
|
|
||||||
|
return SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
/*@} end of group AON_Public_Functions */
|
/*@} end of group AON_Public_Functions */
|
||||||
|
|
||||||
/*@} end of group AON */
|
/*@} end of group AON */
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include "hal_pm.h"
|
#include "hal_pm.h"
|
||||||
#include "hal_acomp.h"
|
#include "hal_acomp.h"
|
||||||
#include "hal_uart.h"
|
#include "hal_uart.h"
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include "hal_adc.h"
|
#include "hal_adc.h"
|
||||||
#include "hal_gpio.h"
|
#include "hal_gpio.h"
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include "hal_adc.h"
|
#include "hal_adc.h"
|
||||||
#include "hal_gpio.h"
|
#include "hal_gpio.h"
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include "hal_adc.h"
|
#include "hal_adc.h"
|
||||||
#include "hal_gpio.h"
|
#include "hal_gpio.h"
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include "hal_adc.h"
|
#include "hal_adc.h"
|
||||||
#include "hal_gpio.h"
|
#include "hal_gpio.h"
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include "hal_adc.h"
|
#include "hal_adc.h"
|
||||||
#include "hal_gpio.h"
|
#include "hal_gpio.h"
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include "hal_adc.h"
|
#include "hal_adc.h"
|
||||||
#include "hal_gpio.h"
|
#include "hal_gpio.h"
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include "hal_adc.h"
|
#include "hal_adc.h"
|
||||||
#include "hal_gpio.h"
|
#include "hal_gpio.h"
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include "hal_adc.h"
|
#include "hal_adc.h"
|
||||||
#include "hal_gpio.h"
|
#include "hal_gpio.h"
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include "hal_adc.h"
|
#include "hal_adc.h"
|
||||||
#include "hal_gpio.h"
|
#include "hal_gpio.h"
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include "hal_i2s.h"
|
#include "hal_i2s.h"
|
||||||
#include "hal_dma.h"
|
#include "hal_dma.h"
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include "hal_i2s.h"
|
#include "hal_i2s.h"
|
||||||
#include "hal_dma.h"
|
#include "hal_dma.h"
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include "hal_uart.h"
|
#include "hal_uart.h"
|
||||||
#include <FreeRTOS.h>
|
#include <FreeRTOS.h>
|
||||||
#include "semphr.h"
|
#include "semphr.h"
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "bflb_platform.h"
|
||||||
#include "hal_uart.h"
|
#include "hal_uart.h"
|
||||||
#include <FreeRTOS.h>
|
#include <FreeRTOS.h>
|
||||||
#include "semphr.h"
|
#include "semphr.h"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include "xz_config.h"
|
#include "xz_config.h"
|
||||||
#include "blsp_port.h"
|
#include "blsp_port.h"
|
||||||
#include "hal_boot2.h"
|
#include "hal_boot2.h"
|
||||||
|
#include "bflb_platform.h"
|
||||||
|
|
||||||
uint8_t *g_eflash_loader_readbuf[2];
|
uint8_t *g_eflash_loader_readbuf[2];
|
||||||
volatile uint32_t g_rx_buf_index = 0;
|
volatile uint32_t g_rx_buf_index = 0;
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
#include "blsp_media_boot.h"
|
#include "blsp_media_boot.h"
|
||||||
#include "softcrc.h"
|
#include "softcrc.h"
|
||||||
#include "bflb_eflash_loader_interface.h"
|
#include "bflb_eflash_loader_interface.h"
|
||||||
|
#include "hal_uart.h"
|
||||||
|
|
||||||
extern int main(void);
|
extern int main(void);
|
||||||
extern struct device *dev_check_hash;
|
extern struct device *dev_check_hash;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user