Bosch XDK110 Getting Started
Bosch XDK110 Getting Started

Bosch XDK110 Getting Started

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

Advertisement

XDK110: Getting Started Guide with Extension Bus
Cross-Domain Development Kit XDK110
Platform for Application Development
XDK110: Extension Bus Advanced Guide
Document revision
Document release date
Workbench version
Document number
Technical reference code(s)
Notes
1.0
11. May 2018
3.3.0 and above
BCDS-XDK110-GUIDE Extension Bus Advanced
Data in this document is subject to change without notice. Product
photos and pictures are for illustration purposes only and may differ from
the real product's appearance.
This document is confidential and under NDA inherent with the purchase
of an XDK110.
Advance information – Subject to change without notice

Advertisement

Table of Contents
loading

Summary of Contents for Bosch XDK110

  • Page 1 XDK110: Getting Started Guide with Extension Bus Cross-Domain Development Kit XDK110 Platform for Application Development XDK110: Extension Bus Advanced Guide Document revision Document release date 11. May 2018 Workbench version 3.3.0 and above Document number BCDS-XDK110-GUIDE Extension Bus Advanced Technical reference code(s) Notes Data in this document is subject to change without notice.
  • Page 2: Table Of Contents

    2 24 Extension Bus Advanced Guide | XDK110 XDK110 Platform for Application Development Table of contents 1. General Description 1.1 General Introduction ............................. 1.2 Connecting the Extension Bus ..........................1.3 MCU pins on the Extension Bus ........................... 2. Extension Bus Advanced API Overview 2.1 Preparation...
  • Page 3 3 24 Extension Bus Advanced Guide | XDK110 This guide postulates a basic understanding of the XDK and the according workspace. For new users we recommend going through the following guides at xdk.io/guides first: Workbench Installation Workbench First Steps XDK Guide FreeRTOS
