FastLED 3.9.15
Loading...
Searching...
No Matches
fl::isr Namespace Reference

Classes

struct  config
 Configuration for ISR attachment. More...
 
class  critical_section
 RAII helper for critical sections (interrupt disable/enable) Automatically disables interrupts on construction and enables on destruction. More...
 
struct  handle
 Opaque handle to an attached ISR. More...
 

Typedefs

using CriticalSection = critical_section
 
typedef void(* handler_fn) (void *user_data)
 ISR handler function signature.
 
using isr_config_t = config
 
using isr_handle_t = handle
 
using isr_handler_t = handler_fn
 

Functions

int attach_external_handler (u8 pin, const config &cfg, handle *out_handle=nullptr)
 Attach an external interrupt handler (GPIO-based).
 
int attach_timer_handler (const config &cfg, handle *out_handle=nullptr)
 Attach a timer-based ISR handler.
 
int detach_handler (handle &h)
 Detach an ISR handler.
 
int disable_handler (handle &h)
 Disable an ISR temporarily (without detaching).
 
int enable_handler (handle &h)
 Enable an ISR (after temporary disable).
 
const char * get_error_string (int error_code)
 Get platform-specific error description.
 
u8 get_max_priority ()
 Get the maximum priority level supported by this platform.
 
u32 get_max_timer_frequency ()
 Get the maximum timer frequency supported by this platform.
 
u32 get_min_timer_frequency ()
 Get the minimum timer frequency supported by this platform.
 
const char * get_platform_name ()
 Get the platform name.
 
FASTLED_FORCE_INLINE bool is_aligned (const void *ptr, size_t alignment)
 Check if a pointer is aligned to a specific byte boundary.
 
bool is_handler_enabled (const handle &h)
 Query if an ISR is currently enabled.
 
FL_OPTIMIZE_FUNCTION FL_IRAM FASTLED_FORCE_INLINE void memcpy (void *FL_RESTRICT_PARAM dst, const void *FL_RESTRICT_PARAM src, size_t num_bytes)
 ISR-optimized memcpy with alignment detection and switch dispatch.
 
FL_OPTIMIZE_FUNCTION FL_IRAM FASTLED_FORCE_INLINE void memcpy_16 (u16 *FL_RESTRICT_PARAM dst, const u16 *FL_RESTRICT_PARAM src, size_t count)
 ISR-optimized 16-bit block copy for 2-byte aligned memory.
 
FL_OPTIMIZE_FUNCTION FL_IRAM FASTLED_FORCE_INLINE void memcpy_32 (u32 *FL_RESTRICT_PARAM dst, const u32 *FL_RESTRICT_PARAM src, size_t count)
 ISR-optimized 32-bit block copy for 4-byte aligned memory.
 
FL_OPTIMIZE_FUNCTION FL_IRAM FASTLED_FORCE_INLINE void memcpy_byte (u8 *FL_RESTRICT_PARAM dst, const u8 *FL_RESTRICT_PARAM src, size_t count)
 ISR-optimized byte copy.
 
FL_OPTIMIZE_FUNCTION FL_IRAM FASTLED_FORCE_INLINE void memset_zero (u8 *dest, size_t count)
 ISR-safe memset with alignment optimization.
 
FL_OPTIMIZE_FUNCTION FL_IRAM FASTLED_FORCE_INLINE void memset_zero_byte (u8 *dest, size_t count)
 ISR-safe memset replacement (byte-by-byte zero)
 
FL_OPTIMIZE_FUNCTION FL_IRAM FASTLED_FORCE_INLINE void memset_zero_word (u8 *dest, size_t count)
 ISR-safe word-aligned memset (4-byte writes)
 
bool requires_assembly_handler (u8 priority)
 Check if assembly is required for a given priority level.
 

Variables

constexpr u32 ISR_FLAG_EDGE_FALLING = (1u << 2)
 
constexpr u32 ISR_FLAG_EDGE_RISING = (1u << 1)
 
constexpr u32 ISR_FLAG_ESP_LOWMED = (1ul << 17)
 
constexpr u32 ISR_FLAG_ESP_SHARED = (1ul << 16)
 
constexpr u32 ISR_FLAG_IRAM_SAFE = (1u << 0)
 
constexpr u32 ISR_FLAG_LEVEL_HIGH = (1u << 3)
 
constexpr u32 ISR_FLAG_LEVEL_LOW = (1u << 4)
 
constexpr u32 ISR_FLAG_MANUAL_TICK = (1u << 6)
 
constexpr u32 ISR_FLAG_ONE_SHOT = (1u << 5)
 
constexpr u32 ISR_FLAG_STM32_PREEMPT = (1ul << 18)
 
constexpr u8 ISR_PRIORITY_CRITICAL = 4
 
constexpr u8 ISR_PRIORITY_DEFAULT = 1
 
constexpr u8 ISR_PRIORITY_HIGH = 3
 
constexpr u8 ISR_PRIORITY_LOW = 1
 
constexpr u8 ISR_PRIORITY_MAX = 7
 
constexpr u8 ISR_PRIORITY_MEDIUM = 2