XPoint 0.1.0
Hardware-agnostic crosspoint matrix routing library
Loading...
Searching...
No Matches
TLC59711Driver Class Reference

XPointDriver implementation for the TLC59711 SPI PWM driver. More...

#include <TLC59711Driver.h>

Inheritance diagram for TLC59711Driver:
XPointDriver

Public Types

typedef uint16_t(* MapFn) (uint8_t r, uint8_t c)
 Function pointer type: (row, col) → channel index [0, nChips*12).
 

Public Member Functions

 TLC59711Driver (uint8_t nChips, MapFn map)
 Construct the driver.
 
 ~TLC59711Driver ()
 Destructor — frees PWM and packet buffers.
 
void begin () override
 Initialize the SPI bus by calling SPI.begin(). No-op on host builds.
 
void setNodeHardware (uint8_t r, uint8_t c, bool state) override
 Set channel to 0xFFFF (state=true) or 0x0000 (state=false).
 
void setNodeLevel (uint8_t r, uint8_t c, uint16_t level) override
 Set channel to an exact 16-bit PWM value without clamping.
 
void commitPhysicalUpdates () override
 Assemble and transmit the SPI packet for all chips.
 
void setPWM (uint16_t ch, uint16_t val)
 Direct channel write, bypassing the XPoint state table.
 
const uint8_t * lastPacket () const
 Return a pointer to the most recently assembled SPI packet.
 
uint16_t lastPacketSize () const
 Return the size of the SPI packet in bytes.
 
- Public Member Functions inherited from XPointDriver
virtual ~XPointDriver ()
 
virtual void releaseNode (uint8_t, uint8_t)
 De-energize the coil that was pulsed on node (r, c).
 

Detailed Description

XPointDriver implementation for the TLC59711 SPI PWM driver.

Supports daisy-chaining multiple chips. Each chip provides 12 channels, giving nChips * 12 total addressable outputs.

All PWM values are held in a heap buffer and transmitted as a single SPI burst by commitPhysicalUpdates().

Member Typedef Documentation

◆ MapFn

typedef uint16_t(* TLC59711Driver::MapFn) (uint8_t r, uint8_t c)

Function pointer type: (row, col) → channel index [0, nChips*12).

Constructor & Destructor Documentation

◆ TLC59711Driver()

TLC59711Driver::TLC59711Driver ( uint8_t  nChips,
MapFn  map 
)

Construct the driver.

Parameters
[in]nChipsNumber of daisy-chained TLC59711 chips (1 chip = 12 channels).
[in]mapMapper; must return channel indices in [0, nChips*12).

◆ ~TLC59711Driver()

TLC59711Driver::~TLC59711Driver ( )

Destructor — frees PWM and packet buffers.

Member Function Documentation

◆ begin()

void TLC59711Driver::begin ( )
overridevirtual

Initialize the SPI bus by calling SPI.begin(). No-op on host builds.

Implements XPointDriver.

◆ commitPhysicalUpdates()

void TLC59711Driver::commitPhysicalUpdates ( )
overridevirtual

Assemble and transmit the SPI packet for all chips.

Sends chip N−1 data first so the chain's physical ordering matches the mapper's channel numbering. No-op on host builds.

Reimplemented from XPointDriver.

◆ lastPacket()

const uint8_t * TLC59711Driver::lastPacket ( ) const
inline

Return a pointer to the most recently assembled SPI packet.

Valid until the next commitPhysicalUpdates() call.

Returns
Pointer to the internal packet buffer.

◆ lastPacketSize()

uint16_t TLC59711Driver::lastPacketSize ( ) const
inline

Return the size of the SPI packet in bytes.

Returns
nChips * 28.

◆ setNodeHardware()

void TLC59711Driver::setNodeHardware ( uint8_t  r,
uint8_t  c,
bool  state 
)
overridevirtual

Set channel to 0xFFFF (state=true) or 0x0000 (state=false).

Parameters
[in]rRow index.
[in]cColumn index.
[in]statetrue = full on, false = off.

Implements XPointDriver.

◆ setNodeLevel()

void TLC59711Driver::setNodeLevel ( uint8_t  r,
uint8_t  c,
uint16_t  level 
)
overridevirtual

Set channel to an exact 16-bit PWM value without clamping.

Parameters
[in]rRow index.
[in]cColumn index.
[in]levelPWM value 0x00000xFFFF.

Reimplemented from XPointDriver.

◆ setPWM()

void TLC59711Driver::setPWM ( uint16_t  ch,
uint16_t  val 
)

Direct channel write, bypassing the XPoint state table.

Parameters
[in]chChannel index [0, nChips*12).
[in]val16-bit PWM value.

The documentation for this class was generated from the following files: