[][src]Module mynewt::spi

Experimental Non-Blocking SPI Transfer API. Uses a background task to send SPI requests sequentially. Request data is copied into Mbuf Queues before transmitting.

Structs

SpiCallback

Non-blocking SPI transfer callback parameter (not used)

Constants

DISPLAY_CS
DISPLAY_DC
DISPLAY_SPI
OS_TICKS_PER_SEC
SPI_DC_PIN
SPI_NUM
SPI_SS_PIN
SPI_TASK_STACK_SIZE

Size of the stack (in 4-byte units). Previously OS_STACK_ALIGN(256)

Statics

PENDING_CMD

Pending SPI Command Byte to be written

PENDING_DATA

Pending SPI Data Bytes to be written

SPI_CALLBACK

Non-blocking SPI transfer callback values (not used)

SPI_DATA_QUEUE

Mbuf Queue that contains the SPI data packets to be sent. Why use Mbuf Queue? Because it's a Mynewt OS low-level buffer that allows packets of various sizes to be copied efficiently.

SPI_EVENT_QUEUE

Event Queue that contains the pending non-blocking SPI requests

SPI_SEM

Semaphore that is signalled for every completed SPI request

SPI_SETTINGS

TODO: Remove SPI settings for ST7789 display controller

SPI_TASK

SPI Task that will send each SPI request sequentially

SPI_TASK_STACK

Stack space for SPI Task, initialised to 0.

SPI_THROTTLE_SEM

Semaphore that throttles the number of queued SPI requests

Functions

delay_ms

Sleep for the specified number of milliseconds

hal_watchdog_tickle

Tickles the watchdog so that the Watchdog Timer doesn't expire. This needs to be done periodically, before the value configured in hal_watchdog_init() expires.

internal_spi_noblock_write

Perform non-blocking SPI write in Mynewt OS. Blocks until SPI write completes.

spi_event_callback

Callback for the event that is triggered when an SPI request is added to the queue.

spi_noblock_handler

Called by interrupt handler after Non-blocking SPI transfer has completed

spi_noblock_init

Init non-blocking SPI transfer

spi_noblock_write

Enqueue request for non-blocking SPI write. Returns without waiting for write to complete. Request must have a Command Byte, followed by optional Data Bytes.

spi_noblock_write_command

Set pending request for non-blocking SPI write for Command Byte. Returns without waiting for write to complete.

spi_noblock_write_data

Set pending request for non-blocking SPI write for Data Bytes. Returns without waiting for write to complete.

spi_noblock_write_flush

Enqueue any pending request for non-blocking SPI write for Command Byte and Data Bytes. Returns without waiting for write to complete.

spi_task_func

SPI Task Function. Execute sequentially each SPI request posted to our Event Queue. When there are no requests to process, block until one arrives.

Type Definitions

PendingCmdSize

Max size of pending Command Bytes

PendingDataSize

Max size of pending Data Bytes