FastLED 3.6.0
Loading...
Searching...
No Matches
fastpin.h File Reference

Detailed Description

Class base definitions for defining fast pin access.

Definition in file fastpin.h.

#include "FastLED.h"
#include "led_sysdefs.h"
#include <stddef.h>

Go to the source code of this file.

Classes

class  Selectable
 Abstract class for "selectable" things. More...
 
class  Pin
 Naive fallback solution for low level pin access. More...
 
class  OutputPin
 I/O pin initially set to OUTPUT. More...
 
class  InputPin
 I/O pin initially set to INPUT. More...
 
class  FastPin< PIN >
 The simplest level of Pin class. More...
 
class  FastPinBB< PIN >
 FastPin implementation for bit-banded access. More...
 
struct  __FL_PORT_INFO< port >
 Utility template for tracking down information about pins and ports. More...
 

Macros

#define NO_PIN   255
 Constant for "not a pin".
 
#define _FL_DEFINE_PORT(L, BASE)
 Macro to create the instantiations for defined ports.
 
#define _FL_DEFINE_PORT3(L, LC, BASE)
 Macro to create the instantiations for defined ports.
 

Typedefs

typedef volatile uint32_t & reg32_t
 Reference to a 32-bit register, volatile.
 
typedef volatile uint32_t * ptr_reg32_t
 Pointer to a 32-bit register, volatile.
 

Macro Definition Documentation

◆ _FL_DEFINE_PORT

#define _FL_DEFINE_PORT (   L,
  BASE 
)
Value:
template<> struct __FL_PORT_INFO<L> { \
static bool hasPort() { return 1; } \
static const char *portName() { return #L; } \
typedef BASE __t_baseType; \
static const void *portAddr() { return (void*)&__t_baseType::r(); } };
Utility template for tracking down information about pins and ports.
Definition fastpin.h:317
static const void * portAddr()
Gets the raw address of the port.
Definition fastpin.h:323
static bool hasPort()
Checks whether a port exists.
Definition fastpin.h:319
static const char * portName()
Gets the name of the port, as a C-string.
Definition fastpin.h:321

Macro to create the instantiations for defined ports.

We're going to abuse this later for auto discovery of pin/port mappings for new variants.
Use this for ports that are numeric in nature, e.g. GPIO0, GPIO1, etc.

Parameters
Lthe number of the port
BASEthe data type for the register

Definition at line 333 of file fastpin.h.

◆ _FL_DEFINE_PORT3

#define _FL_DEFINE_PORT3 (   L,
  LC,
  BASE 
)
Value:
template<> struct __FL_PORT_INFO<LC> { \
static bool hasPort() { return 1; } \
static const char *portName() { return #L; } \
typedef BASE __t_baseType; \
static const void *portAddr() { return (void*)&__t_baseType::r(); } };

Macro to create the instantiations for defined ports.

We're going to abuse this later for auto discovery of pin/port mappings for new variants.
Use this for ports that are letters. The first parameter will be the letter, the second parameter will be an integer/counter of some kind. This is because attempts to turn macro parameters into character constants break in some compilers.

Parameters
Lthe letter of the port
LCan integer counter
BASEthe data type for the register

Definition at line 349 of file fastpin.h.

◆ NO_PIN

#define NO_PIN   255

Constant for "not a pin".

Todo:
Unused, remove?

Definition at line 19 of file fastpin.h.

Typedef Documentation

◆ ptr_reg32_t

typedef volatile uint32_t* ptr_reg32_t

Pointer to a 32-bit register, volatile.

Definition at line 313 of file fastpin.h.

◆ reg32_t

typedef volatile uint32_t& reg32_t

Reference to a 32-bit register, volatile.

Definition at line 312 of file fastpin.h.