Subversion Repositories pentevo

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1186 savelij 1
		ifndef	__pxsinc	; avoid multiple inclusion
2
__pxsinc	equ	1
3
 
4
		save
5
		listing	off		; no listing over this file
6
 
7
;****************************************************************************
8
;*                                                                          *
9
;*   AS 1.42 - File PXS.INC                                                 *
10
;*                                                                          *
11
;*   contains SFR and Bit Definitions for STM8T ProxSense                   *
12
;*                                                                          *
13
;*   Source: RM0312 (DocID022352 Rev 3)                                     *
14
;*                                                                          *
15
;****************************************************************************
16
 
17
__defpxs	macro	Base
18
PXS_CR1		label	Base+$00		; ProxSense control register 1
19
PXS_PXSEN	bit	PXS_CR1,7		;  ProxSense enable
20
PXS_START	bit	PXS_CR1,6		;  Start conversion
21
PXS_LOW_POWER	bit	PXS_CR1,5		;  Low power mode
22
PXS_CR2		label	Base+$01		; ProxSense control register 2
23
PXS_EOCITEN	bit	PXS_CR2,7		;  End of conversion interrupt enable
24
PXS_FCCITEN	bit	PXS_CR2,6		;  First conversion completion interrupt enable
25
PXS_NOISEDETEN	bit	PXS_CR2,5		;  Noise detection enable
26
PXS_RXGROUP	bit	PXS_CR2,3		;  Rx group selection
27
PXS_RXCOUPLING	bit	PXS_CR2,2		;  Reduce coupling between receiver lines
28
PXS_SYNCEN	bit	PXS_CR2,1		;  Enable synchronization (SYNC) feature
29
PXS_SYNCEDGE	bit	PXS_CR2,0		;  Synchronization edge selection
30
PXS_CR3		label	Base+$02		; ProxSense control register 3
31
PXS_STAB	bfield	PXS_CR3,6,2		;  Selection for stabilization time after ProxSense power-on
32
PXS_BIAS	bfield	PXS_CR3,4,2		;  Sample and hold strength selection
33
PXS_VTHR	bfield	PXS_CR3,0,4		;  Threshold voltage (VTHR) selection
34
PXS_ISR		label	Base+$04		; ProxSense interrupt and status register
35
PXS_EOCF	bit	PXS_ISR,7		;  End of conversion flag
36
PXS_FCCF	bit	PXS_ISR,6		;  First conversion completion flag
37
PXS_NOISEDETF	bit	PXS_ISR,5		;  Noise detection flag
38
PXS_CIPF	bit	PXS_ISR,4		;  Conversion in progress flag
39
PXS_SYNCPF	bit	PXS_ISR,3		;  Synchronization (SYNC) pending flag
40
PXS_SYNC_OVRF	bit	PXS_ISR,2		;  Synchronization (SYNC) overflow flag
41
PXS_CKCR1	label	Base+$06		; ProxSense clock control register 1
42
PXS_PRESC	bfield	PXS_CKCR1,4,3		;  Frequency selection for ProxSense clock
43
PXS_ANADEAD	bit	PXS_CKCR1,1		;  Ensures the deadtime (non-overlap interval) between the UP and PASS phases using a short analog delay rather than a half-cycle deadtime
44
PXS_INCPHASE	bit	PXS_CKCR1,0		;  Increases the length of each of the UP and PASS phases by one half of a clock cycle
45
PXS_CKCR2	label	Base+$07		; ProxSense clock control register 2
46
UPLEN		bfield	PXS_CKCR2,4,3		;  Length of UP phase
47
PASSLEN		bfield	PXS_CKCR2,0,3		;  Length of PASS phase
48
PXS_RXENRH	label	Base+$08		; ProxSense receiver enable register high
49
PXS_RXEN9	bit	PXS_RXENRH,1		;  Enable receiver channel 9
50
PXS_RXEN8	bit	PXS_RXENRH,0		;  Enable receiver channel 8
51
PXS_RXENRL	label	Base+$09		; ProxSense receiver enable register low
52
PXS_RXEN7	bit	PXS_RXENRL,7		;  Enable receiver channel 7
53
PXS_RXEN6	bit	PXS_RXENRL,6		;  Enable receiver channel 6
54
PXS_RXEN5	bit	PXS_RXENRL,5		;  Enable receiver channel 5
55
PXS_RXEN4	bit	PXS_RXENRL,4		;  Enable receiver channel 4
56
PXS_RXEN3	bit	PXS_RXENRL,3		;  Enable receiver channel 3
57
PXS_RXEN2	bit	PXS_RXENRL,2		;  Enable receiver channel 2
58
PXS_RXEN1	bit	PXS_RXENRL,1		;  Enable receiver channel 1
59
PXS_RXEN0	bit	PXS_RXENRL,0		;  Enable receiver channel 0
60
__N		set	0
61
		rept	3
