ClearCore Library

website·Indexed 29 days ago

https://teknic-inc.github.io/ClearCore-library

A hardware abstraction and utility library providing drivers and managers for Ethernet, USB, DMA, NVM, SD cards, encoder inputs, and step generators, including low-level hardware mapping for physical pins and SERCOM configurations.

Tokens
216.1K
Snippets
1.6K
Records
1.9K
Agent score
69%

What's inside ClearCore

  1. Overview of ClearCore Motor Control

    ClearCore provides a suite of options to control up to four motors simultaneously via physical connectors M-0 through M-3. The system uses two primary classes: MotorManager for hardware configuration of the connectors and MotorDriver for controlling the motors themselves. While designed for Teknic ClearPath motors, generic stepper motor drives are also supported. In code, the four connectors are represented by instances ConnectorM0 through ConnectorM3 of the MotorDriver class.
  2. Overview of ClearCore::UsbManager

    The ClearCore::UsbManager class implements a CDC (Communications Device Class) USB device using an abstract control model (ACM) to emulate a serial port.

    Data Handling Behavior:

    • Reading: Data is received via interrupts and stored in a circular buffer. If the buffer is full, new data is acknowledged but not stored. Use AvailableForRead() to check the number of available bytes.
    • Writing: Small transfers (less than a packet size) are buffered and sent in the background. Larger transfers are sent in the background without buffering, meaning the data pointer must remain valid until the sending procedure is complete.

    #include <UsbManager.h>

  3. Overview of ClearCore USB Manager

    The ClearCore::UsbManager class handles USB 2.1 communication when the board is acting as a device. The USB peripheral utilizes a built-in DMA (separate from the main system DMA) to transfer data to RAM for software processing. Key terminology used in this module includes: EP (Endpoint), DIR (Direction), PCK (Packet), CDC (Communication Device Class), and ACM (Abstract Control Model).
  4. Overview of ClearCore::EncoderInput

    The ClearCore::EncoderInput class is a position sensor decoder that provides position and velocity information from external quadrature and index signals. It is designed to be used with the Encoder Input Adapter Board (PN: CL-ENCDR-DFIN).

    Hardware Constraint: When using the Encoder Input Adapter Board, the ClearCore DI-6, DI-7, and DI-8 inputs become unavailable.

    #include <EncoderInput.h>

  5. Overview of ClearCore::SerialDriver

    The ClearCore::SerialDriver class provides control and access to the Serial Port Connector on ClearCore boards. It is designed to handle various serial communication setups, including:

    • RS232 direct connections (with signal inversion for ports that do not tolerate negative voltages).
    • TTL direct connections to USB bridge components.
    • SPI transfers.

    #include "SerialDriver.h"

  6. Overview of the ClearCore::MotorDriver class

    The ClearCore::MotorDriver class is used to manage motor connectors on the ClearCore board. It provides the interface for motor control and motion generation. The following connector instances on the board support motor functionality: ConnectorM0, ConnectorM1, ConnectorM2, and ConnectorM3.
    #include <MotorDriver.h>
  7. Overview of ClearCore StepGenerator

    The StepGenerator class in the ClearCore library provides motion generation for motors using step and direction control. It is a parent class of MotorDriver, allowing motor configuration and motion generation to be managed via a single MotorDriver object. While designed for Teknic ClearPath motors, it is compatible with generic stepper motor drives.