picoos-micro  1.xxxx
Data Structures
μ-layer API

Data Structures

struct  uosFileInfo
void uosInit (void)
void uosBootDiag (void)
void uosResourceDiag (void)
void uosSpinInit (void)
void uosSpinUSecs (uint16_t uSecs)
typedef struct uosFileInfo UosFileInfo
typedef struct uosFileConf UosFileConf
typedef struct uosFSConf UosFSConf
typedef struct uosDiskConf UosDiskConf
typedef struct uosDisk UosDisk
typedef struct uosFS UosFS
typedef struct uosFile UosFile
typedef struct uosMmcSpiConf UosMmcSpiConf
typedef struct uosMmcDisk UosMmcDisk
void uosFileInit (void)
int uosFile2Slot (UosFile *file)
UosFileuosSlot2File (int fd)
int uosMount (const UosFS *mount)
UosFileuosFileAlloc (void)
int uosFileFree (UosFile *file)
UosFileuosFileOpen (const char *fileName, int flags, int mode)
int uosFileRead (UosFile *file, char *buf, int max)
int uosFileWrite (UosFile *file, const char *buf, int len)
int uosFileClose (UosFile *file)
int uosFileStat (const char *filename, UosFileInfo *st)
int uosFileFStat (UosFile *file, UosFileInfo *st)
int uosFileSeek (UosFile *file, int offset, int whence)
int uosFileUnlink (const char *filename)
int uosFileSync (UosFile *file)
int uosAddDisk (const UosDisk *disk)
const UosDiskuosGetDisk (int diskNumber)
int uosMountFat (const char *mountPoint, int diskNumber)
void uosMmcSpiXmit (const UosMmcDisk *, const uint8_t *data, int len)
void uosMmcSpiRcvr (const UosMmcDisk *, uint8_t *data, int len)
int uosMountRom (const char *mountPoint, const UosRomFile *data)
UosRing * uosRingCreate (int msgSize, int msgCount)
bool uosRingPut (UosRing *ring, const void *msg, UINT_t timeout)
bool uosRingGet (UosRing *ring, void *msg, UINT_t timeout)
void uosRingDestroy (UosRing *ring)
typedef struct _uosConfigKeyValue UosConfigKeyValue
typedef int(* UosConfigSaver) (void *context, const char *key, const char *value)
const char * uosConfigGet (const char *key)
const char * uosConfigSet (const char *key, const char *value)
void uosConfigInit (void)
int uosConfigSaveEntries (void *context, UosConfigSaver saver)
int uosConfigSave (const char *filename)
int uosConfigLoad (const char *filename)

Detailed Description

Typedef Documentation

§ UosFileInfo

typedef struct uosFileInfo UosFileInfo

File information.

§ UosFileConf

typedef struct uosFileConf UosFileConf

Config for file operations. Provides function pointers for common operations like read, write & close.

§ UosFSConf

typedef struct uosFSConf UosFSConf

Config for filesystem type. Provides function pointers for fs operations like open & unlink.

§ UosDiskConf

typedef struct uosDiskConf UosDiskConf

Config for disk drives. Provides function pointers for disk access.

§ UosDisk

typedef struct uosDisk UosDisk

Structure for disk drives.

§ UosFS

typedef struct uosFS UosFS

Mount table entry.

§ UosFile

typedef struct uosFile UosFile

Structure for open file descriptor.

§ UosMmcSpiConf

typedef struct uosMmcSpiConf UosMmcSpiConf

Config for MMC/SD card SPI.

§ UosMmcDisk

typedef struct uosMmcDisk UosMmcDisk

Disk using MMC/SD card via SPI bus.

§ UosConfigKeyValue

Config data in memory is currently a linked list.

§ UosConfigSaver

typedef int(* UosConfigSaver) (void *context, const char *key, const char *value)

Callback function used by uosConfigSaveEntries.

Function Documentation

§ uosInit()

void uosInit ( void  )

Initialize μ-layer. Must be called before any other API function.

§ uosBootDiag()

void uosBootDiag ( void  )

Print memory sizes and required copyright messages when system starts.

§ uosResourceDiag()

void uosResourceDiag ( void  )

Print information about resource usage. Currently output includes free stack space for each task, free interrupt stack space and number of tasks and events in use.

§ uosSpinInit()

void uosSpinInit ( void  )

Initialize possible hardware timer for uosSpinUSecs. Called internally by uosInit().

