#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 |
References pdFALSE, pdTRUE, portENTER_CRITICAL, portEXIT_CRITICAL, xQueueReceiveFromISR(), and xQueueSendFromISR.
Referenced by vUSART_ISR().
|
static |
References xCharsForTx, xQueueCreate(), and xRxedChars.
Referenced by xSerialPortInitMinimal().
void vSerialClose | ( | xComPortHandle | xPort | ) |
Close the serial port.
xPort | The 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 |
References portENTER_SWITCHING_ISR, portEXIT_SWITCHING_ISR, and prvUSART_ISR_NonNakedBehaviour().
Referenced by xSerialPortInitMinimal().
signed portBASE_TYPE xSerialGetChar | ( | xComPortHandle | pxPort, |
signed portCHAR * | pcRxedChar, | ||
portTickType | xBlockTime | ||
) |
References pdFALSE, pdTRUE, and xQueueReceive.
Referenced by portTASK_FUNCTION().
xComPortHandle xSerialPortInitMinimal | ( | unsigned portLONG | ulWantedBaud, |
unsigned portBASE_TYPE | uxQueueLength | ||
) |
Configure USART.
References usart_options_t::baudrate, configPBA_CLOCK_HZ, gpio_enable_module(), INTC_register_interrupt(), portENTER_CRITICAL, portEXIT_CRITICAL, serHANDLE, serINVALID_COMPORT_HANDLER, serINVALID_QUEUE, USART_1_STOPBIT, USART_GPIO_MAP, usart_init_rs232(), USART_NO_PARITY, USART_NORMAL_CHMODE, USART_OPTIONS, vprvSerialCreateQueues(), and vUSART_ISR().
Referenced by vAltStartComTestTasks().
signed portBASE_TYPE xSerialPutChar | ( | xComPortHandle | pxPort, |
signed portCHAR | cOutChar, | ||
portTickType | xBlockTime | ||
) |
References pdFAIL, pdPASS, and xQueueSend.
Referenced by portTASK_FUNCTION(), and vSerialPutString().
|
static |
Referenced by vprvSerialCreateQueues().
|
static |
Referenced by vprvSerialCreateQueues().