| Kinetis SDK v.2.0 API Reference Manual Rev. 0 Freescale Semiconductor, Inc.

- Main Page
- Related Pages
- API Reference

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Files | Data Structures | Typedefs
FlexCAN eDMA Driver
FlexCAN: Flex Controller Area Network Driver

## Overview

## Files
file | fsl_flexcan_edma.h

## Data Structures
struct | flexcan_edma_handle_t
| FlexCAN eDMA handle. More...

## Typedefs
typedef void(* | flexcan_edma_transfer_callback_t )(CAN_Type *base, flexcan_edma_handle_t *handle, status_t status, void *userData)
| FlexCAN transfer callback function. More...

## eDMA transactional
void | FLEXCAN_TransferCreateHandleEDMA (CAN_Type *base, flexcan_edma_handle_t *handle, flexcan_edma_transfer_callback_t callback, void *userData, edma_handle_t *rxFifoEdmaHandle)
| Initializes the FlexCAN handle, which is used in transactional functions. More...
status_t | FLEXCAN_TransferReceiveFifoEDMA (CAN_Type *base, flexcan_edma_handle_t *handle, flexcan_fifo_transfer_t *xfer)
| Receives the CAN Message from the Rx FIFO using eDMA. More...
void | FLEXCAN_TransferAbortReceiveFifoEDMA (CAN_Type *base, flexcan_edma_handle_t *handle)
| Aborts the receive process which used eDMA. More...

## Data Structure Documentation

struct _flexcan_edma_handle

### Data Fields
flexcan_edma_transfer_callback_t | callback
| Callback function. More...
void * | userData
| FlexCAN callback function parameter. More...
edma_handle_t * | rxFifoEdmaHandle
| The EDMA Rx FIFO channel used. More...
volatile uint8_t | rxFifoState
| Rx FIFO transfer state. More...

#### Field Documentation

flexcan_edma_transfer_callback_t flexcan_edma_handle_t::callback

void* flexcan_edma_handle_t::userData

edma_handle_t* flexcan_edma_handle_t::rxFifoEdmaHandle

volatile uint8_t flexcan_edma_handle_t::rxFifoState

## Typedef Documentation

typedef void(* flexcan_edma_transfer_callback_t)(CAN_Type *base, flexcan_edma_handle_t *handle, status_t status, void *userData)

## Function Documentation

void FLEXCAN_TransferCreateHandleEDMA | ( | CAN_Type * | base,
|  | flexcan_edma_handle_t * | handle,
|  | flexcan_edma_transfer_callback_t | callback,
|  | void * | userData,
|  | edma_handle_t * | rxFifoEdmaHandle
| ) |  |

Parameters

  base | FlexCAN peripheral base address.
  handle | Pointer to flexcan_edma_handle_t structure.
  callback | The callback function.
  userData | The parameter of the callback function.
  rxFifoEdmaHandle | User-requested DMA handle for Rx FIFO DMA transfer.

status_t FLEXCAN_TransferReceiveFifoEDMA | ( | CAN_Type * | base,
|  | flexcan_edma_handle_t * | handle,
|  | flexcan_fifo_transfer_t * | xfer
| ) |  |

This function receives the CAN Message using eDMA. This is a non-blocking function, which returns right away. After the CAN Message is received, the receive callback function is called.

Parameters

  base | FlexCAN peripheral base address.
  handle | Pointer to flexcan_edma_handle_t structure.
  xfer | FlexCAN Rx FIFO EDMA transfer structure, see flexcan_fifo_transfer_t.

Return values

  kStatus_Success | if succeed, others failed.
  kStatus_FLEXCAN_RxFifoBusy | Previous transfer ongoing.

void FLEXCAN_TransferAbortReceiveFifoEDMA | ( | CAN_Type * | base,
|  | flexcan_edma_handle_t * | handle
| ) |  |

This function aborts the receive process which used eDMA.

Parameters

  base | FlexCAN peripheral base address.
  handle | Pointer to flexcan_edma_handle_t structure.