CPU specific definitions for internal peripheral handling.  
More...
CPU specific definitions for internal peripheral handling. 
- Author
 - Hauke Petersen hauke.nosp@m..pet.nosp@m.ersen.nosp@m.@fu-.nosp@m.berli.nosp@m.n.de 
 
- 
Sebastian Meiling s@mln.nosp@m.g.ne.nosp@m.t 
 
Definition in file periph_cpu.h.
#include <stdint.h>
#include <stdio.h>
#include "vendor/hw_soc_adc.h"
#include "cpu.h"
#include "vendor/hw_ssi.h"
#include "vendor/hw_uart.h"
Go to the source code of this file.
 | 
| 
#define  | GPIO_UNDEF   (0xffffffff) | 
|   | Define custom value to specify undefined or unused GPIOs. 
  | 
|   | 
| 
#define  | GPIO_MUX_NONE   (0xff) | 
|   | Custom value to indicate unused parameter in gpio_init_mux. 
  | 
|   | 
| #define  | GPIO_PIN(port,  pin) | 
|   | Define a custom GPIO_PIN macro.  More...
  | 
|   | 
 | 
| 
#define  | HAVE_GPIO_T | 
|   | 
| 
typedef uint32_t  | gpio_t | 
|   | 
 | 
| 
#define  | RTT_DEV   SMWDTHROSC | 
|   | 
| 
#define  | RTT_IRQ   SM_TIMER_ALT_IRQn | 
|   | 
| 
#define  | RTT_IRQ_PRIO   1 | 
|   | 
| 
#define  | RTT_ISR   isr_sleepmode | 
|   | 
| 
#define  | RTT_MAX_VALUE   (0xffffffff) | 
|   | 
| 
#define  | RTT_FREQUENCY   (CLOCK_OSC32K) | 
|   | 
| 
#define  | RTT_MIN_OFFSET   (5U) | 
|   | 
 | 
| 
#define  | NWDT_TIME_LOWER_LIMIT   (2U) | 
|   | 
| 
#define  | NWDT_TIME_UPPER_LIMIT   (1000U) | 
|   | 
◆ GPIO_PIN
      
        
          | #define GPIO_PIN | 
          ( | 
            | 
          port,  | 
        
        
           | 
           | 
            | 
          pin  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Value:
#define GPIO_PORTNUM_SHIFT
bit shift for GPIO port
 
#define GPIO_BASE
GPIO port instance base address.
 
unsigned int gpio_t
GPIO type identifier.
 
 
Define a custom GPIO_PIN macro. 
For the CC2538, we use OR the gpio ports base register address with the actual pin number. 
Definition at line 73 of file periph_cpu.h.
 
 
◆ gpio_init_af()
      
        
          | void gpio_init_af  | 
          ( | 
          gpio_t  | 
          pin,  | 
        
        
           | 
           | 
          uint8_t  | 
          sel,  | 
        
        
           | 
           | 
          uint8_t  | 
          over  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Configure an alternate function for the given pin. 
- Parameters
 - 
  
    | [in] | pin | gpio pin  | 
    | [in] | sel | Select pin peripheral function  | 
    | [in] | over | Override pin configuration  | 
  
   
 
 
◆ gpio_init_mux()
      
        
          | void gpio_init_mux  | 
          ( | 
          gpio_t  | 
          pin,  | 
        
        
           | 
           | 
          uint8_t  | 
          over,  | 
        
        
           | 
           | 
          uint8_t  | 
          sel,  | 
        
        
           | 
           | 
          uint8_t  | 
          func  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Configure an alternate function for the given pin. 
- Parameters
 - 
  
    | [in] | pin | gpio pin  | 
    | [in] | over | Override pin configuration  | 
    | [in] | sel | Set peripheral function for pin (output)  | 
    | [in] | func | Set pin for peripheral function (input)  | 
  
   
 
 
◆ spi_clk_config
Initial value:= {
    { .cpsr = 64, .scr =  4 },  
    { .cpsr = 16, .scr =  4 },  
    { .cpsr = 32, .scr =  0 },  
    { .cpsr =  2, .scr =  2 },  
    { .cpsr =  2, .scr =  1 }   
}
 
Pre-calculated clock divider values based on a CLOCK_CORECLOCK (32MHz) 
SPI bus frequency = CLOCK_CORECLOCK / (CPSR * (SCR + 1)), with CPSR = 2..254 and even, SCR = 0..255 
Definition at line 278 of file periph_cpu.h.