LINXx firmware
Extensions to LINX toolkit
Public Member Functions | Static Public Attributes | List of all members
LinxPjrcTeensyLC Class Reference
Inheritance diagram for LinxPjrcTeensyLC:
LinxPjrc LinxWiringDevice LinxDevice

Public Member Functions

int BoardCommands (unsigned char command, unsigned char numInputBytes, unsigned char *input, unsigned char *numResponseBytes, unsigned char *response)
 board-specific commands More...
 
int Reset (ResetWhat target)
 Reset board or peripheral. More...
 
- Public Member Functions inherited from LinxPjrc
virtual int UartWrite (unsigned char channel, unsigned char numBytes, unsigned char *sendBuffer)
 Override to skip USB serial packet buffering. More...
 
- Public Member Functions inherited from LinxWiringDevice
virtual int PwmSetDutyCycle (unsigned char numChans, unsigned char *channels, unsigned char *values)
 
virtual int DigitalWrite (unsigned char numChans, unsigned char *channels, unsigned char *values)
 
virtual int DigitalRead (unsigned char numChans, unsigned char *channels, unsigned char *values)
 
virtual int DigitalWriteSquareWave (unsigned char channel, unsigned long freq, unsigned long duration)
 
virtual int DigitalReadPulseWidth (unsigned char stimChan, unsigned char stimType, unsigned char respChan, unsigned char respType, unsigned long timeout, unsigned long *width)
 
virtual unsigned long GetMilliSeconds ()
 
virtual unsigned long GetSeconds ()
 
virtual void DelayMs (unsigned long ms)
 
virtual void NonVolatileWrite (int address, unsigned char data)
 
virtual unsigned char NonVolatileRead (int address)
 
virtual int AnalogRead (unsigned char numChans, unsigned char *channels, unsigned char *values)
 
virtual int AnalogSetRef (unsigned char mode, unsigned long voltage)
 
virtual int AnalogWrite (unsigned char numChans, unsigned char *channels, unsigned char *values)
 
virtual int UartOpen (unsigned char channel, unsigned long baudRate, unsigned long *actualBaud)
 
virtual int UartSetBaudRate (unsigned char channel, unsigned long baudRate, unsigned long *actualBaud)
 
virtual int UartGetBytesAvailable (unsigned char channel, unsigned char *numBytes)
 
virtual int UartRead (unsigned char channel, unsigned char numBytes, unsigned char *recBuffer, unsigned char *numBytesRead)
 
virtual int UartClose (unsigned char channel)
 
virtual int SpiOpenMaster (unsigned char channel)
 
virtual int SpiSetBitOrder (unsigned char channel, unsigned char bitOrder)
 
virtual int SpiSetMode (unsigned char channel, unsigned char mode)
 
virtual int SpiSetSpeed (unsigned char channel, unsigned long speed, unsigned long *actualSpeed)
 
virtual int SpiWriteRead (unsigned char channel, unsigned char frameSize, unsigned char numFrames, unsigned char csChan, unsigned char csLL, unsigned char *sendBuffer, unsigned char *recBuffer)
 
virtual int I2cOpenMaster (unsigned char channel)
 
virtual int I2cSetSpeed (unsigned char channel, unsigned long speed, unsigned long *actualSpeed)
 
virtual int I2cWrite (unsigned char channel, unsigned char slaveAddress, unsigned char eofConfig, unsigned char numBytes, unsigned char *sendBuffer)
 
virtual int I2cRead (unsigned char channel, unsigned char slaveAddress, unsigned char eofConfig, unsigned char numBytes, unsigned int timeout, unsigned char *recBuffer)
 
virtual int I2cClose (unsigned char channel)
 
virtual int ServoOpen (unsigned char numChans, unsigned char *chans)
 
virtual int ServoSetPulseWidth (unsigned char numChans, unsigned char *chans, unsigned short *pulseWidths)
 
virtual int ServoClose (unsigned char numChans, unsigned char *chans)
 
- Public Member Functions inherited from LinxDevice
virtual int AnalogRead (unsigned char numChans, unsigned char *channels, unsigned char *values)=0
 
virtual int AnalogReadNoPacking (unsigned char numChans, unsigned char *channels, unsigned long *values)
 
virtual int AnalogSetRef (unsigned char mode, unsigned long voltage)=0
 
virtual int AnalogWrite (unsigned char numChans, unsigned char *channels, unsigned char *values)=0
 
virtual int AnalogWriteNoPacking (unsigned char numChans, unsigned char *channels, unsigned long *values)
 
virtual int DigitalWrite (unsigned char numChans, unsigned char *channels, unsigned char *values)=0
 
virtual int DigitalWriteNoPacking (unsigned char numChans, unsigned char *channels, unsigned char *values)
 
virtual int DigitalRead (unsigned char numChans, unsigned char *channels, unsigned char *values)=0
 
virtual int DigitalReadNoPacking (unsigned char numChans, unsigned char *channels, unsigned char *values)
 
virtual int DigitalWriteSquareWave (unsigned char channel, unsigned long freq, unsigned long duration)=0
 
virtual int DigitalReadPulseWidth (unsigned char stimChan, unsigned char stimType, unsigned char respChan, unsigned char respType, unsigned long timeout, unsigned long *width)=0
 
virtual int PwmSetDutyCycle (unsigned char numChans, unsigned char *channels, unsigned char *values)=0
 
virtual int PwmSetFrequency (unsigned char numChans, unsigned char *channels, unsigned long *values)
 
virtual int SpiOpenMaster (unsigned char channel)=0
 
virtual int SpiSetBitOrder (unsigned char channel, unsigned char bitOrder)=0
 
virtual int SpiSetMode (unsigned char channel, unsigned char mode)=0
 
virtual int SpiSetSpeed (unsigned char channel, unsigned long speed, unsigned long *actualSpeed)=0
 
virtual int SpiWriteRead (unsigned char channel, unsigned char frameSize, unsigned char numFrames, unsigned char csChan, unsigned char csLL, unsigned char *sendBuffer, unsigned char *recBuffer)=0
 
virtual int I2cOpenMaster (unsigned char channel)=0
 
virtual int I2cSetSpeed (unsigned char channel, unsigned long speed, unsigned long *actualSpeed)=0
 
virtual int I2cWrite (unsigned char channel, unsigned char slaveAddress, unsigned char eofConfig, unsigned char numBytes, unsigned char *sendBuffer)=0
 
virtual int I2cRead (unsigned char channel, unsigned char slaveAddress, unsigned char eofConfig, unsigned char numBytes, unsigned int timeout, unsigned char *recBuffer)=0
 
virtual int I2cClose (unsigned char channel)=0
 
virtual int UartOpen (unsigned char channel, unsigned long baudRate, unsigned long *actualBaud)=0
 
virtual int UartSetBaudRate (unsigned char channel, unsigned long baudRate, unsigned long *actualBaud)=0
 
virtual int UartGetBytesAvailable (unsigned char channel, unsigned char *numBytes)=0
 
virtual int UartRead (unsigned char channel, unsigned char numBytes, unsigned char *recBuffer, unsigned char *numBytesRead)=0
 
virtual int UartWrite (unsigned char channel, unsigned char numBytes, unsigned char *sendBuffer)=0
 
virtual void UartWrite (unsigned char channel, char c)
 
virtual void UartWrite (unsigned char channel, const char s[])
 
virtual void UartWrite (unsigned char channel, unsigned char c)
 
virtual void UartWrite (unsigned char channel, int n)
 
virtual void UartWrite (unsigned char channel, unsigned int n)
 
virtual void UartWrite (unsigned char channel, long n)
 
virtual void UartWrite (unsigned char channel, unsigned long n)
 
virtual void UartWrite (unsigned char channel, long n, int base)
 
virtual void UartWriteln (unsigned char channel)
 
virtual void UartWriteln (unsigned char channel, char c)
 
virtual void UartWriteln (unsigned char channel, const char s[])
 
virtual void UartWriteln (unsigned char channel, unsigned char c)
 
virtual void UartWriteln (unsigned char channel, int n)
 
virtual void UartWriteln (unsigned char channel, long n)
 
virtual void UartWriteln (unsigned char channel, unsigned long n)
 
virtual void UartWriteln (unsigned char channel, long n, int base)
 
virtual int UartClose (unsigned char channel)=0
 
virtual int ServoOpen (unsigned char numChans, unsigned char *channels)=0
 
virtual int ServoSetPulseWidth (unsigned char numChans, unsigned char *channels, unsigned short *pulseWidths)=0
 
virtual int ServoClose (unsigned char numChans, unsigned char *channels)=0
 
virtual int Ws2812Open (unsigned short numLeds, unsigned char dataChan)
 
virtual int Ws2812WriteOnePixel (unsigned short pixelIndex, unsigned char red, unsigned char green, unsigned char blue, unsigned char refresh)
 
virtual int Ws2812WriteNPixels (unsigned short startPixel, unsigned short numPixels, unsigned char *data, unsigned char refresh)
 
virtual int Ws2812Refresh ()
 
virtual int Ws2812Close ()
 
unsigned char ReverseBits (unsigned char b)
 
virtual unsigned long GetMilliSeconds ()=0
 
virtual unsigned long GetSeconds ()=0
 
virtual void DelayMs (unsigned long ms)
 
virtual void NonVolatileWrite (int address, unsigned char data)=0
 
virtual unsigned char NonVolatileRead (int address)=0
 
virtual void EnableDebug (unsigned char channel)
 
virtual void DebugPrint (char c)
 
virtual void DebugPrint (const char s[])
 
virtual void DebugPrint (unsigned char c)
 
virtual void DebugPrint (int n)
 
virtual void DebugPrint (unsigned int n)
 
virtual void DebugPrint (long n)
 
virtual void DebugPrint (unsigned long n)
 
virtual void DebugPrint (long n, int base)
 
virtual void DebugPrintln ()
 
virtual void DebugPrintln (char c)
 
virtual void DebugPrintln (const char s[])
 
virtual void DebugPrintln (unsigned char c)
 
virtual void DebugPrintln (int n)
 
virtual void DebugPrintln (long n)
 
virtual void DebugPrintln (unsigned long n)
 
virtual void DebugPrintln (long n, int base)
 
virtual void DebugPrintPacket (unsigned char direction, const unsigned char *packetBuffer)
 
virtual int BoardCommands (unsigned char command, unsigned char numInputBytes, unsigned char *input, unsigned char *numResponseBytes, unsigned char *response)
 
virtual int Reset (ResetWhat target)
 
virtual int Ws2812Open (unsigned short numLeds, unsigned char dataChan)
 
virtual int Ws2812WriteOnePixel (unsigned short pixelIndex, unsigned char red, unsigned char green, unsigned char blue, unsigned char refresh)
 
virtual int Ws2812WriteNPixels (unsigned short startPixel, unsigned short numPixels, unsigned char *data, unsigned char refresh)
 
virtual int Ws2812Refresh ()
 
virtual int Ws2812Close ()
 
unsigned char ReverseBits (unsigned char b)
 
virtual void EnableDebug (unsigned char channel)
 
virtual void DebugPrint (char c)
 
virtual void DebugPrint (const char s[])
 
virtual void DebugPrint (unsigned char c)
 
virtual void DebugPrint (int n)
 
virtual void DebugPrint (unsigned int n)
 
virtual void DebugPrint (long n)
 
virtual void DebugPrint (unsigned long n)
 
virtual void DebugPrint (long n, int base)
 
virtual void DebugPrintln ()
 
virtual void DebugPrintln (char c)
 
