<commit_before>/*
 * Copyright (C) 2014 Eistec AB
 *
 * This file is subject to the terms and conditions of the GNU Lesser General
 * Public License v2.1. See the file LICENSE in the top level directory for more
 * details.
 */

/**
 * @defgroup    board_mulle Eistec Mulle
 * @ingroup     boards
 * @brief       Board specific files for Eistec Mulle IoT boards
 * @{
 *
 * @file
 * @brief       Board specific definitions for the Eistec Mulle IoT board
 *
 * @author      <NAME> <<EMAIL>>
 */

#ifndef BOARD_H_
#define BOARD_H_

#include "cpu.h"
#include "periph_conf.h"
#include "mulle-nvram.h"

/* Use the on board RTC 32kHz clock for LPTMR clocking. */
#undef LPTIMER_CLKSRC
/** @brief Clock source for the LPTMR module */
#define LPTIMER_CLKSRC LPTIMER_CLKSRC_ERCLK32K

/** Disable hardware watchdog, for debugging purposes, don't use this on production builds. */
#define DISABLE_WDOG    1

/**
 * @name LEDs configuration
 * @{
 */

#define LED_RED_PORT        PTC
#define LED_RED_PIN         15
#define LED_RED_GPIO        GPIO_PIN(PORT_C, LED_RED_PIN)
#define LED_YELLOW_PORT     PTC
#define LED_YELLOW_PIN      14
#define LED_YELLOW_GPIO     GPIO_PIN(PORT_C, LED_YELLOW_PIN)
#define LED_GREEN_PORT      PTC
#define LED_GREEN_PIN       13
#define LED_GREEN_GPIO      GPIO_PIN(PORT_C, LED_GREEN_PIN)

/** @} */

/**
 * @name Macros for controlling the on-board LEDs.
 * @{
 */
#define LED_RED_ON          (BITBAND_REG32(LED_RED_PORT->PSOR, LED_RED_PIN) = 1)
#define LED_RED_OFF         (BITBAND_REG32(LED_RED_PORT->PCOR, LED_RED_PIN) = 1)
#define LED_RED_TOGGLE      (BITBAND_REG32(LED_RED_PORT->PTOR, LED_RED_PIN) = 1)
#define LED_YELLOW_ON       (BITBAND_REG32(LED_YELLOW_PORT->PSOR, LED_YELLOW_PIN) = 1)
#define LED_YELLOW_OFF      (BITBAND_REG32(LED_YELLOW_PORT->PCOR, LED_YELLOW_PIN) = 1)
#define LED_YELLOW_TOGGLE   (BITBAND_REG32(LED_YELLOW_PORT->PTOR, LED_YELLOW_PIN) = 1)
#define LED_GREEN_ON        (BITBAND_REG32(LED_GREEN_PORT->PSOR, LED_GREEN_PIN) = 1)
#define LED_GREEN_OFF       (BITBAND_REG32(LED_GREEN_PORT->PCOR, LED_GREEN_PIN) = 1)
#define LED_GREEN_TOGGLE    (BITBAND_REG32(LED_GREEN_PORT->PTOR, LED_GREEN_PIN) = 1)
/** @} */

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @brief Initialize board specific hardware, including clock, LEDs and std-IO
 */
void board_init(void);

#ifdef __cplusplus
}
#endif

/**
 * @name Define the interface to the AT86RF212B radio
 *
 * @todo Work around missing RESET pin on Mulle v0.6x
 *<commit_msg>boards/mulle: Avoid RMW bitbanding in LED macros<commit_after>/*
 * Copyright (C) 2014 Eistec AB
 *
 * This file is subject to the terms and conditions of the GNU Lesser General
 * Public License v2.1. See the file LICENSE in the top level directory for more
 * details.
 */

/**
 * @defgroup    board_mulle Eistec Mulle
 * @ingroup     boards
 * @brief       Board specific files for Eistec Mulle IoT boards
 * @{
 *
 * @file
 * @brief       Board specific definitions for the Eistec Mulle IoT board
 *
 * @author      <NAME> <<EMAIL>>
 */

#ifndef BOARD_H_
#define BOARD_H_

#include "cpu.h"
#include "periph_conf.h"
#include "mulle-nvram.h"

/* Use the on board RTC 32kHz clock for LPTMR clocking. */
#undef LPTIMER_CLKSRC
/** @brief Clock source for the LPTMR module */
#define LPTIMER_CLKSRC LPTIMER_CLKSRC_ERCLK32K

/** Disable hardware watchdog, for debugging purposes, don't use this on production builds. */
#define DISABLE_WDOG    1

/**
 * @name LEDs configuration
 * @{
 */

#define LED_RED_PORT        PTC
#define LED_RED_PIN         15
#define LED_RED_GPIO        GPIO_PIN(PORT_C, LED_RED_PIN)
#define LED_YELLOW_PORT     PTC
#define LED_YELLOW_PIN      14
#define LED_YELLOW_GPIO     GPIO_PIN(PORT_C, LED_YELLOW_PIN)
#define LED_GREEN_PORT      PTC
#define LED_GREEN_PIN       13
#define LED_GREEN_GPIO      GPIO_PIN(PORT_C, LED_GREEN_PIN)

/** @} */

/**
 * @name Macros for controlling the on-board LEDs.
 * @{
 */
#define LED_RED_ON          (LED_RED_PORT->PSOR = (1 << LED_RED_PIN))
#define LED_RED_OFF         (LED_RED_PORT->PCOR = (1 << LED_RED_PIN))
#define LED_RED_TOGGLE      (LED_RED_PORT->PTOR = (1 << LED_RED_PIN))
#define LED_YELLOW_ON       (LED_YELLOW_PORT->PSOR = (1 << LED_YELLOW_PIN))
#define LED_YELLOW_OFF      (LED_YELLOW_PORT->PCOR = (1 << LED_YELLOW_PIN))
#define LED_YELLOW_TOGGLE   (LED_YELLOW_PORT->PTOR = (1 << LED_YELLOW_PIN))
#define LED_GREEN_ON        (LED_GREEN_PORT->PSOR = (1 << LED_GREEN_PIN))
#define LED_GREEN_OFF       (LED_GREEN_PORT->PCOR = (1 << LED_GREEN_PIN))
#define LED_GREEN_TOGGLE    (LED_GREEN_PORT->PTOR = (1 << LED_GREEN_PIN))
/** @} */

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @brief Initialize board specific hardware, including clock, LEDs and std-IO
 */
void board_init(void);

#ifdef __cplusplus
}
#endif

/**
 * @name Define the interface to the AT86RF212B radio
 *
 * @todo Work around missing RESET pin on Mulle v0.6x
 *
{'fraction_non_alphanumeric': 0.10464638157894737, 'fraction_numerical': 0.017269736842105265, 'mean_word_length': 3.7463414634146344, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5497179', 'n_tokens_mistral': 1887, 'n_tokens_neox': 1798, 'n_words': 472}