62
		__decstr __NS,__N+1
63
PXS_RXCR{__NS}H	label	Base+$0a+(__N*2)	; ProxSense receiver control register n high
64
PXS_RXCR{__NS}_9 bit	PXS_RXCR{__NS}H,1	; ProxSense receiver channel 9 control bit n
65
PXS_RXCR{__NS}_8 bit	PXS_RXCR{__NS}H,0	; ProxSense receiver channel 8 control bit n
66
PXS_RXCR{__NS}L	label	Base+$0b+(__N*2)	; ProxSense receiver control register n low
67
PXS_RXCR{__NS}_7 bit	PXS_RXCR{__NS}L,7	; ProxSense receiver channel 7 control bit n
68
PXS_RXCR{__NS}_6 bit	PXS_RXCR{__NS}L,6	; ProxSense receiver channel 6 control bit n
69
PXS_RXCR{__NS}_5 bit	PXS_RXCR{__NS}L,5	; ProxSense receiver channel 5 control bit n
70
PXS_RXCR{__NS}_4 bit	PXS_RXCR{__NS}L,4	; ProxSense receiver channel 4 control bit n
71
PXS_RXCR{__NS}_3 bit	PXS_RXCR{__NS}L,3	; ProxSense receiver channel 3 control bit n
72
PXS_RXCR{__NS}_2 bit	PXS_RXCR{__NS}L,2	; ProxSense receiver channel 2 control bit n
73
PXS_RXCR{__NS}_1 bit	PXS_RXCR{__NS}L,1	; ProxSense receiver channel 1 control bit n
74
PXS_RXCR{__NS}_0 bit	PXS_RXCR{__NS}L,0	; ProxSense receiver channel 0 control bit n
75
__N		set	__N+1
76
		endm
