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:
#include "FreeRTOS_IO.h"
void vAFunction( void )
{
Peripheral_Descriptor_t xOpenedPort;
xOpenedPort = FreeRTOS_open( "/SPI2/", NULL );
if( xOpenedPort != NULL )
{
. . .
}
else
{
}
}
FreeRTOS_open() example
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.