Download FreeRTOS
 

Quality RTOS & Embedded Software

LIBRARIES
WHAT'S NEW
Simplifying Authenticated Cloud Connectivity for Any Device.
Designing an energy efficient and cloud-connected IoT solution with CoAP.
Introducing FreeRTOS Kernel version 11.0.0:
FreeRTOS Roadmap and Code Contribution process.
OPC-UA over TSN with FreeRTOS.

FreeRTOS_open()

[FreeRTOS-Plus-IO API]

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

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

Parameters:

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-Plus-IO developments.
Returns:

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-Plus-IO includes. */
#include "FreeRTOS_IO.h"

void vAFunction( void )
{
/* The Peripheral_Descriptor_t type is the FreeRTOS-Plus-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-Plus-IO API functions. */


. . .
}
else
{
/* The port was not opened successfully. */
}
}

FreeRTOS_open() example
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.