tao_z
2022-05-31 41f087b7183a5730e46b7eaa322b6852d602babf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/**
  ******************************************************************************
  * @file     xl_clm.h
  * @author   software group
  * @brief    This file contains all the functions prototypes for the CLM
  *           firmware library.
  ******************************************************************************
  * @attention
    *
  * 2019 by Chipways Communications,Inc. All Rights Reserved.
  * This software is supplied under the terms of a license
  * agreement or non-disclosure agreement with Chipways.
  * Passing on and copying of this document,and communication
  * of its contents is not permitted without prior written
  * authorization.
  *
  * <h2><center>&copy; COPYRIGHT 2019 Chipways</center></h2>
  ******************************************************************************
  */
    
/* Define to prevent recursive inclusion -------------------------------------*/     
#ifndef __XL_CLM_H_
#define __XL_CLM_H_
 
#ifdef __cplusplus
extern "C" {
#endif
 
/* Includes ---------------------------------------------------------------*/
#include "XL6600.h"
    /* Register define ------------------------------------------------------------*/
#define CLM_CTRL_SCLK_SEL_MASK                       0x100u
#define CLM_CTRL_SCLK_SEL_SHIFT                      8
 
#define CLM_CTRL_CLMEN_MASK                       0xFFu
#define CLM_CTRL_CLMEN_SHIFT                      0
 
#define CLM_CLML_CLML_MASK                       0xFFFFu
#define CLM_CLML_CLML_SHIFT                      0
 
#define CLM_CLMH_CLMH_MASK                       0xFFFFu
#define CLM_CLMH_CLMH_SHIFT                      0
 
#define CLM_RSTF_RSTF_MASK                       0x1u
#define CLM_RSTF_RSTF_SHIFT                      0    
    
#define CLM_SCLK_LPO_CLK         0x00u
#define CLM_SCLK_IRC_CLK         0x01u
 
/** CLM - Register Layout Typedef */
typedef struct {
    __IO uint16_t        CTRL;                      /*!< ¿ØÖƼĴæÆ÷, offset:0x00*/
       uint16_t RESERVED_0;
    __IO uint16_t        CLML;                      /*!< ÆµÂÊÆ«ÒÆÏÂÏÞÉèÖüĴæÆ÷, offset:0x04*/
    uint16_t RESERVED_1;
       __IO uint16_t        CLMH;                 /*!< ÆµÂÊÆ«ÒÆÉÏÏÞÉèÖüĴæÆ÷, offset:0x08*/
       uint16_t RESERVED_2;
    __IO uint16_t        RSTF;                      /*!< ¸´Î»±êÖ¾¼Ä´æÆ÷, offset:0x0C*/
       uint16_t RESERVED_3;
} CLM_Type;    
    
extern CLM_Type* CLMA;
extern CLM_Type* CLMB;
 
/** @addtogroup XL6600_StdPeriph_Driver
  * @{
  */
 
/** @addtogroup CLM
  * @{
  */
 
/* Exported types ------------------------------------------------------------*/ 
 
/** 
  * @brief CLM³õʼ»¯½á¹¹Ì嶨Òå
  */
typedef struct
{
    uint16_t    CLM_SAMPLE_CLOCK;
    uint16_t     CLM_CLMH;  
    uint16_t     CLM_CLML;  
}CLM_InitTypeDef;
 
/* Exported constants --------------------------------------------------------*/  
 
/* Exported macro ------------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/ 
uint8_t CLM_Init(CLM_Type* CLMx, const CLM_InitTypeDef *CLM_InitStruct);
void CLM_EnableCmd(CLM_Type* CLMx);
void CLM_Set_CLML(CLM_Type* CLMx, uint16_t value);
void CLM_Set_CLMH(CLM_Type* CLMx, uint16_t value);
uint8_t CLM_GetResetFlag(const CLM_Type* CLMx);
#ifdef __cplusplus
}
#endif
 
#endif   
/**
    * @}
    */
    
/**
    * @}
    */