Mistake on this page?
Report an issue in GitHub or email us
rda5981_flash.h
1 /* Copyright (c) 2019 Unisoc Communications Inc.
2  * SPDX-License-Identifier: Apache-2.0
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef _RDA5981_FLASH_H_
18 #define _RDA5981_FLASH_H_
19 
20 #include "wland_types.h"
21 
22 /** This struct contains tx power parameter. */
23 typedef struct
24 {
25  u8 b[14];
26  u8 g[14];
27  u8 n[14];
28  u8 sum;
29  u8 padding1;//alignment
31 
32 /*
33  *function: store reg and corresponding value related to test mode
34  *@valid: 1 means data is valid
35  *@flag: if biti(i=0~7) == 1, it means reg_val[i] is in use
36  *@reg_val: store reg and value, reg_val[i][0] is reg, reg_val[i][1] ~ reg_val[i][14] is value
37  */
38 typedef struct {
39  u32 valid;
40  u32 flag;
41  u16 reg_val[8][2];
42 } wland_rf_t;
43 
44 typedef struct {
45  u32 valid;
46  u32 flag;
47  u16 reg_val[8][15];
49 
50 typedef struct {
51  u32 valid;
52  u32 flag;
53  u32 reg_val[8][2];
54 } wland_phy_t;
55 
56 typedef struct {
57  u32 valid;
58  u32 flag;
59  u32 reg_val[8][15];
61 
62 /* if you add or delete any macros below, modify RDA5991H_USER_DATA_FLAG_UNINITIALIZED at the same time */
63 #define RDA5991H_USER_DATA_FLAG_MAC BIT0
64 #define RDA5991H_USER_DATA_FLAG_STA BIT1
65 #define RDA5991H_USER_DATA_FLAG_PMK BIT2
66 #define RDA5991H_USER_DATA_FLAG_IP BIT3
67 #define RDA5991H_USER_DATA_FLAG_PARTER_DATA_LEN BIT4
68 #define RDA5991H_USER_DATA_FLAG_TX_POWER BIT5
69 #define RDA5991H_USER_DATA_FLAG_XTAL_CAL BIT6
70 #define RDA5991H_USER_DATA_FLAG_TX_POWER_RF BIT7
71 #define RDA5991H_USER_DATA_FLAG_TX_POWER_PHY_GN BIT8
72 #define RDA5991H_USER_DATA_FLAG_TX_POWER_PHY_B BIT9
73 #define RDA5991H_USER_DATA_FLAG_AP BIT10
74 #define RDA5991H_USER_DATA_FLAG_APNET BIT11
75 #define RDA5991H_USER_DATA_FLAG_DHCP BIT12
76 #define RDA5991H_USER_DATA_FLAG_UART BIT13
77 #define RDA5991H_USER_DATA_FLAG_RF BIT14
78 #define RDA5991H_USER_DATA_FLAG_RF_CHANNELS BIT15
79 #define RDA5991H_USER_DATA_FLAG_PHY BIT16
80 #define RDA5991H_USER_DATA_FLAG_PHY_CHANNELS BIT17
81 #define RDA5991H_USER_DATA_FLAG_TX_POWER_OFFSET BIT18
82 
83 #define RDA5981_VBAT_CAL BIT0
84 #define RDA5981_GPADC0_CAL BIT1
85 #define RDA5981_GPADC1_CAL BIT2
86 #define RDA5981_PRODUCT_ID BIT3
87 #define RDA5981_POWER_CLASS BIT4
88 
89 #ifdef __cplusplus
90 extern "C" {
91 #endif
92 
93 /*
94  * function: read VBAT Calibration value
95  * y = k * x + b
96  * @k: slope
97  * @b: offset
98  * return: 0:success, else:fail
99  */
100 int rda5981_flash_read_vbat_cal(float *k, float *b);
101 
102 #ifdef __cplusplus
103 }
104 #endif
105 #endif
This struct contains tx power parameter.
Definition: rda5981_flash.h:23
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.