77
PXS_RXINSRH	label	Base+$12		; ProxSense receiver inactive state register high
78
PXS_RXINS9	bit	PXS_RXINSRH,1		;  Receiver channel 9 inactive state selection
79
PXS_RXINS8	bit	PXS_RXINSRH,0		;  Receiver channel 8 inactive state selection
80
PXS_RXINSRL	label	Base+$13		; ProxSense receiver inactive state register low
81
PXS_RXINS7	bit	PXS_RXINSRL,7		;  Receiver channel 7 inactive state selection
82
PXS_RXINS6	bit	PXS_RXINSRL,6		;  Receiver channel 6 inactive state selection
83
PXS_RXINS5	bit	PXS_RXINSRL,5		;  Receiver channel 5 inactive state selection
84
PXS_RXINS4	bit	PXS_RXINSRL,4		;  Receiver channel 4 inactive state selection
85
PXS_RXINS3	bit	PXS_RXINSRL,3		;  Receiver channel 3 inactive state selection
86
PXS_RXINS2	bit	PXS_RXINSRL,2		;  Receiver channel 2 inactive state selection
87
PXS_RXINS1	bit	PXS_RXINSRL,1		;  Receiver channel 1 inactive state selection
88
PXS_RXINS0	bit	PXS_RXINSRL,0		;  Receiver channel 0 inactive state selection
89
PXS_TXENRH	label	Base+$16		; ProxSense transmit enable register high
90
PXS_TXEN15	bit	PXS_TXENRH,7		;  Transmit output 15 function enable
91
PXS_TXEN14	bit	PXS_TXENRH,6		;  Transmit output 14 function enable
92
PXS_TXEN13	bit	PXS_TXENRH,5		;  Transmit output 13 function enable
93
PXS_TXEN12	bit	PXS_TXENRH,4		;  Transmit output 12 function enable
94
PXS_TXEN11	bit	PXS_TXENRH,3		;  Transmit output 11 function enable
95
PXS_TXEN10	bit	PXS_TXENRH,2		;  Transmit output 10 function enable
96
PXS_TXEN9	bit	PXS_TXENRH,1		;  Transmit output 9 function enable
97
PXS_TXEN8	bit	PXS_TXENRH,0		;  Transmit output 8 function enable
98
PXS_TXENRL	label	Base+$17		; ProxSense transmit enable register low
99
PXS_TXEN7	bit	PXS_TXENRH,7		;  Transmit output 7 function enable
100
PXS_TXEN6	bit	PXS_TXENRH,6		;  Transmit output 6 function enable
101
PXS_TXEN5	bit	PXS_TXENRH,5		;  Transmit output 5 function enable
102
PXS_TXEN4	bit	PXS_TXENRH,4		;  Transmit output 4 function enable
103
PXS_TXEN3	bit	PXS_TXENRH,3		;  Transmit output 3 function enable
104
PXS_TXEN2	bit	PXS_TXENRH,2		;  Transmit output 2 function enable
105
PXS_TXEN1	bit	PXS_TXENRH,1		;  Transmit output 1 function enable
106
PXS_TXEN0	bit	PXS_TXENRH,0		;  Transmit output 0 function enable
107
PXS_MAXRH	label	Base+$1a		; ProxSense maximum counter value register high
108
PXS_MAXRL	label	Base+$1b		; ProxSense maximum counter value register low
109
PXS_MAXENRH	label	Base+$1c		; ProxSense maximum counter enable register high
110
PXS_MAXEN9	bit	PXS_MAXENRH,1		;  Enabled maximum counter limit for Receive channel 9
111
PXS_MAXEN8	bit	PXS_MAXENRH,0		;  Enabled maximum counter limit for Receive channel 8
112
PXS_MAXENRL	label	Base+$1d		; ProxSense maximum counter enable register low
113
PXS_MAXEN7	bit	PXS_MAXENRL,7		;  Enabled maximum counter limit for Receive channel 7
114
PXS_MAXEN6	bit	PXS_MAXENRL,6		;  Enabled maximum counter limit for Receive channel 6
115
PXS_MAXEN5	bit	PXS_MAXENRL,5		;  Enabled maximum counter limit for Receive channel 5
116
PXS_MAXEN4	bit	PXS_MAXENRL,4		;  Enabled maximum counter limit for Receive channel 4
117
PXS_MAXEN3	bit	PXS_MAXENRL,3		;  Enabled maximum counter limit for Receive channel 3
118
PXS_MAXEN2	bit	PXS_MAXENRL,2		;  Enabled maximum counter limit for Receive channel 2
119
PXS_MAXEN1	bit	PXS_MAXENRL,1		;  Enabled maximum counter limit for Receive channel 1
120
PXS_MAXEN0	bit	PXS_MAXENRL,0		;  Enabled maximum counter limit for Receive channel 0
121
PXS_RXSRH	label	Base+$1e		; ProxSense receiver status register high
122
PXS_VALID9	bit	PXS_RXSRH,1		;  Valid bit for conversion data for receiver channel 9 is valid
123
PXS_VALID8	bit	PXS_RXSRH,0		;  Valid bit for conversion data for receiver channel 8 is valid
124
PXS_RXSRL	label	Base+$1f		; ProxSense receiver status register low
125
PXS_VALID7	bit	PXS_RXSRL,7		;  Valid bit for conversion data for receiver channel 7 is valid
126
PXS_VALID6	bit	PXS_RXSRL,6		;  Valid bit for conversion data for receiver channel 6 is valid
127
PXS_VALID5	bit	PXS_RXSRL,5		;  Valid bit for conversion data for receiver channel 5 is valid
128
PXS_VALID4	bit	PXS_RXSRL,4		;  Valid bit for conversion data for receiver channel 4 is valid
129
PXS_VALID3	bit	PXS_RXSRL,3		;  Valid bit for conversion data for receiver channel 3 is valid
130
PXS_VALID2	bit	PXS_RXSRL,2		;  Valid bit for conversion data for receiver channel 2 is valid
131
PXS_VALID1	bit	PXS_RXSRL,1		;  Valid bit for conversion data for receiver channel 1 is valid
132
PXS_VALID0	bit	PXS_RXSRL,0		;  Valid bit for conversion data for receiver channel 0 is valid
133
__N		set	0
134
		rept	10
135
		__decstr __NS,__N
136
PXS_RX{__NS}CNTRH	label	Base+$20+(__N*2)	; ProxSense counter register receiver channel n high
137
PXS_RX{__NS}CNTRL	label	Base+$21+(__N*2)	; ProxSense counter register receiver channel n low
138
PXS_RX{__NS}CSSELR	label	Base+$40+__N		; ProxSense receiver sampling capacitor selection register n
139
PXS_RX{__NS}EPCCSELR	label	Base+$50+__N		; ProxSense receiver electrode parasitic compensation capacitor selection register n
140
__N		set	__N+1
141
		endm
142
		endm
143
 
144
		restore
145
		endif			; __pxsinc