Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Announcements
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9873 Discussions

'Blink' Example for Microcontroller D2000 Development Platform

Michelle_C_Intel
Employee
956 Views

Below example code will blink the onboard LED on the D2000 Development Platform.

 

# include "qm_soc_regs.h"

# include "qm_gpio.h"

# include "qm_scss.h"

/* LED on Intel(R) Quark(TM) Microcontroller D2000 Development Platform */

# define LED_BIT 24

# define DELAY 300000UL

# define MAX_LED_BLINKS (10)

static qm_gpio_port_config_t cfg;

int main(void)

{

uint32_t counter = 0;

QM_PUTS("Starting: Led blink\n");

cfg.direction = BIT(LED_BIT);

qm_gpio_set_config(QM_GPIO_0, &cfg);

while (counter < MAX_LED_BLINKS) {

qm_gpio_set_pin(QM_GPIO_0, LED_BIT);

clk_sys_udelay(DELAY);

qm_gpio_clear_pin(QM_GPIO_0, LED_BIT);

clk_sys_udelay(DELAY);

counter++;

}

QM_PUTS("Finished: Led blink\n");

return 0;

}

If using ISSM create a project using a template (e.g. hello_word) using the 'Create New QMSI/BSP Project'. Then just paste the above into the main.c .

0 Replies
Reply