Blame view

RIOT/cpu/cc26x0/include/periph_cpu.h 2 KB
a752c7ab   elopes   add first test an...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
  /*
   * Copyright (C) 2016 Leon George
   *
   * 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.
   */
  
  /**
   * @ingroup         cpu_cc26x0
   * @{
   *
   * @file
   * @brief           CPU specific definitions for internal peripheral handling
   *
   * @author          Leon M. George <leon@georgemail.de>
   */
  
  #ifndef PERIPH_CPU_H
  #define PERIPH_CPU_H
  
  #include "cpu.h"
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  /**
   * @brief   Starting offset of CPU_ID
   */
  #define CPUID_ADDR          (&FCFG->MAC_BLE_0)
  /**
   * @brief   Length of the CPU_ID in octets
   */
  #define CPUID_LEN           (16U)
  
  #ifndef DOXYGEN
  /**
   * @brief   Override GPIO mode values
   */
  #define HAVE_GPIO_MODE_T
  typedef enum {
      GPIO_IN    = (IOCFG_INPUT_ENABLE | IOCFG_PULLCTL_OFF),      /**< input w/o pull R */
      GPIO_IN_PD = (IOCFG_INPUT_ENABLE | IOCFG_PULLCTL_DOWN),     /**< input with pull-down */
      GPIO_IN_PU = (IOCFG_INPUT_ENABLE | IOCFG_PULLCTL_UP),       /**< input with pull-up */
      GPIO_OUT   = (IOCFG_PULLCTL_OFF),                           /**< push-pull output */
      GPIO_OD    = (IOCFG_IOMODE_OPEN_DRAIN | IOCFG_PULLCTL_OFF), /**< open-drain w/o pull R */
      GPIO_OD_PU = (IOCFG_IOMODE_OPEN_DRAIN | IOCFG_PULLCTL_UP)   /**< open-drain with pull-up */
  } gpio_mode_t;
  
  /**
   * @brief   Override GPIO flank values
   */
  #define HAVE_GPIO_FLANK_T
  typedef enum {
      GPIO_FALLING = IOCFG_EDGEDET_FALLING,
      GPIO_RISING = IOCFG_EDGEDET_RISING,
      GPIO_BOTH = IOCFG_EDGEDET_BOTH
  } gpio_flank_t;
  
  /**
   * @brief   Configuration of low-level general purpose timers
   *
   * General purpose timers (GPT[0-3]) are configured consecutively and in order
   * (without gaps) starting from GPT0, i.e. if multiple timers are enabled.
   */
  typedef struct {
      uint8_t     cfg;    /**< timer config [16,32 Bit] */
      uint8_t     chn;    /**< number of channels [1,2] */
  } timer_conf_t;
  
  #endif /* ifndef DOXYGEN */
  
  #ifdef __cplusplus
  }
  #endif
  
  #endif /* PERIPH_CPU_H */
  /** @} */