|
CardSight 0.1.0
C API reference for the CardSight firmware and application
|
Public application state and the request message the UI sends. More...
#include "storage/storage_proxy.h"#include <hal/blkdev.h>#include <hal/mmc/core.h>#include <vfs.h>Go to the source code of this file.
Data Structures | |
| struct | cardsight_file_entry |
| One directory entry shown in the file browser. More... | |
| struct | cardsight_file_list |
| The listing of one directory, valid or carrying the error that prevented it. More... | |
| struct | cardsight_request |
| One request queued to the worker task. More... | |
| struct | cardsight_state |
| Everything the worker publishes to the UI. More... | |
Macros | |
| #define | APP_LAYOUT_MAX 8U |
| Maximum number of partitions a layout request may describe. | |
| #define | APP_FILE_ENTRIES 64U |
| Number of directory entries the browser keeps. | |
| #define | APP_FILE_NAME 128U |
| Longest file name, including the terminating NUL, held in a listing. | |
Enumerations | |
| enum | cardsight_request_type { CARDSIGHT_REQUEST_SCAN , CARDSIGHT_REQUEST_START_DIRECT , CARDSIGHT_REQUEST_START_PROXY , CARDSIGHT_REQUEST_STOP , CARDSIGHT_REQUEST_FORMAT , CARDSIGHT_REQUEST_LAYOUT , CARDSIGHT_REQUEST_LIST } |
| Operation the worker can be asked to perform; one is in flight at a time. More... | |
Functions | |
| void | cardsight_app_init (void) |
| Initialise the state, the locks and the worker task. | |
| void | cardsight_snapshot (struct cardsight_state *state) |
| Copy the shared state for the UI to render. | |
| void | send_request (const struct cardsight_request *request) |
| Queue one request for the worker. | |
Public application state and the request message the UI sends.
The UI thread only reads a snapshot of cardsight_state and submits requests; the worker task in app.c performs every card operation. The types here are the contract between the two.
| #define APP_FILE_ENTRIES 64U |
Number of directory entries the browser keeps.
The browser keeps one screenful of names; larger directories report how many were left out.
Operation the worker can be asked to perform; one is in flight at a time.
| void cardsight_snapshot | ( | struct cardsight_state * | state | ) |
Copy the shared state for the UI to render.
| [out] | state | Destination snapshot; running is refreshed from the USB driver at copy time. |
| void send_request | ( | const struct cardsight_request * | request | ) |
Queue one request for the worker.
| [in] | request | Request to copy into the queue; ignored when the worker is busy or the queue is full. |