Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Homepage FreeRTOS+ Products FreeRTOS Labs Integration Services Contact / Enquiries



Peripheral_Descriptor_t FreeRTOS_open( const int8_t *pcPath, const uint32_t ulFlags );

Opens a peripheral for use with FreeRTOS+IO. The board support package defines which peripherals are available on any particular platform.


pcPath   The text name of the peripheral being opened, as defined by the board support package.

ulFlags   Mode flags. This parameter is not currently used. It is included for two reasons - so the FreeRTOS_open() prototype complies with the standard open() prototype, and to ensure backward compatibility after future FreeRTOS+IO developments.

NULL if the peripheral could not be opened, otherwise a variable of type Peripheral_Descriptor_t that can be used to access the opened peripheral in future calls to FreeRTOS_read(), FreeRTOS_write() and FreeRTOS_ioctl().

Example usage:

/* FreeRTOS+IO includes. */
#include "FreeRTOS_IO.h"

void vAFunction( void )
/* The Peripheral_Descriptor_t type is the FreeRTOS+IO equivalent of a descriptor. */
Peripheral_Descriptor_t xOpenedPort;

    /* Open the SPI port identified in the board support package as using the
    path string "/SPI2/".  The second parameter is not currently used and can
    be set to anything, although, for future compatibility, it is recommended 
    that it is set to NULL. */
    xOpenedPort = FreeRTOS_open( "/SPI2/", NULL );

    if( xOpenedPort != NULL )
        /* xOpenedPort now contains a valid descriptor that can be used with
        other FreeRTOS+IO API functions. */
        . . .
        /* The port was not opened successfully. */
FreeRTOS_open() example

[ Back to the top ]    [ About FreeRTOS ]    [ FreeRTOS+ Sitemap ]    [ Main FreeRTOS Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.