Embedded System Design 2 - Project
|
LEUART (serial communication) functionality required by the RN2483 LoRa modem. More...
#include <stdint.h>
#include <stdbool.h>
#include "em_device.h"
#include "em_chip.h"
#include "em_cmu.h"
#include "em_gpio.h"
#include "em_leuart.h"
#include "em_dma.h"
#include "dmactrl.h"
#include "leuart.h"
#include "delay.h"
#include "pin_mapping.h"
#include "debug_dbprint.h"
#include "util_string.h"
#include "util.h"
Go to the source code of this file.
Macros | |
#define | DBPRINT_TIMEOUT 0 |
#define | TIMEOUT_SYNC 80 |
#define | TIMEOUT_DMA 50000 |
#define | TIMEOUT_SENDCMD 40000 |
#define | TIMEOUT_WAITRESPONSE 2000000 /* Depends on spreading factor! */ |
#define | DMA_CHANNEL_TX 0 /* DMA channel is 0 */ |
#define | DMA_CHANNEL_RX 1 |
#define | DMA_CHANNELS 2 |
Functions | |
void | Leuart_ClearBuffers (void) |
static void | basicTxComplete (unsigned int channel, bool primary, void *user) |
static void | basicRxComplete (unsigned int channel, bool primary, void *user) |
static bool | Leuart_ResponseAvailable (void) |
void | setupDma (void) |
static void | sendLeuartData (char *buffer, uint8_t bufferLength) |
static void | setupLeuart (void) |
void | Leuart_Init (void) |
void | Leuart_Reinit (void) |
void | Leuart_BreakCondition (void) |
void | Leuart_ReadResponse (char *buffer, uint8_t bufferLength) |
void | Leuart_SendData (char *buffer, uint8_t bufferLength) |
Leuart_Status_t | Leuart_SendCommand (char *cb, uint8_t cbl, volatile bool *wakeUp) |
Leuart_Status_t | Leuart_WaitForResponse () |
Variables | |
static DMA_CB_TypeDef | dmaCallBack [2] |
char | receiveBuffer [50] |
volatile uint8_t | bufferPointer = 0 |
volatile bool | receiveComplete = false |
LEUART (serial communication) functionality required by the RN2483 LoRa modem.
Definition in file leuart.c.
#define DBPRINT_TIMEOUT 0 |
#define TIMEOUT_WAITRESPONSE 2000000 /* Depends on spreading factor! */ |
|
static |
|
static |
void Leuart_BreakCondition | ( | void | ) |
Definition at line 342 of file leuart.c.
void Leuart_Init | ( | void | ) |
Definition at line 306 of file leuart.c.
void Leuart_ReadResponse | ( | char * | buffer, |
uint8_t | bufferLength | ||
) |
void Leuart_Reinit | ( | void | ) |
Definition at line 323 of file leuart.c.
Leuart_Status_t Leuart_SendCommand | ( | char * | cb, |
uint8_t | cbl, | ||
volatile bool * | wakeUp | ||
) |
Send a command string over the LEUART. "wakeUp" IS NOT USED
Definition at line 392 of file leuart.c.
void Leuart_SendData | ( | char * | buffer, |
uint8_t | bufferLength | ||
) |
Definition at line 358 of file leuart.c.
Leuart_Status_t Leuart_WaitForResponse | ( | ) |
Definition at line 430 of file leuart.c.
|
static |
Definition at line 199 of file leuart.c.
void setupDma | ( | void | ) |
Definition at line 130 of file leuart.c.