virtual void DebugPrintln (const char s[])
 
virtual void DebugPrintln (unsigned char c)
 
virtual void DebugPrintln (int n)
 
virtual void DebugPrintln (long n)
 
virtual void DebugPrintln (unsigned long n)
 
virtual void DebugPrintln (long n, int base)
 
virtual void DebugPrintPacket (unsigned char direction, const unsigned char *packetBuffer)
 
virtual int DigitalWriteNoPacking (unsigned char numChans, unsigned char *channels, unsigned char *values)
 
virtual int DigitalReadNoPacking (unsigned char numChans, unsigned char *channels, unsigned char *values)
 
virtual int AnalogReadNoPacking (unsigned char numChans, unsigned char *channels, unsigned long *values)
 
virtual int AnalogWriteNoPacking (unsigned char numChans, unsigned char *channels, unsigned long *values)
 
virtual int PwmSetFrequency (unsigned char numChans, unsigned char *channels, unsigned long *values)
 
virtual void UartWrite (unsigned char channel, char c)
 
virtual void UartWrite (unsigned char channel, const char s[])
 
virtual void UartWrite (unsigned char channel, unsigned char c)
 
virtual void UartWrite (unsigned char channel, int n)
 
virtual void UartWrite (unsigned char channel, unsigned int n)
 
virtual void UartWrite (unsigned char channel, long n)
 
virtual void UartWrite (unsigned char channel, unsigned long n)
 
virtual void UartWrite (unsigned char channel, long n, int base)
 
virtual void UartWriteln (unsigned char channel)
 
virtual void UartWriteln (unsigned char channel, char c)
 
virtual void UartWriteln (unsigned char channel, const char s[])
 
virtual void UartWriteln (unsigned char channel, unsigned char c)
 
virtual void UartWriteln (unsigned char channel, int n)
 
virtual void UartWriteln (unsigned char channel, long n)
 
virtual void UartWriteln (unsigned char channel, unsigned long n)
 
virtual void UartWriteln (unsigned char channel, long n, int base)
 

Static Public Attributes

static const unsigned char m_DeviceName [DEVICE_NAME_LEN] = "PJRC Teensy LC"
 
static const unsigned char m_AiChans [NUM_AI_CHANS] = {14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26}
 
static const unsigned long m_AiRefIntVals [NUM_AI_INT_REFS] = {}
 
static const int m_AiRefCodes [NUM_AI_INT_REFS] = {}
 
static const unsigned char m_AoChans [NUM_AO_CHANS] = {26}
 
static const unsigned long m_AoRefIntVals [NUM_AO_INT_REFS] = {}
 
static const int m_AoRefCodes [NUM_AO_INT_REFS] = {}
 
static const unsigned char m_DigitalChans [NUM_DIGITAL_CHANS] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}
 
static const unsigned char m_PwmChans [NUM_PWM_CHANS] = {3, 4, 5, 6, 9, 20, 21, 22, 23, 25, 32}
 
static const unsigned char m_SpiChans [NUM_SPI_CHANS] = {0,1}
 
static unsigned long m_SpiSupportedSpeeds [NUM_SPI_SPEEDS] = {8000000, 4000000, 2000000, 1000000, 500000, 250000, 125000}
 
static int m_SpiSpeedCodes [NUM_SPI_SPEEDS] = {SPI_CLOCK_DIV2, SPI_CLOCK_DIV4, SPI_CLOCK_DIV8, SPI_CLOCK_DIV16, SPI_CLOCK_DIV32, SPI_CLOCK_DIV64, SPI_CLOCK_DIV128}
 
static unsigned char m_I2cChans [NUM_I2C_CHANS] = {0, 1}
 
static unsigned char m_I2cRefCount [NUM_I2C_CHANS]
 
static unsigned char m_UartChans [NUM_UART_CHANS] = {0, 1, 2, 3}
 
static unsigned long m_UartSupportedSpeeds [NUM_UART_SPEEDS] = {300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 31250, 38400, 57600, 115200}
 
