lpc.h
Go to the documentation of this file.
1 /********************************************************************************************************
2  * @file lpc.h
3  *
4  * @brief This is the source file for TLSR8258
5  *
6  * @author Driver Group
7  * @date May 8, 2018
8  *
9  * @par Copyright (c) 2018, Telink Semiconductor (Shanghai) Co., Ltd.
10  * All rights reserved.
11  *
12  * The information contained herein is confidential property of Telink
13  * Semiconductor (Shanghai) Co., Ltd. and is available under the terms
14  * of Commercial License Agreement between Telink Semiconductor (Shanghai)
15  * Co., Ltd. and the licensee or the terms described here-in. This heading
16  * MUST NOT be removed from this file.
17  *
18  * Licensees are granted free, non-transferable use of the information in this
19  * file under Mutual Non-Disclosure Agreement. NO WARRENTY of ANY KIND is provided.
20  * @par History:
21  * 1.initial release(DEC. 26 2018)
22  *
23  * @version A001
24  *
25  *******************************************************************************************************/
26 
27 #ifndef LPC_H_
28 #define LPC_H_
29 
30 #include "bsp.h"
31 #include "analog.h"
32 #include "gpio_8258.h"
33 
37 typedef enum{
41 
45 typedef enum{
55 
59 typedef enum{
60  //normal
67 
68  //low power
75  //
76  LPC_AVDD3 = 7,
78 
82 typedef enum{
88 
94 extern void lpc_power_down(void);
95 
101 extern void lpc_power_on(void);
102 
109 
117 
123 extern void lpc_set_scaling_coeff(LPC_Scaling_TypeDef divider);
124 
130 static inline unsigned char lpc_get_result(void)
131 {
132  return ((analog_read(0x88)&0x40)>>6);
133 }
134 #endif /* LPC_H_ */
135 
136 
137  //end of GP15
unsigned char analog_read(unsigned char addr)
This function serves to analog register read.
void lpc_set_input_chn(LPC_Input_Channel_TypeDef pin)
This function selects input channel for low power comparator .
Definition: lpc.h:66
Definition: lpc.h:83
Definition: lpc.h:74
void lpc_set_scaling_coeff(LPC_Scaling_TypeDef divider)
This function serves to set scaling_coefficient for low power comparator .
void lpc_power_down(void)
This function powers down low power comparator.
Definition: lpc.h:50
Definition: lpc.h:65
LPC_Input_Channel_TypeDef
Define the input channel for Low power comparator.
Definition: lpc.h:45
Definition: lpc.h:48
Definition: lpc.h:49
LPC_Mode_TypeDef
Define the mode for Low power comparator.
Definition: lpc.h:37
Definition: lpc.h:52
Definition: lpc.h:69
Definition: lpc.h:46
Definition: lpc.h:63
void lpc_power_on(void)
This function provides power for low power comparator.
Definition: lpc.h:73
Definition: lpc.h:62
LPC_Reference_TypeDef
Define the reference voltage for Low power comparator.
Definition: lpc.h:59
Definition: lpc.h:84
Definition: lpc.h:53
Definition: lpc.h:47
Definition: lpc.h:85
Definition: lpc.h:71
static unsigned char lpc_get_result(void)
This function serves to get the comparison results.
Definition: lpc.h:130
Definition: lpc.h:72
LPC_Scaling_TypeDef
Define the scaling coefficient for Low power comparator.
Definition: lpc.h:82
void lpc_set_input_ref(LPC_Mode_TypeDef, LPC_Reference_TypeDef ref)
This function selects input reference voltage for low power comparator .
Definition: lpc.h:39
Definition: lpc.h:76
Definition: lpc.h:51
Definition: lpc.h:64
Definition: lpc.h:86
Definition: lpc.h:70
Definition: lpc.h:61
Definition: lpc.h:38