Microchip® Advanced Software Framework

thirdparty/freertos/demo/avr32_uc3_example/serial/serial.c File Reference
#include <avr32/io.h>
#include "board.h"
#include "gpio.h"
#include "usart.h"
#include "FreeRTOS.h"
#include "queue.h"
#include "task.h"
#include "serial.h"
#include "conf_example.h"

Macros

#define serHANDLE   ( ( xComPortHandle ) 1 )
 
#define serINVALID_COMPORT_HANDLER   ( ( xComPortHandle ) 0 )
 
#define serINVALID_QUEUE   ( ( xQueueHandle ) 0 )
 
#define serNO_BLOCK   ( ( portTickType ) 0 )
 

Functions

static portBASE_TYPE prvUSART_ISR_NonNakedBehaviour (void)
 
static void vprvSerialCreateQueues (unsigned portBASE_TYPE uxQueueLength, xQueueHandle *pxRxedChars, xQueueHandle *pxCharsForTx)
 
void vSerialClose (xComPortHandle xPort)
 Close the serial port. More...
 
void vSerialPutString (xComPortHandle pxPort, const signed portCHAR *const pcString, unsigned portSHORT usStringLength)
 
static void vUSART_ISR (void)
 
signed portBASE_TYPE xSerialGetChar (xComPortHandle pxPort, signed portCHAR *pcRxedChar, portTickType xBlockTime)
 
xComPortHandle xSerialPortInitMinimal (unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength)
 
signed portBASE_TYPE xSerialPutChar (xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime)
 

Variables

static xQueueHandle xCharsForTx
 
static xQueueHandle xRxedChars
 

#define serHANDLE   ( ( xComPortHandle ) 1 )

Referenced by xSerialPortInitMinimal().

#define serINVALID_COMPORT_HANDLER   ( ( xComPortHandle ) 0 )

Referenced by xSerialPortInitMinimal().

#define serINVALID_QUEUE   ( ( xQueueHandle ) 0 )

Referenced by xSerialPortInitMinimal().

#define serNO_BLOCK   ( ( portTickType ) 0 )

Referenced by vSerialPutString().

static portBASE_TYPE prvUSART_ISR_NonNakedBehaviour ( void  )
static
static void vprvSerialCreateQueues ( unsigned portBASE_TYPE  uxQueueLength,
xQueueHandle pxRxedChars,
xQueueHandle pxCharsForTx 
)
static
void vSerialClose ( xComPortHandle  xPort)

Close the serial port.

Parameters
xPortThe handle of the usart to close

Referenced by v_com1shell_stopResources(), and v_tracedump_stopResources().

void vSerialPutString ( xComPortHandle  pxPort,
const signed portCHAR *const  pcString,
unsigned portSHORT  usStringLength 
)

References serNO_BLOCK, and xSerialPutChar().

static void vUSART_ISR ( void  )
static
signed portBASE_TYPE xSerialGetChar ( xComPortHandle  pxPort,
signed portCHAR *  pcRxedChar,
portTickType  xBlockTime 
)

References pdFALSE, pdTRUE, and xQueueReceive.

Referenced by portTASK_FUNCTION().

signed portBASE_TYPE xSerialPutChar ( xComPortHandle  pxPort,
signed portCHAR  cOutChar,
portTickType  xBlockTime 
)

References pdFAIL, pdPASS, and xQueueSend.

Referenced by portTASK_FUNCTION(), and vSerialPutString().

xQueueHandle xCharsForTx
static

Referenced by vprvSerialCreateQueues().

xQueueHandle xRxedChars
static

Referenced by vprvSerialCreateQueues().