static const unsigned char m_ServoChans [NUM_SERVO_CHANS]
 
static Servo * m_Servos [NUM_SERVO_CHANS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
 

Additional Inherited Members

- Public Attributes inherited from LinxWiringDevice
unsigned char NumAiRefIntVals
 
const unsigned long * AiRefIntVals
 
const int * AiRefCodes
 
unsigned long AiRefExtMin
 
unsigned long AiRefExtMax
 
unsigned char NumAoRefIntVals
 
const unsigned long * AoRefIntVals
 
const int * AoRefCodes
 
unsigned long AoRefExtMin
 
unsigned long AoRefExtMax
 
unsigned char NumUartSpeeds
 
unsigned long * UartSupportedSpeeds
 
unsigned char NumSpiSpeeds
 
unsigned long * SpiSupportedSpeeds
 
int * SpiSpeedCodes
 
unsigned char * I2cRefCount
 
Servo ** Servos
 
- Public Attributes inherited from LinxDevice
unsigned long serialInterfaceMaxBaud
 
unsigned char DeviceFamily
 
unsigned char DeviceId
 
unsigned char DeviceNameLen
 
const unsigned char * DeviceName
 
unsigned char ListenerBufferSize
 
unsigned char LinxApiMajor
 
unsigned char LinxApiMinor
 
unsigned char LinxApiSubminor
 
unsigned char NumQeChans
 
const unsigned char * QeChans
 
unsigned char NumCanChans
 
const unsigned char * CanChans
 
unsigned short userId
 
unsigned long ethernetIp
 
unsigned short ethernetPort
 
unsigned long WifiIp
 
unsigned short WifiPort
 
unsigned char WifiSsidSize
 
char WifiSsid [32]
 
unsigned char WifiSecurity
 
unsigned char WifiPwSize
 
char WifiPw [64]
 
unsigned char NumDigitalChans
 
const unsigned char * DigitalChans
 
unsigned char NumAiChans
 
const unsigned char * AiChans
 
unsigned char AiResolution
 
unsigned long AiRefDefault
 
unsigned long AiRefSet
 
unsigned char NumAoChans
 
const unsigned char * AoChans
 
unsigned char AoResolution
 
unsigned long AoRefDefault
 
unsigned long AoRefSet
 
unsigned char NumPwmChans
 
const unsigned char * PwmChans
 
unsigned char NumUartChans
 
const unsigned char * UartChans
 
unsigned long UartMaxBaud
 
unsigned char NumI2cChans
 
const unsigned char * I2cChans
 
unsigned char NumSpiChans
 
const unsigned char * SpiChans
 
unsigned char NumServoChans
 
const unsigned char * ServoChans
 
ResetWhat ResetTarget =LRESET_NONE
 
unsigned char WifiStatus =0xFF
 

Member Function Documentation

◆ BoardCommands()

int LinxPjrcTeensyLC::BoardCommands ( unsigned char  command,
unsigned char  numInputBytes,
unsigned char *  input,
unsigned char *  numResponseBytes,
unsigned char *  response 
)
virtual

board-specific commands

Parameters
command
numInputBytes
input
numResponseBytes
response
Returns
int

Reimplemented from LinxDevice.

◆ Reset()

int LinxPjrcTeensyLC::Reset ( ResetWhat  target)
virtual

Reset board or peripheral.

Parameters
target
Returns
int

Reimplemented from LinxDevice.

Member Data Documentation

◆ m_SpiSupportedSpeeds

unsigned long LinxPjrcTeensyLC::m_SpiSupportedSpeeds = {8000000, 4000000, 2000000, 1000000, 500000, 250000, 125000}
static
Todo:
verify

◆ m_UartSupportedSpeeds

unsigned long LinxPjrcTeensyLC::m_UartSupportedSpeeds = {300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 31250, 38400, 57600, 115200}
static
Todo:
verify

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