API Reference

This section provides detailed documentation of all PyTropicSquare classes, functions, and constants.

Overview

PyTropicSquare provides a Python interface for communicating with Tropic Square TROPIC01 secure element chips. The library is organized into several functional areas:

  • Core API - Main TropicSquare class for chip communication

  • Protocol Layer - L2 protocol implementation for secure communication

  • Transports - Multiple transport options (SPI, UART, Network, TCP)

  • Platform Ports - CPython and MicroPython implementations

  • Configuration - Chip configuration and User Access Policy (UAP) management

  • Chip Information - Chip ID parsing and serial number utilities

  • Cryptographic Operations - ECC operations and signature handling

  • Constants - Protocol constants, status codes, and enumerations

  • Utilities - CRC calculation, error mapping, and exception classes

Quick Reference

Main Classes

tropicsquare.TropicSquare

tropicsquare.ports.cpython.TropicSquareCPython

tropicsquare.ports.micropython.TropicSquareMicroPython

tropicsquare.l2_protocol.L2Protocol

L2 protocol layer implementation.

Transport Classes

tropicsquare.transports.spi.SpiTransport

L1 transport for MicroPython machine.SPI.

tropicsquare.transports.spidev.SpiDevTransport

L1 transport for Linux spidev interface with manual GPIO CS control.

tropicsquare.transports.uart.UartTransport

L1 transport for UART

tropicsquare.transports.network.NetworkSpiTransport

L1 transport for network-based SPI bridge.

tropicsquare.transports.tcp.TcpTransport

L1 transport for TCP connection to libtropic model/simulator.

Detailed Documentation