FastLED 3.9.15
Loading...
Searching...
No Matches
bitswap.h File Reference

Detailed Description

Functions for doing a rotation of bits/bytes used by parallel output.

Definition in file bitswap.h.

#include "FastLED.h"
#include "fl/force_inline.h"
+ Include dependency graph for bitswap.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  bitswap_type
 Union containing a full 8 bytes to swap the bit orientation on. More...
 
struct  bitswap_type.__unnamed0__
 
union  just8bits
 Structure representing 8 bits of access. More...
 
struct  just8bits.__unnamed0__
 
struct  sub4
 Structure representing 32 bits of access. More...
 

Macros

#define SWAPS(X, N)
 Set out.X bits to bit N of both in.a and in.b in order.
 
#define SWAPSA(X, N)
 Set out.X bits 0, 1, 2, and 3 to bit N of in.a.a, in.a.b, in.a.b, in.a.c, and in.a.d
 
#define SWAPSB(X, N)
 Set out.X bits 0, 1, 2, and 3 to bit N of in.b.a, in.b.b, in.b.b, in.b.c, and in.b.d
 

Functions

FASTLED_FORCE_INLINE void slowswap (unsigned char *A, unsigned char *B)
 Slow version of the 8 byte by 8 bit rotation.
 
FASTLED_FORCE_INLINE void swapbits8 (bitswap_type in, bitswap_type &out)
 Do an 8-byte by 8-bit rotation.
 
template<int m, int n>
FASTLED_FORCE_INLINE void transpose8 (unsigned char *A, unsigned char *B)
 Templated bit-rotating function.
 
FASTLED_FORCE_INLINE void transpose8x1 (unsigned char *A, unsigned char *B)
 Simplified form of bits rotating function.
 
FASTLED_FORCE_INLINE void transpose8x1_MSB (unsigned char *A, unsigned char *B)
 Simplified form of bits rotating function.
 
void transpose8x1_noinline (unsigned char *A, unsigned char *B)
 Simplified form of bits rotating function.
 

Class Documentation

◆ bitswap_type

union bitswap_type
Class Members
struct bitswap_type.__unnamed0__ __unnamed__
uint8_t bytes[8] eight 8-bit values to load for swapping
uint32_t word[2] two 32-bit values to load for swapping

◆ bitswap_type.__unnamed0__

struct bitswap_type.__unnamed0__
Class Members
sub4 a 32-bit access struct for bit swapping, upper four bytes (word[0] or bytes[0-3])
sub4 b 32-bit access struct for bit swapping, lower four bytes (word[1] or bytes[4-7])

◆ just8bits

union just8bits
Class Members
struct just8bits.__unnamed0__ __unnamed__
uint8_t raw the entire byte

◆ just8bits.__unnamed0__

struct just8bits.__unnamed0__
Class Members
uint32_t a0:1 bit 0 (0x01)
uint32_t a1:1 bit 1 (0x02)
uint32_t a2:1 bit 2 (0x04)
uint32_t a3:1 bit 3 (0x08)
uint32_t a4:1 bit 4 (0x10)
uint32_t a5:1 bit 5 (0x20)
uint32_t a6:1 bit 6 (0x40)
uint32_t a7:1 bit 7 (0x80)

◆ sub4

struct sub4
Class Members
uint32_t a0:1 byte 'a', bit 0 (0x00000000)
uint32_t a1:1 byte 'a', bit 1 (0x00000002)
uint32_t a2:1 byte 'a', bit 2 (0x00000004)
uint32_t a3:1 byte 'a', bit 3 (0x00000008)
uint32_t a4:1 byte 'a', bit 4 (0x00000010)
uint32_t a5:1 byte 'a', bit 5 (0x00000020)
uint32_t a6:1 byte 'a', bit 6 (0x00000040)
uint32_t a7:1 byte 'a', bit 7 (0x00000080)
uint32_t b0:1 byte 'b', bit 0 (0x00000100)
uint32_t b1:1 byte 'b', bit 1 (0x00000200)
uint32_t b2:1 byte 'b', bit 2 (0x00000400)
uint32_t b3:1 byte 'b', bit 3 (0x00000800)
uint32_t b4:1 byte 'b', bit 4 (0x00001000)
uint32_t b5:1 byte 'b', bit 5 (0x00002000)
uint32_t b6:1 byte 'b', bit 6 (0x00004000)
uint32_t b7:1 byte 'b', bit 7 (0x00008000)
uint32_t c0:1 byte 'c', bit 0 (0x00010000)
uint32_t c1:1 byte 'c', bit 1 (0x00020000)
uint32_t c2:1 byte 'c', bit 2 (0x00040000)
uint32_t c3:1 byte 'c', bit 3 (0x00080000)
uint32_t c4:1 byte 'c', bit 4 (0x00100000)
uint32_t c5:1 byte 'c', bit 5 (0x00200000)
uint32_t c6:1 byte 'c', bit 6 (0x00400000)
uint32_t c7:1 byte 'c', bit 7 (0x00800000)
uint32_t d0:1 byte 'd', bit 0 (0x01000000)
uint32_t d1:1 byte 'd', bit 1 (0x02000000)
uint32_t d2:1 byte 'd', bit 2 (0x04000000)
uint32_t d3:1 byte 'd', bit 3 (0x08000000)
uint32_t d4:1 byte 'd', bit 4 (0x10000000)
uint32_t d5:1 byte 'd', bit 5 (0x20000000)
uint32_t d6:1 byte 'd', bit 6 (0x40000000)
uint32_t d7:1 byte 'd', bit 7 (0x80000000)