UM-B-047
DA1468x Getting Started with the Development Kit
User Manual
Version 7.0
23-Jul-2018
CFR0012
28 of 36
© 2018 Dialog Semiconductor
verified by setting up a terminal application (see
for the procedure, with the only difference that
now the baud rate must be set to 115200).
The software shall be modified to toggle LED
D2
every 200ms (
), connected to pin
P1_5
.
Figure 33: LED D2 on ProDK
The software first needs to reserve and initialize the selected GPIO. This typically takes place inside
the
periph_init()
routine which is located inside the
main.c
file. This is done by adding the
following code to the end of this function:
hw_gpio_set_pin_function(HW_GPIO_PORT_1,HW_GPIO_PIN_5, HW_GPIO_MODE_OUTPUT,
HW_GPIO_FUNC_GPIO);
Code 2: Set function for GPIO
This call makes sure pin 5 of port 1 is set as GPIO output. To toggle the GPIO every 200ms the main
routine inside the
prvTemplateTask()
routine needs to be
modified
as follows:
for( ;; )
{
/* Place this task in the blocked state until it is time to run again. The block time is specified in
ticks, the constant used convertsticks to ms. While in the Blocked state this task will not consume
any CPU time. */
vTaskDelayUntil( &xNextWakeTime, mainCOUNTER_FREQUENCY_MS
);
test_+;
/* make sure P1_5 is set and reset alternatively */
if(test_counter % 2)
hw_gpio_set_active(HW_GPIO_PORT_1, HW_GPIO_PIN_5 );
else
hw_gpio_set_inactive(HW_GPIO_PORT_1, HW_GPIO_PIN_5 );
}
Code 3: The main routine inside the prvTemplateTask()
“if”
statement has been
modified
. The routines (
hw_gpio_set_active()
and
hw_gpio_set_inactive()
) are an example of how to use low level drivers (LLD). These APIs are
defined in
hw_gpio.h
(
located in
<sdk_root_directory>/peripherals/include
)
.
8.3
Software Build
As already described in the previous section the
SmartSnippetsTM
DA1468x SDK contains a
template project featuring the FreeRTOS OS which will be used as a starting point to develop a
customized SW project for the DA1468x family of devices. This section describes all the steps
required to import, build and run this first project.
1. In the
SmartSnippetsTM Studio
welcome page click on the IDE icon from the Tools tab as shown
in