Bosch XDK110 Getting Started page 19

Cross-domain development kit
Hide thumbs Also See for XDK110:
Table of Contents

Advertisement

Extension Bus Advanced Guide | XDK110
First, we connect to the GPIO pin PD8 on the Extension Bus with the function
that, configuration to that pin is applied via the function
Afterwards, the pin is enabled by using the function
Now the pin can be used as chip select line to enable the data transmission between the master and slave.
For that, two functions are implemented to set the chip select level to high and low. The Codes 21 and 22 show an outline
of the corresponding implementations.
Code 21. Example CS low function
void
SpiSetCSLow(void){
BSP_ExtensionPort_ClearGpio(BSP_EXTENSIONPORT_GPIO_PD8);
}
The function from Code 21 is simply structured and only wraps the function call
functions body. The function
PD8 to active low.
Code 22. Example CS high function
void
SpiSetCSHigh(void){
BSP_ExtensionPort_SetGpio(BSP_EXTENSIONPORT_GPIO_PD8);
}
However, the function from Code 22 simply wraps the function call of
the voltage level on the GPIO pin PD8 is set to high.
Both functions from Code 21 and 22 will be used in the upcoming two sections to transmit and receive data via the SPI
module.

BSP_ExtensionPort_EnableGpio()
BSP_ExtensionPort_ClearGpio()
BSP_ExtensionPort_ConnectGpio()
BSP_ExtensionPort_SetGpioConfig()
BSP_ExtensionPort_ClearGpio()
on the other hand sets the voltage level on the GPIO pin
BSP_ExtensionPort_SetGpio()
to act as pushpull output.
.
, which ensures that
19 24
|
. After
into the

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents