136 lines
3.0 KiB
C
136 lines
3.0 KiB
C
|
/************************************************************************************************/
|
|||
|
/**
|
|||
|
* @file ciu32l051_std_common.h
|
|||
|
* @author MCU Ecosystem Development Team
|
|||
|
* @brief STD<EFBFBD><EFBFBD>ͨ<EFBFBD>õ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD>塣
|
|||
|
*
|
|||
|
*
|
|||
|
**************************************************************************************************
|
|||
|
* @attention
|
|||
|
* Copyright (c) CEC Huada Electronic Design Co.,Ltd. All rights reserved.
|
|||
|
*
|
|||
|
**************************************************************************************************
|
|||
|
*/
|
|||
|
|
|||
|
/* <20><><EFBFBD><EFBFBD>ͷ<EFBFBD>ļ<EFBFBD><C4BC>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
#ifndef CIU32L051_STD_COMMON_H
|
|||
|
#define CIU32L051_STD_COMMON_H
|
|||
|
|
|||
|
/************************************************************************************************/
|
|||
|
/**
|
|||
|
* @addtogroup CIU32L051_STD_Driver
|
|||
|
* @{
|
|||
|
*/
|
|||
|
|
|||
|
/**
|
|||
|
* @addtogroup STD
|
|||
|
* @{
|
|||
|
*
|
|||
|
*/
|
|||
|
/************************************************************************************************/
|
|||
|
|
|||
|
|
|||
|
#ifdef __cplusplus
|
|||
|
extern "C" {
|
|||
|
#endif
|
|||
|
|
|||
|
|
|||
|
|
|||
|
/*-----------------------------------------type define------------------------------------------*/
|
|||
|
|
|||
|
/************************************************************************************************/
|
|||
|
/**
|
|||
|
* @defgroup STD_Types STD Types
|
|||
|
* @brief STD<EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͷ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @{
|
|||
|
*
|
|||
|
*/
|
|||
|
/************************************************************************************************/
|
|||
|
/**
|
|||
|
* @brief bitλ״̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
typedef enum
|
|||
|
{
|
|||
|
RESET = 0,
|
|||
|
SET = !RESET
|
|||
|
}bit_status_t;
|
|||
|
|
|||
|
|
|||
|
/**
|
|||
|
* @brief STD<EFBFBD><EFBFBD>API<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD>Ͷ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
typedef enum
|
|||
|
{
|
|||
|
STD_OK = 0x00U,
|
|||
|
STD_ERR = 0x01U,
|
|||
|
STD_ERR_PARAM = 0x02U,
|
|||
|
STD_ERR_BUSY = 0x03U,
|
|||
|
STD_ERR_TIMEOUT = 0x04U
|
|||
|
} std_status_t;
|
|||
|
|
|||
|
|
|||
|
/**
|
|||
|
* @}
|
|||
|
*/
|
|||
|
|
|||
|
|
|||
|
/*--------------------------------------------define--------------------------------------------*/
|
|||
|
|
|||
|
/************************************************************************************************/
|
|||
|
/**
|
|||
|
* @addtogroup STD_Constants
|
|||
|
* @{
|
|||
|
*
|
|||
|
*/
|
|||
|
/************************************************************************************************/
|
|||
|
|
|||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뾯<EFBFBD><EBBEAF> */
|
|||
|
#define UNUSED(X) (void)X
|
|||
|
|
|||
|
|
|||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>컯<EFBFBD><ECBBAF><EFBFBD><EFBFBD> */
|
|||
|
#if defined ( __GNUC__ )
|
|||
|
#ifndef __weak
|
|||
|
#define __weak __attribute__((weak))
|
|||
|
#endif /* __weak */
|
|||
|
|
|||
|
#ifndef __packed
|
|||
|
#define __packed __attribute__((__packed__))
|
|||
|
#endif /* __packed */
|
|||
|
#endif /* __GNUC__ */
|
|||
|
|
|||
|
|
|||
|
/* bit operations */
|
|||
|
#define MODIFY_REG(REG, CLEARMASK, SETMASK) ((REG) = (((REG) & (~(CLEARMASK))) | (SETMASK)))
|
|||
|
|
|||
|
/**
|
|||
|
* @}
|
|||
|
*/
|
|||
|
|
|||
|
|
|||
|
/*------------------------------------------includes--------------------------------------------*/
|
|||
|
#include <stddef.h>
|
|||
|
#include <stdbool.h>
|
|||
|
#include "ciu32l051.h"
|
|||
|
#include "ciu32l051_std.h"
|
|||
|
|
|||
|
|
|||
|
/*-------------------------------------------functions------------------------------------------*/
|
|||
|
|
|||
|
|
|||
|
#ifdef __cplusplus
|
|||
|
}
|
|||
|
#endif
|
|||
|
|
|||
|
|
|||
|
/**
|
|||
|
* @}
|
|||
|
*/
|
|||
|
|
|||
|
/**
|
|||
|
* @}
|
|||
|
*/
|
|||
|
|
|||
|
|
|||
|
#endif /* CIU32L051_STD_COMMON_H */
|