[bsp][essemi] fix bugs. (#5585)

* [bsp][essemi] update es32f36xx libraries.
* [bsp][essemi] add led_pin control.
This commit is contained in:
liuhy-2020
2022-02-08 09:13:05 +08:00
committed by GitHub
parent 4192f0d651
commit a23aadd631
81 changed files with 950 additions and 616 deletions
+4
View File
@@ -12,7 +12,11 @@
#include <rtdevice.h>
#include "drv_gpio.h"
#ifdef ES_RTT_APP_LED_PIN
#define LED_PIN ES_RTT_APP_LED_PIN
#else
#define LED_PIN GET_PIN( C , 8 )
#endif
int main(void)
{
@@ -2687,5 +2687,6 @@ static const struct pin_index pins[] =
#define ES_RTT_APP_LED_PIN ES_PIN_GPIO_C_8
#endif
+4
View File
@@ -12,7 +12,11 @@
#include <rtdevice.h>
#include "drv_gpio.h"
#ifdef ES_RTT_APP_LED_PIN
#define LED_PIN ES_RTT_APP_LED_PIN
#else
#define LED_PIN GET_PIN( F , 0 )
#endif
int main(void)
{
@@ -2999,5 +2999,6 @@ static const struct pin_index pins[] =
#define ES_RTT_APP_LED_PIN ES_PIN_GPIO_F_0
#endif
+4
View File
@@ -12,7 +12,11 @@
#include <rtdevice.h>
#include "drv_gpio.h"
#ifdef ES_RTT_APP_LED_PIN
#define LED_PIN ES_RTT_APP_LED_PIN
#else
#define LED_PIN GET_PIN( F , 0 )
#endif
int main(void)
{
@@ -2904,5 +2904,6 @@ static const struct pin_index pins[] =
/* GP16C2T_CH2N */
#define ES_RTT_APP_LED_PIN ES_PIN_GPIO_F_0
#endif
@@ -8,6 +8,9 @@
* @date 18 Dec 2018
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 18 Dec 2018 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#ifndef __ES32F36XX_H__
@@ -1,12 +1,14 @@
/**
******************************************************************************
* @file startup_es32f36xx.s
* @author AE Team
* @brief ES32F36xx devices vector table for GCC toolchain.
* This module performs:
* - Set the initial SP
* - Set the initial PC == Reset_Handler,
* - Set the vector table entries with the exceptions ISR address
* - Set the vector table entries with the exceptions ISR addres
s
* - Branches to main in the C library (which eventually
* calls main()).
* After Reset the Cortex-M3 processor is in Thread mode,
@@ -16,7 +18,8 @@
* Date Author Notes
* 23 Jan 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserve
d.
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -31,7 +34,8 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**********************************************************************************
******************************************************************************
****
*/
.syntax unified
@@ -138,9 +142,10 @@ LoopFillZerobss:
bl sys_config
bl adc_config
bl __libc_init_array
/*bl __libc_init_array
bl main
bl main */
bl entry
LoopForever:
b LoopForever
@@ -8,10 +8,26 @@
* @date 24 Dec 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 24 Dec 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
*********************************************************************************
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**********************************************************************************
*/
#include "utils.h"
@@ -8,6 +8,9 @@
* @date 26 Jun 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 26 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_ACMP_H__
@@ -6,9 +6,12 @@
* @version V1.0
* @date 28 Jun 2019
* @author AE Team
* @note
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
* @note
* Change Logs:
* Date Author Notes
* 28 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -23,8 +26,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
**********************************************************************************
*/
#ifndef __ALD_ADC_H__
@@ -320,7 +322,7 @@ typedef struct {
type_func_t scan; /**< Choose scan mode enable or not */
type_func_t cont; /**< Choose continuous mode enable or not */
adc_nch_nr_t nch_nr; /**< Length of normal ranks will be converted */
adc_ich_nr_t ich_nr; /**< Length of insert ranks will be converted */
adc_ich_nr_t ich_nr; /**< Length of insert ranks will be converted */
adc_disc_mode_t disc; /**< Discontinuous mode enable or not */
adc_disc_nr_t disc_nr; /**< Number of discontinuous conversions channel */
adc_conv_bit_t data_bit; /**< The precision of conversion */
@@ -368,10 +370,10 @@ typedef struct {
typedef struct adc_handle_s {
ADC_TypeDef *perh; /**< Register base address */
adc_init_t init; /**< ADC required parameters */
#ifdef ALD_DMA
dma_handle_t hdma; /**< Pointer DMA Handler */
pis_handle_t hpis; /**< Pointer PIS Handler for connect adc and dma */
#endif
lock_state_t lock; /**< ADC locking object */
adc_state_t state; /**< ADC communication state */
adc_error_t error_code; /**< ADC Error code */
@@ -405,7 +407,7 @@ typedef struct {
timer_handle_t h_timer; /**< Handle of TIMER module */
adc_handle_t h_adc; /**< Handle of ADC module */
adc_nch_conf_t config; /**< Struct for chanel configure */
adc_ich_conf_t i_config; /**< Struct for insert channel configure */
adc_ich_conf_t i_config;/**< Struct for insert channel configuration */
} adc_timer_config_t;
/**
* @}
@@ -8,6 +8,9 @@
* @date 15 Dec 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 15 Dec 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_BKPC_H__
@@ -8,6 +8,9 @@
* @date 26 Jun 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 26 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_CALC_H__
@@ -7,6 +7,9 @@
* @date 16 Apr 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 16 Apr 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -23,8 +26,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
**********************************************************************************
*/
#ifndef __ALD_CAN_H
@@ -8,6 +8,9 @@
* @date 22 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 22 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_CMU_H__
File diff suppressed because it is too large Load Diff
@@ -8,6 +8,9 @@
* @date 18 Jun 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 18 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_CRC_H__
@@ -108,9 +110,9 @@ typedef struct crc_handle_s {
crc_init_t init; /**< CRC required parameters */
uint8_t *cal_buf; /**< The pointer of preparing buffer */
uint32_t *cal_res; /**< The pointer of result */
#ifdef ALD_DMA
dma_handle_t hdma; /**< CRC DMA handle parameters */
#endif
lock_state_t lock; /**< Locking object */
crc_state_t state; /**< CRC operation state */
@@ -169,7 +171,7 @@ uint32_t ald_crc_calculate_word(crc_handle_t *hperh, uint32_t *buf, uint32_t siz
* @}
*/
#ifdef ALD_DMA
/** @addtogroup CRC_Public_Functions_Group3
* @{
*/
@@ -182,7 +184,7 @@ ald_status_t ald_crc_dma_stop(crc_handle_t *hperh);
/**
* @}
*/
#endif
/** @addtogroup CRC_Public_Functions_Group4
* @{
*/
@@ -8,8 +8,11 @@
* @date 19 Jun 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 19 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_CRYPT_H__
@@ -36,7 +38,6 @@
#endif
#include "utils.h"
#include "ald_dma.h"
/** @addtogroup ES32FXXX_ALD
* @{
@@ -184,10 +185,10 @@ typedef struct {
typedef struct crypt_handle_s {
CRYPT_TypeDef *perh; /**< Register base address */
crypt_init_t init; /**< CRYPT required parameters */
#ifdef ALD_DMA
dma_handle_t hdma_m2p; /**< CRYPT DMA handle parameters memory to crypt module */
dma_handle_t hdma_p2m; /**< CRYPT DMA handle parameters crypt module to memory */
#endif
uint8_t *plain_text; /**< Pointer to plain text */
uint8_t *cipher_text; /**< Pointer to cipher text */
uint32_t size; /**< The size of crypt data buf */
@@ -279,12 +280,12 @@ extern ald_status_t ald_crypt_decrypt(crypt_handle_t *hperh, uint8_t * cipher_te
extern ald_status_t ald_crypt_gcm_verify(crypt_handle_t *hperh, uint8_t *cipher_text, uint32_t size, uint8_t *aadata, uint32_t alen, uint8_t *tag);
extern ald_status_t ald_crypt_encrypt_by_it(crypt_handle_t *hperh, uint8_t *plain_text, uint8_t *cipher_text, uint32_t size);
extern ald_status_t ald_crypt_decrypt_by_it(crypt_handle_t *hperh, uint8_t *cipher_text, uint8_t *plain_text, uint32_t size);
#ifdef ALD_DMA
extern ald_status_t ald_crypt_encrypt_by_dma(crypt_handle_t *hperh, uint8_t * plain_text,
uint8_t *cipher_text, uint32_t size, uint8_t channel_m2p, uint8_t channel_p2m);
extern ald_status_t ald_crypt_decrypt_by_dma(crypt_handle_t *hperh, uint8_t * cipher_text,
uint8_t *plain_text, uint32_t size, uint8_t channel_m2p, uint8_t channel_p2m);
#endif
/**
* @}
*/
@@ -292,11 +293,11 @@ extern ald_status_t ald_crypt_decrypt_by_dma(crypt_handle_t *hperh, uint8_t * ci
/** @addtogroup CRYPT_Public_Functions_Group3
* @{
*/
#ifdef ALD_DMA
extern ald_status_t ald_crypt_dma_pause(crypt_handle_t *hperh);
extern ald_status_t ald_crypt_dma_resume(crypt_handle_t *hperh);
extern ald_status_t ald_crypt_dma_stop(crypt_handle_t *hperh);
#endif
extern void ald_crypt_irq_handler(crypt_handle_t *hperh);
/**
* @}
@@ -6,9 +6,12 @@
* @version V1.0
* @date 28 Jun 2019
* @author AE Team
* @note
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
* @note
* Change Logs:
* Date Author Notes
* 28 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -23,8 +26,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
**********************************************************************************
*/
#ifndef __ALD_DAC_H__
@@ -35,8 +37,6 @@
#endif
#include "utils.h"
#include "ald_dma.h"
#include "ald_pis.h"
/** @addtogroup ES32FXXX_ALD
* @{
@@ -8,6 +8,9 @@
* @date 04 Jun 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 04 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,9 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_DBGC_H__
@@ -8,6 +8,9 @@
* @date 09 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 09 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_DMA_H__
@@ -8,6 +8,9 @@
* @date 20 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 20 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
@@ -8,6 +8,9 @@
* @date 17 Jun 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 17 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_FLASH_H__
@@ -8,8 +8,11 @@
* @date 07 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 07 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_GPIO_H__
@@ -7,9 +7,12 @@
* @version V1.0
* @date 15 Nov 2019
* @author AE Team
* @note
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
* @note
* Change Logs:
* Date Author Notes
* 30 Jun 2020 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_I2C_H__
@@ -286,10 +288,10 @@ typedef struct i2c_handle_s {
uint8_t *p_buff; /**< Pointer to I2C transfer buffer */
uint16_t xfer_size; /**< I2C transfer size */
__IO uint16_t xfer_count; /**< I2C transfer counter */
#ifdef ALD_DMA
dma_handle_t hdmatx; /**< I2C Tx DMA handle parameters */
dma_handle_t hdmarx; /**< I2C Rx DMA handle parameters */
#endif
lock_state_t lock; /**< I2C locking object */
__IO i2c_state_t state; /**< I2C communication state */
__IO i2c_mode_t mode; /**< I2C communication mode */
@@ -410,7 +412,7 @@ ald_status_t ald_i2c_mem_write_by_it(i2c_handle_t *hperh, uint16_t dev_addr, uin
ald_status_t ald_i2c_mem_read_by_it(i2c_handle_t *hperh, uint16_t dev_addr, uint16_t mem_addr,
i2c_addr_size_t add_size, uint8_t *buf, uint32_t size);
#ifdef ALD_DMA
/** Non-Blocking mode: DMA */
ald_status_t ald_i2c_master_send_by_dma(i2c_handle_t *hperh, uint16_t dev_addr,
uint8_t *buf, uint8_t size, uint8_t channel);
@@ -422,7 +424,7 @@ ald_status_t ald_i2c_mem_write_by_dma(i2c_handle_t *hperh, uint16_t dev_addr, ui
uint8_t *buf, uint8_t size, uint8_t channel);
ald_status_t ald_i2c_mem_read_by_dma(i2c_handle_t *hperh, uint16_t dev_addr, uint16_t mem_addr,
i2c_addr_size_t add_size, uint8_t *buf, uint8_t size, uint8_t channel);
#endif
/**
* @}
*/
@@ -8,6 +8,9 @@
* @date 13 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 13 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_I2S_H__
@@ -226,10 +228,10 @@ typedef struct i2s_handle_s {
uint16_t *rx_buf; /**< Pointer to I2S Rx transfer buffer */
uint32_t rx_size; /**< I2S Rx Transfer size */
uint32_t rx_count; /**< I2S Rx Transfer Counter */
#ifdef ALD_DMA
dma_handle_t hdmatx; /**< I2S DMA handle parameters */
dma_handle_t hdmarx; /**< I2S DMA handle parameters */
#endif
lock_state_t lock; /**< Locking object */
i2s_state_t state; /**< I2S communication state */
uint8_t side; /**< I2S channel side */
@@ -337,13 +339,13 @@ ald_status_t ald_i2s_master_send(i2s_handle_t *hperh, uint16_t *buf, uint32_t si
ald_status_t ald_i2s_master_recv(i2s_handle_t *hperh, uint16_t *buf, uint32_t size, uint32_t timeout);
ald_status_t ald_i2s_master_send_by_it(i2s_handle_t *hperh, uint16_t *buf, uint32_t size);
ald_status_t ald_i2s_master_recv_by_it(i2s_handle_t *hperh, uint16_t *buf, uint32_t size);
#ifdef ALD_DMA
ald_status_t ald_i2s_master_send_by_dma(i2s_handle_t *hperh, uint16_t *buf, uint32_t size, uint8_t channel);
ald_status_t ald_i2s_master_recv_by_dma(i2s_handle_t *hperh, uint16_t *buf, uint32_t size, uint8_t dma_ch, uint8_t _dma_ch);
ald_status_t ald_i2s_dma_pause(i2s_handle_t *hperh);
ald_status_t ald_i2s_dma_resume(i2s_handle_t *hperh);
ald_status_t ald_i2s_dma_stop(i2s_handle_t *hperh);
#endif
/**
* @}
*/
@@ -8,6 +8,9 @@
* @date 04 Dec 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 04 Dec 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_IAP_H__
@@ -8,6 +8,9 @@
* @date 07 Dec 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 07 Dec 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_NAND_H_
@@ -8,6 +8,9 @@
* @date 07 Dec 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 07 Dec 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_NOR_LCD_H_
@@ -8,6 +8,9 @@
* @date 27 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 27 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_PIS_H__
@@ -8,6 +8,9 @@
* @date 04 Dec 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 04 Dec 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_PMU_H__
@@ -4,9 +4,12 @@
* @version V1.0
* @date 09 Nov 2019
* @author AE Team
* @note
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
* @note
* Change Logs:
* Date Author Notes
* 09 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -21,8 +24,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_QSPI_H_
@@ -276,9 +278,9 @@ typedef struct {
uint8_t *rx_buf; /**< Pointer to QSPI receive buffer */
uint16_t rx_size; /**< QSPI receive size */
uint16_t rx_cnt; /**< QSPI receive counter */
#ifdef ALD_DMA
dma_handle_t hdma; /**< QSPI Rx/Tx DMA Handle parameters*/
#endif
qspi_state_t state; /**< QSPI communication state */
__IO lock_state_t lock; /**< Locking object*/
} qspi_handle_t;
@@ -8,8 +8,11 @@
* @date 04 Dec 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 04 Dec 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_RMU_H__
@@ -7,6 +7,9 @@
* @date 16 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 16 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -23,8 +26,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************************
**********************************************************************************
*/
#ifndef __ALD_RTC_H__
@@ -7,6 +7,9 @@
* @date 16 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 16 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -23,8 +26,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************************
**********************************************************************************
*/
#ifndef __ALD_RTCHW_H__
@@ -35,7 +37,6 @@ extern "C" {
#endif
#include "utils.h"
#include "ald_rtc.h"
/** @addtogroup ES32FXXX_ALD
@@ -8,6 +8,9 @@
* @date 13 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 13 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_SPI_H__
@@ -248,10 +250,10 @@ typedef struct spi_handle_s {
uint8_t *rx_buf; /**< Pointer to SPI Rx transfer buffer */
uint16_t rx_size; /**< SPI Rx Transfer size */
uint16_t rx_count; /**< SPI Rx Transfer Counter */
#ifdef ALD_DMA
dma_handle_t hdmatx; /**< SPI Tx DMA handle parameters */
dma_handle_t hdmarx; /**< SPI Rx DMA handle parameters */
#endif
lock_state_t lock; /**< Locking object */
spi_state_t state; /**< SPI communication state */
uint32_t err_code; /**< SPI error code */
@@ -400,14 +402,14 @@ ald_status_t ald_spi_send_recv(spi_handle_t *hperh, uint8_t *tx_buf, uint8_t *rx
ald_status_t ald_spi_send_by_it(spi_handle_t *hperh, uint8_t *buf, uint16_t size);
ald_status_t ald_spi_recv_by_it(spi_handle_t *hperh, uint8_t *buf, uint16_t size);
ald_status_t ald_spi_send_recv_by_it(spi_handle_t *hperh, uint8_t *tx_buf, uint8_t *rx_buf, uint16_t size);
#ifdef ALD_DMA
ald_status_t ald_spi_send_by_dma(spi_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel);
ald_status_t ald_spi_recv_by_dma(spi_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel);
ald_status_t ald_spi_send_recv_by_dma(spi_handle_t *hperh, uint8_t *tx_buf, uint8_t *rx_buf, uint16_t size, uint8_t tx_channel, uint8_t rx_channel);
ald_status_t ald_spi_dma_pause(spi_handle_t *hperh);
ald_status_t ald_spi_dma_resume(spi_handle_t *hperh);
ald_status_t ald_spi_dma_stop(spi_handle_t *hperh);
#endif
/**
* @}
*/
@@ -8,6 +8,9 @@
* @date 07 Dec 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 07 Dec 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_SRAM_H__
@@ -70,10 +72,10 @@ typedef struct {
ald_ebi_nor_sram_init_t init; /**< SRAM device control configuration parameters */
lock_state_t lock; /**< SRAM locking object */
__IO ald_sram_state_t state; /**< SRAM device access state */
#ifdef ALD_DMA
dma_handle_t hdma; /**< SRAM DMA Handle parameters */
void(*cplt_cbk)(void *arg); /**< DMA transmit completely callback function */
#endif
} sram_handle_t;
/**
* @}
@@ -8,6 +8,9 @@
* @date 04 Jun 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 04 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_SYSCFG_H__
@@ -9,6 +9,9 @@
* @date 06 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 06 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -25,8 +28,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_TIMER_H__
@@ -200,10 +202,8 @@ typedef struct timer_handle_s {
lock_state_t lock; /**< Locking object */
timer_state_t state; /**< TIMER operation state */
#ifdef ALD_DMA
dma_handle_t hdma1; /**< Timer DMA handle parameters */
dma_handle_t hdma2;
#endif
void (*period_elapse_cbk)(struct timer_handle_s *arg); /**< Period elapse callback */
void (*delay_elapse_cbk)(struct timer_handle_s *arg); /**< Delay_elapse callback */
@@ -1011,11 +1011,11 @@ void ald_timer_base_start(timer_handle_t *hperh);
void ald_timer_base_stop(timer_handle_t *hperh);
void ald_timer_base_start_by_it(timer_handle_t *hperh);
void ald_timer_base_stop_by_it(timer_handle_t *hperh);
#ifdef ALD_DMA
ald_status_t ald_timer_base_start_by_dma(timer_handle_t *hperh,
uint16_t *buf, uint32_t len, uint8_t dma_ch);
void ald_timer_base_stop_by_dma(timer_handle_t *hperh);
#endif
/**
* @}
*/
@@ -1029,11 +1029,11 @@ void ald_timer_oc_start(timer_handle_t *hperh, timer_channel_t ch);
void ald_timer_oc_stop(timer_handle_t *hperh, timer_channel_t ch);
void ald_timer_oc_start_by_it(timer_handle_t *hperh, timer_channel_t ch);
void ald_timer_oc_stop_by_it(timer_handle_t *hperh, timer_channel_t ch);
#ifdef ALD_DMA
ald_status_t ald_timer_oc_start_by_dma(timer_handle_t *hperh, timer_channel_t ch,
uint16_t *buf, uint32_t len, uint8_t dma_ch);
void ald_timer_oc_stop_by_dma(timer_handle_t *hperh, timer_channel_t ch);
#endif
/**
* @}
*/
@@ -1050,11 +1050,11 @@ void ald_timer_pwm_stop_by_it(timer_handle_t *hperh, timer_channel_t ch);
void ald_timer_pwm_set_freq(timer_handle_t *hperh, uint32_t freq);
void ald_timer_pwm_set_duty(timer_handle_t *hperh, timer_channel_t ch, uint16_t duty);
void ald_timer_pwm_set_input(timer_handle_t *hperh, timer_channel_t ch);
#ifdef ALD_DMA
ald_status_t ald_timer_pwm_start_by_dma(timer_handle_t *hperh, timer_channel_t ch,
uint16_t *buf, uint32_t len, uint8_t dma_ch);
void ald_timer_pwm_stop_by_dma(timer_handle_t *hperh, timer_channel_t ch);
#endif
/**
* @}
*/
@@ -1068,11 +1068,11 @@ void ald_timer_ic_start(timer_handle_t *hperh, timer_channel_t ch);
void ald_timer_ic_stop(timer_handle_t *hperh, timer_channel_t ch);
void ald_timer_ic_start_by_it(timer_handle_t *hperh, timer_channel_t ch);
void ald_timer_ic_stop_by_it(timer_handle_t *hperh, timer_channel_t ch);
#ifdef ALD_DMA
ald_status_t ald_timer_ic_start_by_dma(timer_handle_t *hperh, timer_channel_t ch,
uint16_t *buf, uint32_t len, uint8_t dma_ch);
void ald_timer_ic_stop_by_dma(timer_handle_t *hperh, timer_channel_t ch);
#endif
/**
* @}
*/
@@ -1099,12 +1099,12 @@ void ald_timer_encoder_start(timer_handle_t *hperh, timer_channel_t ch);
void ald_timer_encoder_stop(timer_handle_t *hperh, timer_channel_t ch);
void ald_timer_encoder_start_by_it(timer_handle_t *hperh, timer_channel_t ch);
void ald_timer_encoder_stop_by_it(timer_handle_t *hperh, timer_channel_t ch);
#ifdef ALD_DMA
ald_status_t ald_timer_encoder_start_by_dma(timer_handle_t *hperh, timer_channel_t ch,
uint16_t *buf1, uint16_t *buf2, uint32_t len,
uint8_t dma_ch1, uint8_t dma_ch2);
void ald_timer_encoder_stop_by_dma(timer_handle_t *hperh, timer_channel_t ch);
#endif
/**
* @}
*/
@@ -1118,11 +1118,11 @@ void ald_timer_hall_sensor_start(timer_handle_t *hperh);
void ald_timer_hall_sensor_stop(timer_handle_t *hperh);
void ald_timer_hall_sensor_start_by_it(timer_handle_t *hperh);
void ald_timer_hall_sensor_stop_by_it(timer_handle_t *hperh);
#ifdef ALD_DMA
ald_status_t ald_timer_hall_sensor_start_by_dma(timer_handle_t *hperh,
uint16_t *buf, uint32_t len, uint8_t dma_ch);
void ald_timer_hall_sensor_stop_by_dma(timer_handle_t *hperh);
#endif
/**
* @}
*/
@@ -1135,11 +1135,11 @@ void ald_timer_ocn_start(timer_handle_t *hperh, timer_channel_t ch);
void ald_timer_ocn_stop(timer_handle_t *hperh, timer_channel_t ch);
void ald_timer_ocn_start_by_it(timer_handle_t *hperh, timer_channel_t ch);
void ald_timer_ocn_stop_by_it(timer_handle_t *hperh, timer_channel_t ch);
#ifdef ALD_DMA
ald_status_t ald_timer_ocn_start_by_dma(timer_handle_t *hperh,
timer_channel_t ch, uint16_t *buf, uint32_t len, uint8_t dma_ch);
void ald_timer_ocn_stop_by_dma(timer_handle_t *hperh, timer_channel_t ch);
#endif
/**
* @}
*/
@@ -1152,11 +1152,11 @@ void ald_timer_pwmn_start(timer_handle_t *hperh, timer_channel_t ch);
void ald_timer_pwmn_stop(timer_handle_t *hperh, timer_channel_t ch);
void ald_timer_pwmn_start_by_it(timer_handle_t *hperh, timer_channel_t ch);
void ald_timer_pwmn_stop_by_it(timer_handle_t *hperh, timer_channel_t ch);
#ifdef ALD_DMA
ald_status_t ald_timer_pwmn_start_by_dma(timer_handle_t *hperh,
timer_channel_t ch, uint16_t *buf, uint32_t len, uint8_t dma_ch);
void ald_timer_pwmn_stop_by_dma(timer_handle_t *hperh, timer_channel_t ch);
#endif
/**
* @}
*/
@@ -8,8 +8,11 @@
* @date 26 Jun 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 26 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_TRNG_H__
@@ -8,6 +8,9 @@
* @date 26 Jun 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 26 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_TSENSE_H__
@@ -8,8 +8,11 @@
* @date 21 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 21 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_UART_H__
@@ -190,10 +192,10 @@ typedef struct uart_handle_s {
uint8_t *rx_buf; /**< Pointer to UART Rx transfer Buffer */
uint16_t rx_size; /**< UART Rx Transfer size */
uint16_t rx_count; /**< UART Rx Transfer Counter */
#ifdef ALD_DMA
dma_handle_t hdmatx; /**< UART Tx DMA Handle parameters */
dma_handle_t hdmarx; /**< UART Rx DMA Handle parameters */
#endif
lock_state_t lock; /**< Locking object */
uart_state_t state; /**< UART communication state */
uart_error_t err_code; /**< UART Error code */
@@ -485,13 +487,13 @@ ald_status_t ald_uart_recv_n_lock(uart_handle_t *hperh, uint8_t *buf, uint16_t s
ald_status_t ald_uart_send_by_it(uart_handle_t *hperh, uint8_t *buf, uint16_t size);
ald_status_t ald_uart_recv_by_it(uart_handle_t *hperh, uint8_t *buf, uint16_t size);
ald_status_t ald_uart_recv_frame_by_it(uart_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t t_out);
#ifdef ALD_DMA
ald_status_t ald_uart_send_by_dma(uart_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel);
ald_status_t ald_uart_recv_by_dma(uart_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel);
ald_status_t ald_uart_dma_pause(uart_handle_t *hperh);
ald_status_t ald_uart_dma_resume(uart_handle_t *hperh);
ald_status_t ald_uart_dma_stop(uart_handle_t *hperh);
#endif
void ald_uart_irq_handler(uart_handle_t *hperh);
void ald_uart_irq_handler_fast(uart_handle_t *hperh);
/**
@@ -8,8 +8,11 @@
* @date 25 Dec 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 25 Dec 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_USB_H__
@@ -7,9 +7,12 @@
* @version V1.0
* @date 18 Dec 2019
* @author AE Team
* @note
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
* @note
* Change Logs:
* Date Author Notes
* 18 Dec 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
********************************************************************************
**********************************************************************************
*/
#ifndef __ALD_WDT_H__
@@ -8,6 +8,9 @@
* @date 17 Apr 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 17 Apr 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#ifndef __TYPE_H__
@@ -37,7 +39,6 @@ extern "C" {
#include <stdint.h>
#include "es_conf_info_select.h"
#if defined (__CC_ARM)
#define __INLINE__ __inline
#define __STATIC_INLINE__ static __inline
@@ -8,6 +8,9 @@
* @date 07 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 07 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#ifndef __UTILS_H__
@@ -36,7 +38,6 @@
#endif
#include <stdlib.h>
#include "ald_conf.h"
#include "type.h"
#ifdef ES32F36xx
#include "es32f36xx.h"
@@ -169,9 +170,9 @@ void ald_systick_interval_select(systick_interval_t value);
*/
/* Peripheral Control functions */
void ald_inc_tick(void);
void ald_systick_irq_cbk(void);
void ald_delay_us(__IO uint32_t delay);
void ald_systick_irq_cbk(void);
void ald_delay_ms(__IO uint32_t delay);
void ald_delay_us(__IO uint32_t delay);
uint32_t ald_get_tick(void);
void ald_suspend_tick(void);
void ald_resume_tick(void);
@@ -8,6 +8,9 @@
* @date 26 Jun 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 26 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,11 +27,10 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#include "ald_acmp.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
* @{
@@ -21,6 +21,9 @@
* @date 28 Jun 2019
* @author AE Team.
* @note
* Change Logs:
* Date Author Notes
* 28 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -37,14 +40,11 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#include "ald_cmu.h"
#include "ald_adc.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
* @{
@@ -73,7 +73,6 @@ static void adc_dma_error(void *arg);
* @}
*/
/** @defgroup ADC_Public_Functions ADC Public Functions
* @{
*/
@@ -160,8 +159,7 @@ ald_status_t ald_adc_init(adc_handle_t *hperh)
SET_BIT(ADC0->CCR, ADC_CCR_TRMEN_MSK);
SET_BIT(ADC1->CCR, ADC_CCR_TRMEN_MSK);
MODIFY_REG(hperh->perh->CON1, ADC_CON1_NCHESEL_MSK, hperh->init.nche_sel << ADC_CON1_NCHESEL_POS);
MODIFY_REG(hperh->perh->CON1, ADC_CON1_NCHESEL_MSK, hperh->init.nche_sel << ADC_CON1_NCHESEL_POS);
ald_adc_interrupt_config(hperh, ADC_IT_OVR, ENABLE);
ADC_ENABLE(hperh);
@@ -1131,33 +1129,33 @@ uint32_t ald_adc_get_error(adc_handle_t *hperh)
*/
void ald_adc_offset_adjust(uint32_t refmv)
{
uint32_t tmp = 0, os = 0;
if (refmv == 0) return;
*((volatile uint32_t *)(0x40080000)) = 0x55AA6996;
*((volatile uint32_t *)(0x40080100)) = 0x5A962814;
*((volatile uint32_t *)(0x40080100)) = 0xE7CB69A5;
tmp = INFO_ADC0DA;
os = tmp & 0x7F;
os = (uint32_t)((os * 5000) / refmv + 0.5);
tmp = tmp & 0xFF80;
tmp |= os;
tmp |= 0x55AA0000;
CFG_ADC0DA = tmp;
tmp = INFO_ADC1DA;
os = tmp & 0x7F;
os = (uint32_t)((os * 5000) / refmv + 0.5);
tmp = tmp & 0xFF80;
tmp |= os;
tmp |= 0x55AA0000;
CFG_ADC1DA = tmp;
*((volatile uint32_t *)(0x40080100)) = 0x123456;
*((volatile uint32_t *)(0x40080100)) = 0x123456;
*((volatile uint32_t *)(0x40080000)) = 0x123456;
uint32_t tmp = 0, os = 0;
if (refmv == 0) return;
*((volatile uint32_t *)(0x40080000)) = 0x55AA6996;
*((volatile uint32_t *)(0x40080100)) = 0x5A962814;
*((volatile uint32_t *)(0x40080100)) = 0xE7CB69A5;
tmp = INFO_ADC0DA;
os = tmp & 0x7F;
os = (uint32_t)((os * 5000) / refmv + 0.5);
tmp = tmp & 0xFF80;
tmp |= os;
tmp |= 0x55AA0000;
CFG_ADC0DA = tmp;
tmp = INFO_ADC1DA;
os = tmp & 0x7F;
os = (uint32_t)((os * 5000) / refmv + 0.5);
tmp = tmp & 0xFF80;
tmp |= os;
tmp |= 0x55AA0000;
CFG_ADC1DA = tmp;
*((volatile uint32_t *)(0x40080100)) = 0x123456;
*((volatile uint32_t *)(0x40080100)) = 0x123456;
*((volatile uint32_t *)(0x40080000)) = 0x123456;
}
/**
@@ -8,6 +8,9 @@
* @date 15 Dec 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 15 Dec 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,13 +27,10 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#include "ald_bkpc.h"
#include "ald_rtc.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
* @{
@@ -8,8 +8,11 @@
* @date 26 Jun 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 26 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -24,11 +27,10 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#include "ald_calc.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
@@ -7,10 +7,15 @@
* + Initialization functions
* + IO operation functions
* + Peripheral Control functions
* + Peripheral Control functions
* + Peripheral State and Error functions
* @version V1.0
* @date 25 Apr 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 25 Apr 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -27,8 +32,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
********************************************************************************
**********************************************************************************
* @verbatim
==============================================================================
##### How to use this driver #####
@@ -80,7 +84,7 @@
******************************************************************************
*/
#include "ald_can.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
@@ -443,8 +447,8 @@ ald_status_t ald_can_recv(can_handle_t *hperh, can_rx_fifo_t num, can_rx_msg_t *
}
}
// if (__can_rx_check(hperh, num))
// return ERROR;
if (__can_rx_check(hperh, num))
return ERROR;
stid = READ_BITS(hperh->perh->RxFIFO[num].RXFID, CAN_RXF0ID_STDID_MSK, CAN_RXF0ID_STDID_POSS);
exid = READ_BITS(hperh->perh->RxFIFO[num].RXFID, CAN_RXF0ID_EXID_MSK, CAN_RXF0ID_EXID_POSS);
@@ -8,8 +8,11 @@
* @date 22 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 22 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
* @verbatim
==============================================================================
##### How to use this driver #####
@@ -138,9 +140,7 @@
******************************************************************************
*/
#include "ald_cmu.h"
#include "ald_flash.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
* @{
@@ -8,6 +8,9 @@
* @date 18 Jun 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 18 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,11 +27,10 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#include "ald_crc.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
* @{
@@ -9,6 +9,9 @@
* @date 19 Jun 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 19 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -25,12 +28,11 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#include "ald_crypt.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
@@ -7,6 +7,9 @@
* @date 28 Jun 2019
* @author AE Team.
* @note
* Change Logs:
* Date Author Notes
* 28 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -23,11 +26,10 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#include "ald_dac.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
@@ -8,6 +8,9 @@
* @date 09 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 09 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
* @verbatim
==============================================================================
##### How to use this driver #####
@@ -71,7 +73,6 @@
#include <string.h>
#include "ald_conf.h"
#include "ald_dma.h"
/** @addtogroup ES32FXXX_ALD
@@ -183,21 +184,32 @@ static void dma_config_base(DMA_TypeDef *DMAx, dma_cycle_ctrl_t mode, dma_config
*/
void ald_dma_irq_handler(void)
{
uint32_t i, reg = DMA0->IFLAG;
uint32_t i, reg;
dma_descriptor_t *descr0, *descr1;
uint32_t p_addr, a_addr;
reg = DMA0->IFLAG;
p_addr = DMA0->CTRLBASE;
a_addr = DMA0->ALTCTRLBASE;
for (i = 0; i < DMA_CH_COUNT; ++i) {
if (READ_BIT(reg, (1U << i))) {
DMA0->ICFR = (1U << i);
DMA0->CHENCLR = (1U << i);
if (dma0_cbk[i].cplt_cbk != NULL)
dma0_cbk[i].cplt_cbk(dma0_cbk[i].cplt_arg);
DMA0->ICFR = (1U << i);
descr0 = (dma_descriptor_t *)(p_addr) + i;
descr1 = (dma_descriptor_t *)(a_addr) + i;
if ((descr0->ctrl.cycle_ctrl == DMA_CYCLE_CTRL_NONE)
&& (descr1->ctrl.cycle_ctrl == DMA_CYCLE_CTRL_NONE))
DMA0->CHENCLR = (1U << i);
}
}
if (READ_BIT(reg, (1U << DMA_ERR))) {
DMA0->ICFR = (1U << DMA_ERR);
for (i = 0; i < DMA_CH_COUNT; ++i) {
if (dma0_cbk[i].err_cbk != NULL)
dma0_cbk[i].err_cbk(dma0_cbk[i].err_arg);
@@ -8,6 +8,9 @@
* @date 20 Jan 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 20 Jan 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,10 +27,10 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************
**********************************************************************************
*/
#include "ald_ebi.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
* @{
@@ -8,6 +8,9 @@
* @date 17 Jun 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 17 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,10 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
*
*********************************************************************************
**********************************************************************************
* @verbatim
==============================================================================
##### FLASH Peripheral features #####
@@ -47,7 +47,7 @@
@endverbatim
*/
#include "ald_flash.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
@@ -8,6 +8,9 @@
* @date 17 Jun 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 17 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,10 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
*
*********************************************************************************
**********************************************************************************
* @verbatim
==============================================================================
##### FLASH Peripheral features #####
@@ -60,7 +60,7 @@
*/
#include "ald_flash.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
@@ -13,6 +13,9 @@
* @date 07 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 07 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -29,8 +32,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
* @verbatim
==============================================================================
##### GPIO Peripheral features #####
@@ -139,8 +141,6 @@
*/
#include "ald_conf.h"
#include "ald_gpio.h"
/** @addtogroup ES32FXXX_ALD
* @{
@@ -199,7 +199,7 @@ void ald_gpio_init(GPIO_TypeDef *GPIOx, uint16_t pin, gpio_init_t *init)
for (i = 0; i < 16; ++i) {
if (((pin >> i) & 0x1) == 0)
continue;
/* Get position and 2-bits mask */
pos = i << 1;
mask = 0x3 << pos;
File diff suppressed because it is too large Load Diff
@@ -14,6 +14,9 @@
* @date 13 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 13 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -30,8 +33,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
@verbatim
==============================================================================
##### How to use this driver #####
@@ -67,9 +69,7 @@
* @endverbatim
*/
#include "ald_i2s.h"
#include "ald_cmu.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
* @{
@@ -8,6 +8,9 @@
* @date 04 Dec 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 04 Dec 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,11 +27,10 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#include "ald_iap.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
@@ -5,9 +5,12 @@
* @brief NAND module driver.
*
* @version V1.0
* @date 18 March 2019
* @date 18 Mar 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 18 Mar 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,8 +27,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
* @verbatim
==============================================================================
##### How to use this driver #####
@@ -54,7 +56,7 @@
******************************************************************************
*/
#include "ald_nand.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
@@ -305,7 +307,8 @@ ald_status_t ald_nand_read_page_8b(nand_handle_t *hperh, nand_address_t *addr, u
*(__IO uint8_t *)((uint32_t)(deviceaddr | CMD_AREA)) = ((uint8_t)0x00);
}
ald_delay_us(25); /*延时25us,nand flash 手册中的最大值*/
/*延时25us,nand flash 手册中的最大值*/
ald_delay_us(25);
/* Get Data into Buffer */
for (; index < size; index++) {
@@ -8,6 +8,9 @@
* @date 25 Dec 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 25 Dec 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,11 +27,10 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#include "ald_nor_lcd.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
@@ -8,6 +8,9 @@
* @date 27 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 27 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,11 +27,10 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#include "ald_pis.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
* @{
@@ -8,6 +8,9 @@
* @date 04 Dec 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 04 Dec 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,12 +27,10 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#include "ald_pmu.h"
#include "ald_bkpc.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
@@ -8,6 +8,9 @@
* @date 09 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 09 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,10 +27,9 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#include "ald_qspi.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
@@ -106,15 +108,13 @@ void ald_qspi_init(qspi_handle_t *hperh)
assert_param(IS_QSPI_CLOCK_PRESCALER(hperh->init.clkdiv));
assert_param(IS_QSPI_CLOCK_PHASE(hperh->init.chpa));
assert_param(IS_QSPI_CLOCK_POLARITY(hperh->init.cpol));
MODIFY_REG(hperh->perh->CR, QSPI_CR_BAUD_MSK | QSPI_CR_CPOL_MSK | QSPI_CR_CPHA_MSK | \
QSPI_CR_PSL_MSK | QSPI_CR_SWPP_MSK , (hperh->init.clkdiv << QSPI_CR_BAUD_POSS) | \
(hperh->init.cpol << QSPI_CR_CPOL_POS) | \
(hperh->init.chpa << QSPI_CR_CPHA_POS) | \
(hperh->init.chipsel << QSPI_CR_PSL_POSS) | \
(hperh->init.wrppin << QSPI_CR_SWPP_POS));
return;
}
/**
@@ -329,7 +329,7 @@ ald_status_t qspi_dac_config(qspi_handle_t * hperh, qspi_dac_cfg_t * dcfg)
return ERROR;
if (ald_qspi_read_config(hperh, &dcfg->rdinit) != OK)
return ERROR;
if (dcfg->addrremap)
MODIFY_REG(hperh->perh->RAR, QSPI_RAR_READDR_MSK, dcfg->remapaddr);
@@ -8,6 +8,9 @@
* @date 04 Dec 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 04 Dec 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,12 +27,10 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#include "ald_rmu.h"
#include "ald_syscfg.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
* @{
@@ -15,6 +15,10 @@
* @version V1.0
* @date 25 Apr 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 25 Apr 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -31,8 +35,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
********************************************************************************
**********************************************************************************
* @verbatim
==============================================================================
##### How to use this driver #####
@@ -130,10 +133,7 @@
******************************************************************************
*/
#include "ald_rtc.h"
#include "ald_bkpc.h"
#include "ald_tsense.h"
#include "ald_syscfg.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
@@ -1171,7 +1171,7 @@ flag_status_t ald_rtc_get_flag_status(rtc_flag_t flag)
{
assert_param(IS_RTC_IF(flag));
if (READ_BIT(RTC->IFR, flag))
if ((READ_BIT(RTC->IER, flag)) && (READ_BIT(RTC->ISR, flag)))
return SET;
return RESET;
@@ -8,6 +8,10 @@
* @version V1.0
* @date 25 Apr 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 25 Apr 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,11 +28,10 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
********************************************************************************
**********************************************************************************
*/
#include "ald_rtchw.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
* @{
@@ -14,6 +14,9 @@
* @date 13 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 13 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -30,8 +33,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
@verbatim
==============================================================================
##### How to use this driver #####
@@ -70,7 +72,7 @@
* @endverbatim
*/
#include "ald_spi.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
@@ -144,6 +146,7 @@ static void spi_dma_send_recv_cplt(void *arg);
*/
void ald_spi_reset(spi_handle_t *hperh)
{
SPI_DISABLE(hperh);
hperh->perh->CON1 = 0x0;
hperh->perh->CON2 = 0x0;
hperh->perh->CRCPOLY = 0x00000007;
@@ -292,7 +295,7 @@ int32_t ald_spi_send_byte_fast(spi_handle_t *hperh, uint8_t data)
int32_t ald_spi_send_byte_fast_1line(spi_handle_t *hperh, uint8_t data)
{
uint16_t cnt = 5000;
while(hperh->perh->STAT & SPI_STAT_TXF_MSK);
hperh->perh->DATA = data;
while (((hperh->perh->STAT & SPI_STAT_TXE_MSK) == 0) && (--cnt));
@@ -979,6 +982,23 @@ ald_status_t ald_spi_send_recv_by_it(spi_handle_t *hperh, uint8_t *tx_buf, uint8
if (tx_buf == NULL || rx_buf == NULL || size == 0)
return ERROR;
if (hperh->init.mode == SPI_MODE_SLAVER) {
if ((spi_get_status(hperh, SPI_STATUS_TXE) == RESET) || (spi_get_status(hperh, SPI_STATUS_RXE) == RESET)) {
if (hperh->perh == SPI0)
ald_rmu_reset_periperal(RMU_PERH_SPI0);
else if (hperh->perh == SPI1)
ald_rmu_reset_periperal(RMU_PERH_SPI1);
else if (hperh->perh == SPI2)
ald_rmu_reset_periperal(RMU_PERH_SPI2);
else
return ERROR;
ald_spi_reset(hperh);
ald_spi_init(hperh);
}
}
__LOCK(hperh);
hperh->state = SPI_STATE_BUSY_TX_RX;
hperh->err_code = SPI_ERROR_NONE;
@@ -8,6 +8,9 @@
* @date 25 Dec 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 25 Dec 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,10 +27,9 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#include "ald_sram.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
* @{
@@ -9,6 +9,9 @@
* @date 06 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 06 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -25,13 +28,11 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#include <string.h>
#include "ald_timer.h"
#include "ald_cmu.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
@@ -8,6 +8,9 @@
* @date 26 Jun 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 26 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,11 +27,10 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#include "ald_trng.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
@@ -8,6 +8,9 @@
* @date 26 Jun 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 26 Jun 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,12 +27,10 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#include "ald_tsense.h"
#include "ald_bkpc.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
@@ -14,6 +14,9 @@
* @date 21 Nov 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 21 Nov 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -30,8 +33,7 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
* @verbatim
==============================================================================
##### How to use this driver #####
@@ -100,8 +102,7 @@
******************************************************************************
*/
#include "ald_uart.h"
#include "ald_cmu.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
@@ -541,7 +542,6 @@ ald_status_t ald_uart_send(uart_handle_t *hperh, uint8_t *buf, uint16_t size, ui
hperh->state = UART_STATE_READY;
return TIMEOUT;
}
while(hperh->perh->STAT & (0x1 << 17));
hperh->perh->TXBUF = (*buf++ & 0xFF);
hperh->tx_count++;
@@ -669,7 +669,6 @@ ald_status_t ald_uart_send_n_lock(uart_handle_t *hperh, uint8_t *buf, uint16_t s
hperh->state = UART_STATE_READY;
return TIMEOUT;
}
while(hperh->perh->STAT & (0x1 << 17));
hperh->perh->TXBUF = (*buf++ & 0xFF);
hperh->tx_count++;
@@ -1376,7 +1375,6 @@ ald_status_t ald_uart_rs485_send_addr(uart_handle_t *hperh, uint16_t addr, uint3
hperh->state = UART_STATE_READY;
return TIMEOUT;
}
while(hperh->perh->STAT & (0x1 << 17));
WRITE_REG(hperh->perh->TXBUF, (addr | 0x100));
@@ -8,6 +8,9 @@
* @date 25 Dec 2019
* @author AE Team
* @note
* Change Logs:
* Date Author Notes
* 25 Dec 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
@@ -24,12 +27,10 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#include "ald_usb.h"
#include "ald_syscfg.h"
#include "ald_conf.h"
/** @addtogroup ES32FXXX_ALD
* @{
@@ -7,29 +7,29 @@
* @version V1.0
* @date 18 Dec 2019
* @author AE Team
* @note
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
* @note
* Change Logs:
* Date Author Notes
* 18 Dec 2019 AE Team The first version
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**********************************************************************************
*/
#include "ald_conf.h"
#include "ald_wdt.h"
/** @addtogroup ES32FXXX_ALD
* @{
@@ -130,7 +130,7 @@ void ald_wwdt_feed_dog(void)
WRITE_REG(WWDT->INTCLR, 0x1);
WWDT_LOCK();
for (i = 0; i < 0x2ff; ++i)
__nop();
__NOP();
return;
}
@@ -28,16 +28,11 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*********************************************************************************
**********************************************************************************
*/
#include <string.h>
#include "utils.h"
#include "ald_dma.h"
#include "ald_cmu.h"
#include "ald_iap.h"
#include "ald_conf.h"
/** @defgroup ES32FXXX_ALD EASTSOFT ES32F3xx ALD
* @brief Shanghai Eastsoft Microelectronics Cortex-M Chip Abstraction Layer Driver(ALD)
@@ -253,9 +248,9 @@ __weak uint32_t ald_get_tick(void)
{
return lib_tick;
}
/**
* @brief This function provides accurate delay (in milliseconds) based
* @brief This function provides accurate delay (in microseconds) based
* on variable incremented.
* @note In the default implementation, SysTick timer is the source of time base.
* It is used to generate interrupts at regular time intervals where lib_tick
+1 -1
View File
@@ -12,7 +12,7 @@ src += Glob('ES32F36xx_ALD_StdPeriph_Driver/Source/*.c')
#add for startup script
if rtconfig.CROSS_TOOL == 'gcc':
src = src + ['CMSIS/Device/EastSoft/ES32F36xx/Startup/gcc/startup_es32f36xx.s']
src = src + ['CMSIS/Device/EastSoft/ES32F36xx/Startup/gcc/startup_es32f36xx.S']
elif rtconfig.CROSS_TOOL == 'keil':
src = src + ['CMSIS/Device/EastSoft/ES32F36xx/Startup/keil/startup_es32f36xx.s']
elif rtconfig.CROSS_TOOL == 'iar':