...
  • Page 4: General Description

    4 24 Extension Bus Advanced Guide | XDK110 1. General Description 1.1 General Introduction The XDK comes with the ability to attach a 26 pin XDK gateway called extension bus to its own 26 pin connector. The extension bus allows over the 26 additional pins access to pin functionality of the XDKs MCU pins by attaching external devices such as sensors or actuators to it.
  • Page 5 5 24 Extension Bus Advanced Guide | XDK110 Additionally, please note that the pins of the extension bus are protected against electrostatic discharge (ESD) up to 4 kV. This includes a serial resistance of 40 Ohm into the signal path. Please note that this is no problem for communication, but it need to be considered when powering external components via GPIO, e.g.
  • Page 6: Extension Bus Advanced Api Overview

    6 24 Extension Bus Advanced Guide | XDK110 2. Extension Bus Advanced API Overview It is generally recommended to develop an application based on the highest API level the XDK framework supports, although it is possible to access deeper API levels if the highest level does not provide the functionality required for a specific purpose.
  • Page 7: Uart (Universal Asynchronous Receiver-Transmitter)

    7 24 Extension Bus Advanced Guide | XDK110 3. UART (Universal Asynchronous Receiver-Transmitter) 3.1 General Introduction UART stands short for Universal Asynchronous Receiver Transmitter and it is a physical circuit in a micro controller or a stand-alone IC. A UART’s main purpose is to transmit and receive serial data over two wires. In UART communication, two UARTs communicate directly with each other.
  • Page 8: Initializing And Configuring Uart

    8 24 Extension Bus Advanced Guide | XDK110 3.2 Initializing and configuring UART This section describes how to initialize UART either to receive or transmit data. It also covers the necessary configuration for the baud rate, the start bit, stop bit and parity bit. For that, the following interfaces will be used.
  • Page 9 9 24 Extension Bus Advanced Guide | XDK110 BCDS_UARTTransceiver.h Table 3 shows an excerpt of the used functionsTable 3. Function overview FUNCTION DESCRIPTION UARTTransceiver_Initialize() This function is used to initialize the UART transceiver module This function is used to start the UART transceiver for...
  • Page 10 10 24 Extension Bus Advanced Guide | XDK110 Now, a callback function with the type and parameter signature as shown in Code 4 needs to be declared. Code 4. Callback function for MCU_UART_Initialize() void UartDriverCallBack(UART_T uart, struct MCU_UART_Event_S event){ (UartTransceiverInstance.handle == uart){ UARTTransceiver_LoopCallback(&UartTransceiverInstance, event);...
  • Page 11 11 24 Extension Bus Advanced Guide | XDK110 Afterwards, the UARTTransceiver can be initialized. Code 7 showcases how. Code 7. Initializing the UARTTransceiver enum UARTTransceiver_UartType_E type = UART_TRANSCEIVER_UART_TYPE_UART; uint8_t rxBuffSize = (MAX_UART_RING_BUFFERSIZE-1); UARTTransceiver_Initialize(&UartTransceiverInstance, UartHandle, UartRingBuffer, rxBuffSize, type); type rxBuffSize, First, two variables, are declared for better readability.
  • Page 12 12 24 Extension Bus Advanced Guide | XDK110 Now that all necessary callback functions are declared, the UART module can be started as shown in Code 10. Code 10. Starting the UART module BSP_ExtensionPort_EnableUart(); UARTTransceiver_StartInAsyncMode(&UartTransceiverInstance, UartFrameEndCheck, UartTxRxCallbacks); BSP_ExtensionPort_EnableUart() For that, the function is called, which enables the UART module to use the configured...
  • Page 13: Transmitting Data Over Uart

    13 24 Extension Bus Advanced Guide | XDK110 3.3 Transmitting data over UART Now that all configuration and initialization is done, data can be transmitted via UART as shown in Code 11. For that, a function which takes a buffer holding the data and the buffer length can be build, as shown in Code 11.
  • Page 14: Receiving Data Over Uart

    14 24 Extension Bus Advanced Guide | XDK110 3.4 Receiving data over UART On the opposite, data can also be read from UART. For that, it is recommended to declare a reading function in the same manner as the writing function. A possible example is shown in Code 13.
  • Page 15: Spi (Serial Peripheral Interface Bus)

    15 24 Extension Bus Advanced Guide | XDK110 4. SPI (serial peripheral interface bus) 4.1 General Introduction SPI is short for Serial Peripheral Interface and is a synchronous serial bus specification to transfer data between integrated circuits. It uses four lines for the data transmission and integrates the roles of master and slave. With the selection through a chip select line, multiple slave devices can be connected to one master.
  • Page 16 16 24 Extension Bus Advanced Guide | XDK110 The following Table shows an excerpt of the functions used to implement a working SPI connection. BSP_ExtensionPort.h Table 4. Function overview FUNCTION DESCRIPTION BSP_ExtensionPort_Connect() This function is called to enable the power control for the...
  • Page 17 17 24 Extension Bus Advanced Guide | XDK110 BSP_ExtensionPort.h Code 16 shown an example of the first configuration of SPI with the Code 16. SPI Extension Bus configuration BSP_ExtensionPort_Connect(); BSP_ExtensionPort_ConnectSpi(); BSP_ExtensionPort_SetSpiConfig(BSP_EXTENSIONPORT_SPI_BAUDRATE, UINT32_C(2000000), NULL); BSP_ExtensionPort_SetSpiConfig(BSP_EXTENSIONPORT_SPI_MODE, BSP_EXTENSIONPORT_SPI_MODE0, NULL); BSP_ExtensionPort_SetSpiConfig(BSP_EXTENSIONPORT_SPI_BIT_ORDER, BSP_EXTENSIONPORT_SPI_MSB_FIRST, NULL); BSP_ExtensionPort_Connect()
  • Page 18 18 24 Extension Bus Advanced Guide | XDK110 Code 18. SPI event callback function void SpiAppCallback(SPI_T spi, struct MCU_SPI_Event_S event){ BCDS_UNUSED(spi); ((event.TxComplete) || (event.RxComplete)){ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; (xSemaphoreGiveFromISR(spiCompleteSync, &xHigherPriorityTaskWoken) == pdTRUE){ portYIELD_FROM_ISR(xHigherPriorityTaskWoken); The code adds control logic to the triggered events, when a SPI data frame is transmitted or received via the SPI module. A spiCompleteSync semaphore is inserted for controlled receiving and transmitting of data.
  • Page 19 19 24 Extension Bus Advanced Guide | XDK110 BSP_ExtensionPort_ConnectGpio() First, we connect to the GPIO pin PD8 on the Extension Bus with the function . After BSP_ExtensionPort_SetGpioConfig() that, configuration to that pin is applied via the function to act as pushpull output.
  • Page 20: Transmitting Data Over Spi

    20 24 Extension Bus Advanced Guide | XDK110 4.3 Transmitting data over SPI Now that all configuration and initialization is done, data can be transmitted via SPI as outlined in Code 11. For that, a function is implement, which can work with sensors or other slave devices attached to the Extension Bus.
  • Page 21 21 24 Extension Bus Advanced Guide | XDK110 Code 24. SPI write appInitSystem() function call void appInitSystem(void * CmdProcessorHandle, uint32_t param2) (CmdProcessorHandle == NULL) printf("Command processor handle is null \n\r"); assert(false); BCDS_UNUSED(param2); vTaskDelay(5000); // Other Initialization code from the code snipppets 16-20 here // Ensuring that CS is at its high state initially SpiSetCSHigh();...
  • Page 22: Receiving Data Over Spi

    22 24 Extension Bus Advanced Guide | XDK110 4.4 Receiving data over SPI Now that transmitting data over SPI was explained, receive data over SPI is explained in this section. For that, a function SpiReadRegister() called is implemented in the following outline.
  • Page 23 23 24 Extension Bus Advanced Guide | XDK110 readData Afterwards, the value of the variable , which now contains the data received by the SPI module, is stored in readVal , as a return value of the function. Finally, the chip select pin is raised back to a high voltage level by calling SpiSetCSHigh() , which indicates that the SPI transmission is over.
  • Page 24: Extension Bus Advanced Guide | Xdk110 2

    24 24 Extension Bus Advanced Guide | XDK110 REV. NO. CHAPTER DESCRIPTION OF MODIFICATION/CHANGES EDITOR DATE Version 1.0 initial release 2018-05-11...

Table of Contents