mirror of
https://github.com/Ai-Thinker-Open/Ai-Thinker-Open_RTL8710BX_ALIOS_SDK.git
synced 2026-07-08 19:45:39 +00:00
rel_1.6.0 init
This commit is contained in:
commit
27b3e2883d
19359 changed files with 8093121 additions and 0 deletions
32
Living_SDK/board/developerkit/hal/hal_adc_stm32l4.h
Normal file
32
Living_SDK/board/developerkit/hal/hal_adc_stm32l4.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef __HAL_ADC_STM32L4_H
|
||||
#define __HAL_ADC_STM32L4_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "stm32l4xx_hal.h"
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include "aos/kernel.h"
|
||||
|
||||
#define PORT_ADC1 1
|
||||
#define PORT_ADC2 2
|
||||
#define PORT_ADC3 3
|
||||
#define PORT_ADC4 4
|
||||
#define PORT_ADC5 5
|
||||
#define PORT_ADC6 6
|
||||
#define PORT_ADC7 7
|
||||
#define PORT_ADC8 8
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __HAL_UART_STM32L4_H */
|
||||
103
Living_SDK/board/developerkit/hal/hal_gpio_stm32l4.h
Normal file
103
Living_SDK/board/developerkit/hal/hal_gpio_stm32l4.h
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef __HAL_GPIO_STM32L4_H
|
||||
#define __HAL_GPIO_STM32L4_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "stm32l4xx_hal.h"
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include "aos/kernel.h"
|
||||
|
||||
#define PINS_IN_GROUP 16
|
||||
#define GROUP_GPIOA 0
|
||||
#define GROUP_GPIOB 1
|
||||
#define GROUP_GPIOC 2
|
||||
#define GROUP_GPIOD 3
|
||||
#define GROUP_GPIOE 4
|
||||
|
||||
#define HAL_GPIO_0 ((uint8_t)0) /* represent GPIOA pin 0 */
|
||||
#define HAL_GPIO_1 ((uint8_t)1) /* represent GPIOA pin 1 */
|
||||
#define HAL_GPIO_2 ((uint8_t)2) /* represent GPIOA pin 2 */
|
||||
#define HAL_GPIO_3 ((uint8_t)3) /* represent GPIOA pin 3 */
|
||||
#define HAL_GPIO_4 ((uint8_t)4) /* represent GPIOA pin 4 */
|
||||
#define HAL_GPIO_5 ((uint8_t)5) /* represent GPIOA pin 5 */
|
||||
#define HAL_GPIO_6 ((uint8_t)6) /* represent GPIOA pin 6 */
|
||||
#define HAL_GPIO_7 ((uint8_t)7) /* represent GPIOA pin 7 */
|
||||
#define HAL_GPIO_8 ((uint8_t)8) /* represent GPIOA pin 8 */
|
||||
#define HAL_GPIO_9 ((uint8_t)9) /* represent GPIOA pin 9 */
|
||||
#define HAL_GPIO_10 ((uint8_t)10) /* represent GPIOA pin 10 */
|
||||
#define HAL_GPIO_11 ((uint8_t)11) /* represent GPIOA pin 11 */
|
||||
#define HAL_GPIO_12 ((uint8_t)12) /* represent GPIOA pin 12 */
|
||||
#define HAL_GPIO_13 ((uint8_t)13) /* represent GPIOA pin 13 */
|
||||
#define HAL_GPIO_14 ((uint8_t)14) /* represent GPIOA pin 14 */
|
||||
#define HAL_GPIO_15 ((uint8_t)15) /* represent GPIOA pin 15 */
|
||||
|
||||
#define HAL_GPIO_16 ((uint8_t)16) /* represent GPIOB pin 0 */
|
||||
#define HAL_GPIO_17 ((uint8_t)17) /* represent GPIOB pin 1 */
|
||||
#define HAL_GPIO_18 ((uint8_t)18) /* represent GPIOB pin 2 */
|
||||
#define HAL_GPIO_19 ((uint8_t)19) /* represent GPIOB pin 3 */
|
||||
#define HAL_GPIO_20 ((uint8_t)20) /* represent GPIOB pin 4 */
|
||||
#define HAL_GPIO_21 ((uint8_t)21) /* represent GPIOB pin 5 */
|
||||
#define HAL_GPIO_22 ((uint8_t)22) /* represent GPIOB pin 6 */
|
||||
#define HAL_GPIO_23 ((uint8_t)23) /* represent GPIOB pin 7 */
|
||||
#define HAL_GPIO_24 ((uint8_t)24) /* represent GPIOB pin 8 */
|
||||
#define HAL_GPIO_25 ((uint8_t)25) /* represent GPIOB pin 9 */
|
||||
#define HAL_GPIO_26 ((uint8_t)26) /* represent GPIOB pin 10 */
|
||||
#define HAL_GPIO_27 ((uint8_t)27) /* represent GPIOB pin 11 */
|
||||
#define HAL_GPIO_28 ((uint8_t)28) /* represent GPIOB pin 12 */
|
||||
#define HAL_GPIO_29 ((uint8_t)29) /* represent GPIOB pin 13 */
|
||||
#define HAL_GPIO_30 ((uint8_t)30) /* represent GPIOB pin 14 */
|
||||
#define HAL_GPIO_31 ((uint8_t)31) /* represent GPIOB pin 15 */
|
||||
|
||||
#define HAL_GPIO_32 ((uint8_t)32) /* represent GPIOC pin 0 */
|
||||
#define HAL_GPIO_33 ((uint8_t)33) /* represent GPIOC pin 1 */
|
||||
#define HAL_GPIO_34 ((uint8_t)34) /* represent GPIOC pin 2 */
|
||||
#define HAL_GPIO_35 ((uint8_t)35) /* represent GPIOC pin 3 */
|
||||
#define HAL_GPIO_36 ((uint8_t)36) /* represent GPIOC pin 4 */
|
||||
#define HAL_GPIO_37 ((uint8_t)37) /* represent GPIOC pin 5 */
|
||||
#define HAL_GPIO_38 ((uint8_t)38) /* represent GPIOC pin 6 */
|
||||
#define HAL_GPIO_39 ((uint8_t)39) /* represent GPIOC pin 7 */
|
||||
#define HAL_GPIO_40 ((uint8_t)40) /* represent GPIOC pin 8 */
|
||||
#define HAL_GPIO_41 ((uint8_t)41) /* represent GPIOC pin 9 */
|
||||
#define HAL_GPIO_42 ((uint8_t)42) /* represent GPIOC pin 10 */
|
||||
#define HAL_GPIO_43 ((uint8_t)43) /* represent GPIOC pin 11 */
|
||||
#define HAL_GPIO_44 ((uint8_t)44) /* represent GPIOC pin 12 */
|
||||
#define HAL_GPIO_45 ((uint8_t)45) /* represent GPIOC pin 13 */
|
||||
#define HAL_GPIO_46 ((uint8_t)46) /* represent GPIOC pin 14 */
|
||||
#define HAL_GPIO_47 ((uint8_t)47) /* represent GPIOC pin 15 */
|
||||
|
||||
#define SW_FUNC_B HAL_GPIO_45
|
||||
#define LCD_PWR HAL_GPIO_0
|
||||
#define LCD_RST HAL_GPIO_1
|
||||
#define LCD_NSS HAL_GPIO_4
|
||||
#define LCD_SCK HAL_GPIO_5
|
||||
#define LCD_TX HAL_GPIO_7
|
||||
#define SW_WIFI HAL_GPIO_16
|
||||
#define LCD_DCX HAL_GPIO_17
|
||||
#define LED_GS HAL_GPIO_18
|
||||
#define AUDIO_EN HAL_GPIO_8
|
||||
#define SW_FUNC_A HAL_GPIO_11
|
||||
#define LED_PS HAL_GPIO_12
|
||||
#define LED_HTS HAL_GPIO_15
|
||||
#define WIFI_RST HAL_GPIO_20
|
||||
#define LED_ALS HAL_GPIO_21
|
||||
#define WIFI_TX HAL_GPIO_22
|
||||
#define WIFI_RX HAL_GPIO_23
|
||||
#define ALS_INT HAL_GPIO_24
|
||||
#define WIFI_WU HAL_GPIO_25
|
||||
|
||||
#define GPIOA_SPEED GPIO_SPEED_FREQ_VERY_HIGH
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __HAL_GPIO_STM32L4_H */
|
||||
101
Living_SDK/board/developerkit/hal/hal_i2c_stm32l4.h
Normal file
101
Living_SDK/board/developerkit/hal/hal_i2c_stm32l4.h
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef __HAL_I2C_STM32L4_H
|
||||
#define __HAL_I2C_STM32L4_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "stm32l4xx_hal.h"
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
/******************************** I2C1 configure *****************************/
|
||||
#define AOS_PORT_I2C1 1
|
||||
#define I2C1_INSTANCE I2C1
|
||||
#define I2C1_TIMING 0x40403E5D
|
||||
#define I2C1_OWN_ADDRESS1 0x70
|
||||
#define I2C1_ADDRESSING_MODE I2C_ADDRESSINGMODE_7BIT
|
||||
#define I2C1_DUAL_ADDRESS_MODE I2C_DUALADDRESS_DISABLE
|
||||
#define I2C1_OWNADDRESS2 0xFF
|
||||
#define I2C1_OWN_ADDRESS2_MASK I2C_OA2_NOMASK
|
||||
#define I2C1_GENERAL_CALL_MODE I2C_GENERALCALL_DISABLE
|
||||
#define I2C1_NO_STRETCH_MODE I2C_NOSTRETCH_DISABLE
|
||||
|
||||
/* Definition for I2C1 clock resources */
|
||||
#define I2C1_RCC_PERIPH_CLOCK_SELECTION RCC_PERIPHCLK_I2C1
|
||||
#define I2C1_RCC_CLOCK_SELECTION RCC_I2C1CLKSOURCE_SYSCLK
|
||||
|
||||
#define I2C1_CLK_ENABLE() __HAL_RCC_I2C1_CLK_ENABLE()
|
||||
#define I2C1_CLK_DISABLE() __HAL_RCC_I2C1_CLK_DISABLE()
|
||||
#define I2C1_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
|
||||
#define I2C1_SCL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
|
||||
#define I2C1_SDA_GPIO_CLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
|
||||
#define I2C1_SCL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
|
||||
#define I2C1_FORCE_RESET() __HAL_RCC_I2C1_FORCE_RESET()
|
||||
#define I2C1_RELEASE_RESET() __HAL_RCC_I2C1_RELEASE_RESET()
|
||||
|
||||
/* Definition for I2C1 Pins */
|
||||
#define I2C1_GPIO_SCL_PIN GPIO_PIN_14
|
||||
#define I2C1_GPIO_SDA_PIN GPIO_PIN_13
|
||||
#define I2C1_GPIO_SCL_PORT GPIOG
|
||||
#define I2C1_GPIO_SDA_PORT GPIOG
|
||||
#define I2C1_GPIO_MODE GPIO_MODE_AF_OD
|
||||
#define I2C1_GPIO_PULL GPIO_PULLUP
|
||||
#define I2C1_GPIO_SPEED GPIO_SPEED_FREQ_VERY_HIGH
|
||||
#define I2C1_GPIO_ALTERNATE GPIO_AF4_I2C1
|
||||
|
||||
/* Definition for I2C1's NVIC */
|
||||
#define I2C1_EV_IRQn I2C1_EV_IRQn
|
||||
#define I2C1_ER_IRQn I2C1_ER_IRQn
|
||||
|
||||
/******************************** I2C2 configure *****************************/
|
||||
#define AOS_PORT_I2C2 2
|
||||
#define I2C2_INSTANCE I2C2
|
||||
#define I2C2_TIMING 0x40403E5D
|
||||
#define I2C2_OWN_ADDRESS1 0x70
|
||||
#define I2C2_ADDRESSING_MODE I2C_ADDRESSINGMODE_7BIT
|
||||
#define I2C2_DUAL_ADDRESS_MODE I2C_DUALADDRESS_DISABLE
|
||||
#define I2C2_OWNADDRESS2 0xFF
|
||||
#define I2C2_OWN_ADDRESS2_MASK I2C_OA2_NOMASK
|
||||
#define I2C2_GENERAL_CALL_MODE I2C_GENERALCALL_DISABLE
|
||||
#define I2C2_NO_STRETCH_MODE I2C_NOSTRETCH_DISABLE
|
||||
|
||||
/* Definition for I2C2 clock resources */
|
||||
#define I2C2_RCC_PERIPH_CLOCK_SELECTION RCC_PERIPHCLK_I2C2
|
||||
#define I2C2_RCC_CLOCK_SELECTION RCC_I2C2CLKSOURCE_SYSCLK
|
||||
|
||||
#define I2C2_CLK_ENABLE() __HAL_RCC_I2C2_CLK_ENABLE()
|
||||
#define I2C2_CLK_DISABLE() __HAL_RCC_I2C2_CLK_DISABLE()
|
||||
#define I2C2_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define I2C2_SCL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
|
||||
#define I2C2_SDA_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
|
||||
#define I2C2_SCL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOH_CLK_DISABLE()
|
||||
#define I2C2_FORCE_RESET() __HAL_RCC_I2C2_FORCE_RESET()
|
||||
#define I2C2_RELEASE_RESET() __HAL_RCC_I2C2_RELEASE_RESET()
|
||||
|
||||
/* Definition for I2C2 Pins */
|
||||
#define I2C2_GPIO_SCL_PIN GPIO_PIN_4
|
||||
#define I2C2_GPIO_SDA_PIN GPIO_PIN_14
|
||||
#define I2C2_GPIO_SCL_PORT GPIOH
|
||||
#define I2C2_GPIO_SDA_PORT GPIOB
|
||||
#define I2C2_GPIO_MODE GPIO_MODE_AF_OD
|
||||
#define I2C2_GPIO_PULL GPIO_PULLUP
|
||||
#define I2C2_GPIO_SPEED GPIO_SPEED_FREQ_VERY_HIGH
|
||||
#define I2C2_GPIO_ALTERNATE GPIO_AF4_I2C2
|
||||
|
||||
/* Definition for I2C2's NVIC */
|
||||
#define I2C2_EV_IRQn I2C2_EV_IRQn
|
||||
#define I2C2_ER_IRQn I2C2_ER_IRQn
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __HAL_I2C_STM32L4_H */
|
||||
50
Living_SDK/board/developerkit/hal/hal_nand_stm32l4.h
Normal file
50
Living_SDK/board/developerkit/hal/hal_nand_stm32l4.h
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef __HAL_NAND_STM32L4_H
|
||||
#define __HAL_NAND_STM32L4_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "stm32l4xx_hal.h"
|
||||
#include "hal/soc/soc.h"
|
||||
|
||||
#if defined(STM32L496xx)
|
||||
#include "stm32l496xx.h"
|
||||
#endif
|
||||
|
||||
#define NAND_HANDLE_INSTANCE FMC_NAND_DEVICE
|
||||
|
||||
#define NAND_INIT_NAND_BANK FMC_NAND_BANK3
|
||||
#define NAND_INIT_WAIT_FEATURE FMC_NAND_WAIT_FEATURE_ENABLE
|
||||
#define NAND_INIT_MEMORY_DATA_WIDTH FMC_NAND_MEM_BUS_WIDTH_8
|
||||
#define NAND_INIT_ECC_COMPUTATION FMC_NAND_ECC_ENABLE
|
||||
#define NAND_INIT_ECC_PAGE_SIZE FMC_NAND_ECC_PAGE_SIZE_512BYTE
|
||||
#define NAND_INIT_TCLR_SETUP_TIME 0
|
||||
#define NAND_INIT_TAR_SETUP_TIME 0
|
||||
|
||||
#define NAND_INFO_PAGE_SIZE 0x800
|
||||
#define NAND_INFO_SPARE_AREA_SIZE 0x40
|
||||
#define NAND_INFO_BLOCK_SIZE 0x40
|
||||
#define NAND_INFO_BLOCK_NBR 0x400
|
||||
#define NAND_INFO_ZONE_SIZE 0x400
|
||||
|
||||
#define COM_SPACE_SETUP_TIME 0x5
|
||||
#define COM_SPACE_WAIT_TIME 0x4
|
||||
#define COM_SPACE_HOLD_TIME 0x2
|
||||
#define COM_SPACE_HIZ_TIME 0x5
|
||||
|
||||
#define ATT_SPACE_SETUP_TIME 0x5
|
||||
#define ATT_SPACE_WAIT_TIME 0x4
|
||||
#define ATT_SPACE_HOLD_TIME 0x2
|
||||
#define ATT_SPACE_HIZ_TIME 0x5
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __HAL_NAND_STM32L4_H */
|
||||
|
||||
60
Living_SDK/board/developerkit/hal/hal_nor_stm32l4.h
Normal file
60
Living_SDK/board/developerkit/hal/hal_nor_stm32l4.h
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef __HAL_NOR_STM32L4_H
|
||||
#define __HAL_NOR_STM32L4_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "stm32l4xx_hal.h"
|
||||
#include "hal/soc/soc.h"
|
||||
|
||||
#if defined(STM32L496xx)
|
||||
#include "stm32l496xx.h"
|
||||
#endif
|
||||
|
||||
#define NOR_DEVICE_ADDR ((uint32_t)0x64000000)
|
||||
|
||||
/* NOR size configuration */
|
||||
#define NOR_BLOCK_SIZE 0x1000
|
||||
#define NOR_CHIP_SIZE
|
||||
|
||||
/* NOR operations Timeout definitions */
|
||||
#define BLOCKERASE_TIMEOUT 2000U /* NOR block erase timeout : 2 s */
|
||||
#define CHIPERASE_TIMEOUT 400000U /* NOR chip erase timeout : 400 s */
|
||||
#define PROGRAM_TIMEOUT 13U /* NOR program timeout : 64 bytes * 200 us = 12.8 ms */
|
||||
|
||||
#define NOR_HANDLE_INSTANCE FMC_NORSRAM_DEVICE
|
||||
#define NOR_HANDLE_EXTENDED FMC_NORSRAM_EXTENDED_DEVICE
|
||||
|
||||
#define NOR_ADDR_SETUP_TIME 0x1
|
||||
#define NOR_ADDR_HOLD_TIME 0x1
|
||||
#define NOR_DATA_SETUP_TIME 0x6
|
||||
#define NOR_BUS_TURN_DURATION 0x0
|
||||
#define NOR_CLK_DIVISION 0x2
|
||||
#define NOR_DATA_LATENCY 0x2
|
||||
#define NOR_ACCESS_MODE FMC_ACCESS_MODE_B
|
||||
|
||||
#define NOR_INIT_NSBANK FMC_NORSRAM_BANK2
|
||||
#define NOR_INIT_DATA_ADDR_MUX FMC_DATA_ADDRESS_MUX_DISABLE
|
||||
#define NOR_INIT_MEMORY_TYPE FMC_MEMORY_TYPE_NOR
|
||||
#define NOR_INIT_MEM_DATA_WIDTH FMC_NORSRAM_MEM_BUS_WIDTH_16
|
||||
#define NOR_INIT_BURST_ACCESS_MODE FMC_BURST_ACCESS_MODE_DISABLE
|
||||
#define NOR_INIT_WAIT_SIGNAL_PRI FMC_WAIT_SIGNAL_POLARITY_LOW
|
||||
#define NOR_INIT_WAIT_SIGNAL_ACT FMC_WAIT_TIMING_BEFORE_WS
|
||||
#define NOR_INIT_WRITE_OPERATION FMC_WRITE_OPERATION_ENABLE
|
||||
#define NOR_INIT_WAIT_SIGNAL FMC_WAIT_SIGNAL_DISABLE
|
||||
#define NOR_INIT_EXTENDED_MODE FMC_EXTENDED_MODE_DISABLE
|
||||
#define NOR_INIT_ASYNC_WAIT FMC_ASYNCHRONOUS_WAIT_DISABLE
|
||||
#define NOR_INIT_WRITE_BURST FMC_WRITE_BURST_DISABLE
|
||||
#define NOR_INIT_CONTINUOUS_CLK FMC_CONTINUOUS_CLOCK_SYNC_ONLY
|
||||
#define NOR_INIT_PAGE_SIZE FMC_PAGE_SIZE_NONE
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __HAL_NOR_STM32L4_H */
|
||||
36
Living_SDK/board/developerkit/hal/hal_qspi_stm32l4.h
Normal file
36
Living_SDK/board/developerkit/hal/hal_qspi_stm32l4.h
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef __HAL_QSPI_STM32L4_H
|
||||
#define __HAL_QSPI_STM32L4_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "stm32l4xx_hal.h"
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include "aos/kernel.h"
|
||||
|
||||
/* qspi port defines */
|
||||
#define PORT_QSPI1 1
|
||||
#define PORT_QSPI2 2
|
||||
#define PORT_QSPI3 3
|
||||
#define PORT_QSPI4 4
|
||||
|
||||
/* cmd defines in function hal_qspi_command */
|
||||
#define CMD_QUAD_PAGE_PROG 1
|
||||
|
||||
/* cmd defines in function hal_qspi_autoPolling */
|
||||
#define AP_GET_MEM_STATUS 1
|
||||
#define AP_GET_WRITE_ENABLE_STATUS 2
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __HAL_QSPI_STM32L4_H */
|
||||
33
Living_SDK/board/developerkit/hal/hal_rtc_stm32l4.h
Normal file
33
Living_SDK/board/developerkit/hal/hal_rtc_stm32l4.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef __HAL_ADC_STM32L4_H
|
||||
#define __HAL_ADC_STM32L4_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "stm32l4xx_hal.h"
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include "aos/kernel.h"
|
||||
|
||||
#define RTC_ASYNCH_PREDIV 0x7F
|
||||
#define RTC_SYNCH_PREDIV 0xF9
|
||||
|
||||
#define RTC_INIT_HOUR_FORMAT RTC_HOURFORMAT_24
|
||||
#define RTC_INIT_ASYNC_PREDIV RTC_ASYNCH_PREDIV
|
||||
#define RTC_INIT_SYNC_PREDIV RTC_SYNCH_PREDIV
|
||||
#define RTC_INIT_OUTPUT RTC_OUTPUT_DISABLE
|
||||
#define RTC_INIT_OUTPUT_PRI RTC_OUTPUT_POLARITY_HIGH
|
||||
#define RTC_INIT_OUTPUT_TYPE RTC_OUTPUT_TYPE_OPENDRAIN
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __HAL_UART_STM32L4_H */
|
||||
31
Living_SDK/board/developerkit/hal/hal_sd_stm32l4.h
Normal file
31
Living_SDK/board/developerkit/hal/hal_sd_stm32l4.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef __HAL_SD_STM32L4_H
|
||||
#define __HAL_SD_STM32L4_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "stm32l4xx_hal.h"
|
||||
#include "hal/soc/soc.h"
|
||||
|
||||
#if defined(STM32L496xx)
|
||||
#include "stm32l496xx.h"
|
||||
#endif
|
||||
|
||||
#define SD_INSTANCE SDMMC1
|
||||
#define SD_INIT_CLK_EDGE SDMMC_CLOCK_EDGE_RISING
|
||||
#define SD_INIT_CLK_BYPASS SDMMC_CLOCK_BYPASS_DISABLE
|
||||
#define SD_INIT_CLK_POWER_SAVE SDMMC_CLOCK_POWER_SAVE_DISABLE
|
||||
#define SD_INIT_BUS_WIDE SDMMC_BUS_WIDE_1B
|
||||
#define SD_INIT_HW_FLOW_CTRL SDMMC_HARDWARE_FLOW_CONTROL_ENABLE
|
||||
#define SD_INIT_CLK_DIVISION SDMMC_TRANSFER_CLK_DIV
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __HAL_SD_STM32L4_H */
|
||||
28
Living_SDK/board/developerkit/hal/hal_spi_stm32l4.h
Normal file
28
Living_SDK/board/developerkit/hal/hal_spi_stm32l4.h
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef __HAL_SPI_STM32L4_H
|
||||
#define __HAL_SPI_STM32L4_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "stm32l4xx_hal.h"
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include "aos/kernel.h"
|
||||
|
||||
#define PORT_SPI1 1
|
||||
#define PORT_SPI2 2
|
||||
#define PORT_SPI3 3
|
||||
#define PORT_SPI4 4
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __HAL_SPI_STM32L4_H */
|
||||
29
Living_SDK/board/developerkit/hal/hal_timer_stm32l4.h
Normal file
29
Living_SDK/board/developerkit/hal/hal_timer_stm32l4.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef __HAL_TIMER_STM32L4_H
|
||||
#define __HAL_TIMER_STM32L4_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "stm32l4xx_hal.h"
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include "aos/kernel.h"
|
||||
|
||||
#define PORT_TIMER1 1
|
||||
#define PORT_TIMER2 2
|
||||
#define PORT_TIMER3 3
|
||||
#define PORT_TIMER4 4
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __HAL_TIMER_STM32L4_H */
|
||||
158
Living_SDK/board/developerkit/hal/hal_uart_stm32l4.h
Normal file
158
Living_SDK/board/developerkit/hal/hal_uart_stm32l4.h
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef __HAL_UART_STM32L4_H
|
||||
#define __HAL_UART_STM32L4_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include "aos/kernel.h"
|
||||
#include "hal/hal.h"
|
||||
|
||||
|
||||
/***************************** usart1 configure *******************************/
|
||||
#define UART1 USART1
|
||||
|
||||
#define UART1_BANDRATE 115200
|
||||
#define UART1_WORD_LENGTH UART_WORDLENGTH_8B
|
||||
#define UART1_STOP_BITS UART_STOPBITS_1
|
||||
#define UART1_PARITY UART_PARITY_NONE
|
||||
#define UART1_MODE UART_MODE_TX_RX
|
||||
#define UART1_HW_FLOW_CTL UART_HWCONTROL_NONE
|
||||
#define UART1_OVER_SAMPLING UART_OVERSAMPLING_16
|
||||
#define UART1_ONE_BIT_SAMPLING UART_ONE_BIT_SAMPLE_DISABLE
|
||||
#define UART1_ADV_FEATURE_INIT UART_ADVFEATURE_NO_INIT
|
||||
|
||||
#define UART1_IRQn USART1_IRQn
|
||||
|
||||
#define UART1_CLK_ENABLE()
|
||||
#define UART1_CLK_DISABLE()
|
||||
#define UART1_TX_GPIO_CLK_ENABLE()
|
||||
#define UART1_TX_GPIO_CLK_DISABLE()
|
||||
#define UART1_RX_GPIO_CLK_ENABLE()
|
||||
#define UART1_RX_GPIO_CLK_DISABLE()
|
||||
|
||||
/***************************** usart2 configure *******************************/
|
||||
#define UART2 USART2
|
||||
|
||||
#define UART2_BANDRATE 115200
|
||||
#define UART2_WORD_LENGTH UART_WORDLENGTH_8B
|
||||
#define UART2_STOP_BITS UART_STOPBITS_1
|
||||
#define UART2_PARITY UART_PARITY_NONE
|
||||
#define UART2_MODE UART_MODE_TX_RX
|
||||
#define UART2_HW_FLOW_CTL UART_HWCONTROL_NONE
|
||||
#define UART2_OVER_SAMPLING UART_OVERSAMPLING_16
|
||||
#define UART2_ONE_BIT_SAMPLING UART_ONE_BIT_SAMPLE_DISABLE
|
||||
#define UART2_ADV_FEATURE_INIT UART_ADVFEATURE_NO_INIT
|
||||
|
||||
#define UART2_IRQn USART2_IRQn
|
||||
|
||||
#define UART2_CLK_ENABLE()
|
||||
#define UART2_CLK_DISABLE()
|
||||
#define UART2_TX_GPIO_CLK_ENABLE()
|
||||
#define UART2_TX_GPIO_CLK_DISABLE()
|
||||
#define UART2_RX_GPIO_CLK_ENABLE()
|
||||
#define UART2_RX_GPIO_CLK_DISABLE()
|
||||
|
||||
/***************************** usart3 configure *******************************/
|
||||
#define UART3 USART3
|
||||
|
||||
#define UART3_BANDRATE 115200
|
||||
#define UART3_WORD_LENGTH UART_WORDLENGTH_8B
|
||||
#define UART3_STOP_BITS UART_STOPBITS_1
|
||||
#define UART3_PARITY UART_PARITY_NONE
|
||||
#define UART3_MODE UART_MODE_TX_RX
|
||||
#define UART3_HW_FLOW_CTL UART_HWCONTROL_NONE
|
||||
#define UART3_OVER_SAMPLING UART_OVERSAMPLING_16
|
||||
#define UART3_ONE_BIT_SAMPLING UART_ONE_BIT_SAMPLE_DISABLE
|
||||
#define UART3_ADV_FEATURE_INIT UART_ADVFEATURE_NO_INIT
|
||||
|
||||
#define UART3_IRQn USART3_IRQn
|
||||
|
||||
#define UART3_CLK_ENABLE()
|
||||
#define UART3_CLK_DISABLE()
|
||||
#define UART3_TX_GPIO_CLK_ENABLE()
|
||||
#define UART3_TX_GPIO_CLK_DISABLE()
|
||||
#define UART3_RX_GPIO_CLK_ENABLE()
|
||||
#define UART3_RX_GPIO_CLK_DISABLE()
|
||||
|
||||
/***************************** uart4 configure *******************************/
|
||||
//#define UART4 UART4
|
||||
|
||||
#define UART4_BANDRATE 115200
|
||||
#define UART4_WORD_LENGTH UART_WORDLENGTH_8B
|
||||
#define UART4_STOP_BITS UART_STOPBITS_1
|
||||
#define UART4_PARITY UART_PARITY_NONE
|
||||
#define UART4_MODE UART_MODE_TX_RX
|
||||
#define UART4_HW_FLOW_CTL UART_HWCONTROL_NONE
|
||||
#define UART4_OVER_SAMPLING UART_OVERSAMPLING_16
|
||||
#define UART4_ONE_BIT_SAMPLING UART_ONE_BIT_SAMPLE_DISABLE
|
||||
#define UART4_ADV_FEATURE_INIT UART_ADVFEATURE_NO_INIT
|
||||
|
||||
#define UART4_IRQn UART4_IRQn
|
||||
|
||||
#define UART4_CLK_ENABLE()
|
||||
#define UART4_CLK_DISABLE()
|
||||
#define UART4_TX_GPIO_CLK_ENABLE()
|
||||
#define UART4_TX_GPIO_CLK_DISABLE()
|
||||
#define UART4_RX_GPIO_CLK_ENABLE()
|
||||
#define UART4_RX_GPIO_CLK_DISABLE()
|
||||
|
||||
/***************************** uart5 configure *******************************/
|
||||
//#define UART5 UART5
|
||||
|
||||
#define UART5_BANDRATE 115200
|
||||
#define UART5_WORD_LENGTH UART_WORDLENGTH_8B
|
||||
#define UART5_STOP_BITS UART_STOPBITS_1
|
||||
#define UART5_PARITY UART_PARITY_NONE
|
||||
#define UART5_MODE UART_MODE_TX_RX
|
||||
#define UART5_HW_FLOW_CTL UART_HWCONTROL_NONE
|
||||
#define UART5_OVER_SAMPLING UART_OVERSAMPLING_16
|
||||
#define UART5_ONE_BIT_SAMPLING UART_ONE_BIT_SAMPLE_DISABLE
|
||||
#define UART5_ADV_FEATURE_INIT UART_ADVFEATURE_NO_INIT
|
||||
|
||||
#define UART5_IRQn UART5_IRQn
|
||||
|
||||
#define UART5_CLK_ENABLE()
|
||||
#define UART5_CLK_DISABLE()
|
||||
#define UART5_TX_GPIO_CLK_ENABLE()
|
||||
#define UART5_TX_GPIO_CLK_DISABLE()
|
||||
#define UART5_RX_GPIO_CLK_ENABLE()
|
||||
#define UART5_RX_GPIO_CLK_DISABLE()
|
||||
|
||||
/***************************** lpuart1 configure *******************************/
|
||||
#define UART6 LPUART1
|
||||
|
||||
#define UART6_BANDRATE 115200
|
||||
#define UART6_WORD_LENGTH UART_WORDLENGTH_8B
|
||||
#define UART6_STOP_BITS UART_STOPBITS_1
|
||||
#define UART6_PARITY UART_PARITY_NONE
|
||||
#define UART6_MODE UART_MODE_TX_RX
|
||||
#define UART6_HW_FLOW_CTL UART_HWCONTROL_NONE
|
||||
#define UART6_OVER_SAMPLING UART_OVERSAMPLING_16
|
||||
#define UART6_ONE_BIT_SAMPLING UART_ONE_BIT_SAMPLE_DISABLE
|
||||
#define UART6_ADV_FEATURE_INIT UART_ADVFEATURE_NO_INIT
|
||||
|
||||
#define UART6_IRQn LPUART1_IRQn
|
||||
|
||||
#define UART6_CLK_ENABLE()
|
||||
#define UART6_CLK_DISABLE()
|
||||
#define UART6_TX_GPIO_CLK_ENABLE()
|
||||
#define UART6_TX_GPIO_CLK_DISABLE()
|
||||
#define UART6_RX_GPIO_CLK_ENABLE()
|
||||
#define UART6_RX_GPIO_CLK_DISABLE()
|
||||
|
||||
#define MAX_BUF_UART_BYTES 1024
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __HAL_UART_STM32L4_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue