   1                     ; C Compiler for STM8 (COSMIC Software)
   2                     ; Parser V4.8.32 - 23 Mar 2010
   3                     ; Generator V4.3.4 - 23 Mar 2010
  57                     ; 12 INT8U SPI_ExchangeByte( INT8U input )
  57                     ; 13 {
  59                     	switch	.text
  60  0000               _SPI_ExchangeByte:
  62  0000 88            	push	a
  63       00000000      OFST:	set	0
  66  0001               L13:
  67                     ; 15 	while (SPI_GetFlagStatus(SPI_FLAG_TXE) == RESET);
  69  0001 a602          	ld	a,#2
  70  0003 cd0000        	call	_SPI_GetFlagStatus
  72  0006 4d            	tnz	a
  73  0007 27f8          	jreq	L13
  74                     ; 16 	SPI_SendData( input );
  76  0009 7b01          	ld	a,(OFST+1,sp)
  77  000b cd0000        	call	_SPI_SendData
  80  000e               L73:
  81                     ; 18 	while (SPI_GetFlagStatus(SPI_FLAG_RXNE) == RESET);
  83  000e a601          	ld	a,#1
  84  0010 cd0000        	call	_SPI_GetFlagStatus
  86  0013 4d            	tnz	a
  87  0014 27f8          	jreq	L73
  88                     ; 19 	return SPI_ReceiveData( );
  90  0016 cd0000        	call	_SPI_ReceiveData
  94  0019 5b01          	addw	sp,#1
  95  001b 81            	ret
 123                     ; 29 void SPI_Initial( void )
 123                     ; 30 {
 124                     	switch	.text
 125  001c               _SPI_Initial:
 129                     ; 32 	CLK_PeripheralClockConfig(CLK_Peripheral_SPI, ENABLE);
 131  001c ae0001        	ldw	x,#1
 132  001f a610          	ld	a,#16
 133  0021 95            	ld	xh,a
 134  0022 cd0000        	call	_CLK_PeripheralClockConfig
 136                     ; 34 	SPI_DeInit( );
 138  0025 cd0000        	call	_SPI_DeInit
 140                     ; 36 	SPI_Init( SPI_FirstBit_MSB, SPI_BaudRatePrescaler_2,
 140                     ; 37             SPI_Mode_Master, SPI_CPOL_Low, SPI_CPHA_1Edge,
 140                     ; 38             SPI_Direction_2Lines_FullDuplex, SPI_NSS_Soft );
 142  0028 4b02          	push	#2
 143  002a 4b00          	push	#0
 144  002c 4b00          	push	#0
 145  002e 4b00          	push	#0
 146  0030 4b04          	push	#4
 147  0032 5f            	clrw	x
 148  0033 4f            	clr	a
 149  0034 95            	ld	xh,a
 150  0035 cd0000        	call	_SPI_Init
 152  0038 5b05          	addw	sp,#5
 153                     ; 40 	SPI_Cmd( ENABLE );
 155  003a a601          	ld	a,#1
 156  003c cd0000        	call	_SPI_Cmd
 158                     ; 42 	GPIO_Init( GPIOB, GPIO_Pin_7,GPIO_Mode_In_PU_No_IT );
 160  003f 4b40          	push	#64
 161  0041 4b80          	push	#128
 162  0043 ae5005        	ldw	x,#20485
 163  0046 cd0000        	call	_GPIO_Init
 165  0049 85            	popw	x
 166                     ; 43 	GPIO_Init( GPIOB, GPIO_Pin_5 | GPIO_Pin_6, GPIO_Mode_Out_PP_High_Slow );
 168  004a 4bd0          	push	#208
 169  004c 4b60          	push	#96
 170  004e ae5005        	ldw	x,#20485
 171  0051 cd0000        	call	_GPIO_Init
 173  0054 85            	popw	x
 174                     ; 44 }
 177  0055 81            	ret
 202                     ; 53 void GPIO_Initial( void )
 202                     ; 54 {
 203                     	switch	.text
 204  0056               _GPIO_Initial:
 208                     ; 56     GPIO_Init( GPIOB, GPIO_Pin_4, GPIO_Mode_Out_PP_High_Slow );
 210  0056 4bd0          	push	#208
 211  0058 4b10          	push	#16
 212  005a ae5005        	ldw	x,#20485
 213  005d cd0000        	call	_GPIO_Init
 215  0060 85            	popw	x
 216                     ; 57     GPIO_SetBits( GPIOB, GPIO_Pin_4 );
 218  0061 4b10          	push	#16
 219  0063 ae5005        	ldw	x,#20485
 220  0066 cd0000        	call	_GPIO_SetBits
 222  0069 84            	pop	a
 223                     ; 60 		GPIO_Init( GPIOC, GPIO_Pin_2|GPIO_Pin_3, GPIO_Mode_Out_PP_High_Slow );
 225  006a 4bd0          	push	#208
 226  006c 4b0c          	push	#12
 227  006e ae500a        	ldw	x,#20490
 228  0071 cd0000        	call	_GPIO_Init
 230  0074 85            	popw	x
 231                     ; 61     GPIO_SetBits( GPIOC, GPIO_Pin_2|GPIO_Pin_3 );
 233  0075 4b0c          	push	#12
 234  0077 ae500a        	ldw	x,#20490
 235  007a cd0000        	call	_GPIO_SetBits
 237  007d 84            	pop	a
 238                     ; 79 	GPIO_Init( GPIOC, GPIO_Pin_0, GPIO_Mode_In_PU_No_IT );
 240  007e 4b40          	push	#64
 241  0080 4b01          	push	#1
 242  0082 ae500a        	ldw	x,#20490
 243  0085 cd0000        	call	_GPIO_Init
 245  0088 85            	popw	x
 246                     ; 80 	GPIO_Init( GPIOB, GPIO_Pin_3, GPIO_Mode_In_PU_No_IT );
 248  0089 4b40          	push	#64
 249  008b 4b08          	push	#8
 250  008d ae5005        	ldw	x,#20485
 251  0090 cd0000        	call	_GPIO_Init
 253  0093 85            	popw	x
 254                     ; 83 	GPIO_Init( GPIOB, GPIO_Pin_0 | GPIO_Pin_1,GPIO_Mode_Out_OD_Low_Fast );
 256  0094 4ba0          	push	#160
 257  0096 4b03          	push	#3
 258  0098 ae5005        	ldw	x,#20485
 259  009b cd0000        	call	_GPIO_Init
 261  009e 85            	popw	x
 262                     ; 85 }
 265  009f 81            	ret
 278                     	xdef	_GPIO_Initial
 279                     	xdef	_SPI_Initial
 280                     	xdef	_SPI_ExchangeByte
 281                     	xref	_SPI_GetFlagStatus
 282                     	xref	_SPI_ReceiveData
 283                     	xref	_SPI_SendData
 284                     	xref	_SPI_Cmd
 285                     	xref	_SPI_Init
 286                     	xref	_SPI_DeInit
 287                     	xref	_GPIO_SetBits
 288                     	xref	_GPIO_Init
 289                     	xref	_CLK_PeripheralClockConfig
 308                     	end