§ uosSpinUSecs()

void uosSpinUSecs ( uint16_t  uSecs)

Spin in loop until requested number of microseconds have passed. Uses either hardware timer or delay loop depending of UOSCFG_SPIN_USECS setting.

§ uosFileInit()

void uosFileInit ( void  )

Initialize fs layer. Called automatically by uosInit().

§ uosFile2Slot()

int uosFile2Slot ( UosFile file)

Convert file object into traditional fd number.

§ uosSlot2File()

UosFile* uosSlot2File ( int  fd)

Convert traditional fd number into file object.

§ uosMount()

int uosMount ( const UosFS mount)

Perform internal filesystem mount.

§ uosFileAlloc()

UosFile* uosFileAlloc ( void  )

Allocate file descriptor (internal use only).

§ uosFileFree()

int uosFileFree ( UosFile file)

Free file descriptor (internal use only).

§ uosFileOpen()

UosFile* uosFileOpen ( const char *  fileName,
int  flags,
int  mode 

Open file from mounted filesystem.

§ uosFileRead()

int uosFileRead ( UosFile file,
char *  buf,
int  max 

Read from file.

§ uosFileWrite()

int uosFileWrite ( UosFile file,
const char *  buf,
int  len 

Write to file.

§ uosFileClose()

int uosFileClose ( UosFile file)

Close file.

§ uosFileStat()

int uosFileStat ( const char *  filename,
UosFileInfo st 

Get file information.

§ uosFileFStat()

int uosFileFStat ( UosFile file,
UosFileInfo st 

Get file information.

§ uosFileSeek()

int uosFileSeek ( UosFile file,
int  offset,
int  whence 


§ uosFileUnlink()

int uosFileUnlink ( const char *  filename)

Remove file.

§ uosFileSync()

int uosFileSync ( UosFile file)

Flush file to disk.

§ uosAddDisk()

int uosAddDisk ( const UosDisk disk)

Add a known disk. Returns disk number.

§ uosGetDisk()

const UosDisk* uosGetDisk ( int  diskNumber)

Get disk by drive number.

§ uosMountFat()

int uosMountFat ( const char *  mountPoint,
int  diskNumber 

Mount a fat filesystem.

§ uosMmcSpiXmit()

void uosMmcSpiXmit ( const UosMmcDisk ,
const uint8_t *  data,
int  len 

Simple implementation of SPI block transmit.

§ uosMmcSpiRcvr()

void uosMmcSpiRcvr ( const UosMmcDisk ,
uint8_t *  data,
int  len 

Simple implementation of SPI block receive.

§ uosMountRom()

int uosMountRom ( const char *  mountPoint,
const UosRomFile *  data 

Mount a rom filesystem.

§ uosRingCreate()

UosRing* uosRingCreate ( int  msgSize,
int  msgCount 

Create new ring buffer mailbox.

§ uosRingPut()

bool uosRingPut ( UosRing *  ring,
const void *  msg,
UINT_t  timeout 

Put a message to ring buffer. Waits for timeout ticks if there is not room. If called from interrupt handler, timeout must be set to zero (don't wait).

§ uosRingGet()

bool uosRingGet ( UosRing *  ring,
void *  msg,
UINT_t  timeout 

Get a message from ring buffer. Waits for timeout ticks until there is a message available. If timeout occurs, function returns false.

§ uosRingDestroy()

void uosRingDestroy ( UosRing *  ring)

Destroy a ring buffer mailbox.

§ uosConfigGet()

const char* uosConfigGet ( const char *  key)

Get config entry. Returned pointer can be assumed to be valid after call (once key has been allocated, it's place in memory does not change).

§ uosConfigSet()

const char* uosConfigSet ( const char *  key,
const char *  value 

Set config entry by modifying previously set value or by allocating new entry.

§ uosConfigInit()

void uosConfigInit ( void  )

Initialize config system. Must be called before any other uosConfig* function.

§ uosConfigSaveEntries()

int uosConfigSaveEntries ( void *  context,
UosConfigSaver  saver 

Save all key-value pairs that have been set. Function performs callback to 'saver' for each pair and assumes that callback function takes care of actual saving (to file, flash or whatever is suitable for current environment).

§ uosConfigSave()

int uosConfigSave ( const char *  filename)

Save config entries to file.

§ uosConfigLoad()

int uosConfigLoad ( const char *  filename)

Load config entries from file.