iLLD_TC27xD
1.0
SpiIf.c
Go to the documentation of this file.
1
/**
2
* \file SpiIf.c
3
* \brief SPI interface
4
*
5
* \version iLLD_1_0_0_11_0
6
* \copyright Copyright (c) 2013 Infineon Technologies AG. All rights reserved.
7
*
8
*
9
* IMPORTANT NOTICE
10
*
11
*
12
* Infineon Technologies AG (Infineon) is supplying this file for use
13
* exclusively with Infineon's microcontroller products. This file can be freely
14
* distributed within development tools that are supporting such microcontroller
15
* products.
16
*
17
* THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
18
* OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
19
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
20
* INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
21
* OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
22
*
23
*/
24
25
#include "
SpiIf.h
"
26
27
void
SpiIf_initConfig
(
SpiIf_Config
*config)
28
{
29
config->
mode
=
SpiIf_Mode_master
;
30
config->
rxPriority
= 0;
31
config->
txPriority
= 0;
32
config->
erPriority
= 0;
33
config->
isrProvider
=
IfxSrc_Tos_cpu0
;
34
config->
bufferSize
= 0;
35
config->
buffer
=
NULL_PTR
;
36
config->
maximumBaudrate
= 0;
37
}
38
39
40
void
SpiIf_initChannelConfig
(
SpiIf_ChConfig
*config,
SpiIf
*driver)
41
{
42
config->
driver
= driver;
43
config->
baudrate
= 0;
44
config->
mode
.
enabled
= 1;
45
config->
mode
.
autoCS
= 1;
46
config->
mode
.
loopback
= 0;
47
config->
mode
.
clockPolarity
=
SpiIf_ClockPolarity_idleLow
;
48
config->
mode
.
shiftClock
=
SpiIf_ShiftClock_shiftTransmitDataOnLeadingEdge
;
49
config->
mode
.
dataHeading
=
SpiIf_DataHeading_msbFirst
;
50
config->
mode
.
dataWidth
= 8;
51
config->
mode
.
csActiveLevel
=
Ifx_ActiveState_low
;
52
config->
mode
.
csLeadDelay
=
SpiIf_SlsoTiming_0
;
53
config->
mode
.
csTrailDelay
=
SpiIf_SlsoTiming_0
;
54
config->
mode
.
csInactiveDelay
=
SpiIf_SlsoTiming_0
;
55
config->
mode
.
parityCheck
= 0;
56
config->
mode
.
parityMode
=
Ifx_ParityMode_even
;
57
config->
errorChecks
.
baudrate
= 0;
58
config->
errorChecks
.
phase
= 0;
59
config->
errorChecks
.
receive
= 0;
60
config->
errorChecks
.
transmit
= 0;
61
}
home
mclld
Libraries
release
iLLD_1_0_0_11_0
src
ifx
SrvSw
If
SpiIf.c
Generated by
1.8.4