/*
 * Copyright (c) 2012-2014 Wind River Systems, Inc.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <zephyr.h>
#include <sys/printk.h>

#define PIN_GPIO  (25UL)

void main(void)
{
	  NRF_P0->PIN_CNF[PIN_GPIO] = (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos) |
                                (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos) |
                                (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) |
                                (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos) |
                                (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos);

	printk("Hello World! %s\n", CONFIG_BOARD);

	  // Toggle GPIO ON/OFF.
	while (1)
	{
		uint32_t volatile tmo;
		
		tmo = 10000000;
		while (tmo--);
		NRF_P0->OUTSET = (1UL << PIN_GPIO);    
		
		tmo = 10000000;
		while (tmo--);
		NRF_P0->OUTCLR = (1UL << PIN_GPIO);  
	}

}
