XDK110
BCDS
© Bosch Connected Devices and Solutions GmbH reserves all rights even in the event of industrial property rights. We reserve all rights of disposal such as
copying and passing on to third parties. BOSCH and the symbol are registered trademarks of Robert Bosch GmbH, Germany.
Note: Specifications within this document are subject to change without notice.
General Information Guide XDK110
!
Page
!
47
4.2.3 Software Example
This example outlines how to realize LED blinking functionality on the XDK Extension Bus.
Code 5
: Led task
#include "BCDS_MCU_GPIO.h"
#include “BCDS_MCU_GPIO_Handle.h"
void
extensionLedTask(
void
)
{
MCU_GPIO_Handle_T
GPIOA;
/* initialize local variables */
int
count = 0;
GPIOA.Port =
gpioPortA
;
GPIOA.Pin = 1;
GPIOA.Mode =
gpioModePushPull
;
GPIOA.InitialState =
MCU_GPIO_PIN_STATE_HIGH
;
/* Initialization activities for PTD driver */
MCU_GPIO_Initialize
(&GPIOA);
/* blinking functionality */
while
(count < 10)
{
/* Set data out register for the pin to 1 */
MCU_GPIO_WritePin
(&GPIOA,
MCU_GPIO_PIN_STATE_HIGH
);
vTaskDelay
(1000);
/* use suitable delay API. This delay API is for demo only. */
/* Set data out register for the pin to 0 */
MCU_GPIO_WritePin
(&GPIOA,
MCU_GPIO_PIN_STATE_LOW
);
vTaskDelay
(1000);
/* use suitable delay API. This delay API is for demo only. */
count++;
}
}
void
appInitSystem(
void
* CmdProcessorHandle,
uint32_t
param2)
{
if
(CmdProcessorHandle == NULL)
{
printf
("Command processor handle is null \n\r");
assert
(false);
}
BCDS_UNUSED(param2);
extensionLedTask
();
}