NXP's driver library for LPC17xx, ported to mbed's online compiler. Not tested! I had to fix a lot of warings and found a couple of pretty obvious bugs, so the chances are there are more. Original: http://ics.nxp.com/support/documents/microcontrollers/zip/lpc17xx.cmsis.driver.library.zip

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

lpc17xx_can.h File Reference

lpc17xx_can.h File Reference

: Contains all macro definitions and function prototypes support for CAN firmware library on LPC17xx More...

Go to the source code of this file.

Data Structures

struct  CAN_PinCFG_Type
 Pin Configuration structure. More...
struct  CAN_MSG_Type
 CAN message object structure. More...
struct  FullCAN_Entry
 FullCAN Entry structure. More...
struct  SFF_Entry
 Standard ID Frame Format Entry structure. More...
struct  SFF_GPR_Entry
 Group of Standard ID Frame Format Entry structure. More...
struct  EFF_Entry
 Extended ID Frame Format Entry structure. More...
struct  EFF_GPR_Entry
 Group of Extended ID Frame Format Entry structure. More...
struct  AF_SectionDef
 Acceptance Filter Section Table structure. More...

Typedefs

typedef void( fnCANCbs_Type )()
 CAN call-back function type definitions.

Enumerations

enum  CAN_ID_FORMAT_Type { STD_ID_FORMAT = 0, EXT_ID_FORMAT = 1 }
 

CAN configuration structure.

More...
enum  AFLUT_ENTRY_Type
 

AFLUT Entry type definition.

More...
enum  CAN_FRAME_Type { DATA_FRAME = 0, REMOTE_FRAME = 1 }
 

Symbolic names for type of CAN message.

More...
enum  CAN_CTRL_STS_Type { CANCTRL_GLOBAL_STS = 0, CANCTRL_INT_CAP, CANCTRL_ERR_WRN, CANCTRL_STS }
 

CAN Control status definition.

More...
enum  CAN_CR_STS_Type { CANCR_TX_STS = 0, CANCR_RX_STS, CANCR_MS }
 

Central CAN status type definition.

More...
enum  CAN_INT_EN_Type {
  CANINT_RIE = 0, CANINT_TIE1, CANINT_EIE, CANINT_DOIE,
  CANINT_WUIE, CANINT_EPIE, CANINT_ALIE, CANINT_BEIE,
  CANINT_IDIE, CANINT_TIE2, CANINT_TIE3, CANINT_FCE
}
 

CAN interrupt enable type definition.

More...
enum  CAN_AFMODE_Type { CAN_Normal = 0, CAN_AccOff, CAN_AccBP, CAN_eFCAN }
 

Acceptance Filter Mode type definition.

More...
enum  CAN_MODE_Type {
  CAN_OPERATING_MODE = 0, CAN_RESET_MODE, CAN_LISTENONLY_MODE, CAN_SELFTEST_MODE,
  CAN_TXPRIORITY_MODE, CAN_SLEEP_MODE, CAN_RXPOLARITY_MODE, CAN_TEST_MODE
}
 

CAN Mode Type definition.

More...
enum  CAN_ERROR {
  CAN_OK = 1, CAN_OBJECTS_FULL_ERROR, CAN_FULL_OBJ_NOT_RCV, CAN_NO_RECEIVE_DATA,
  CAN_AF_ENTRY_ERROR, CAN_CONFLICT_ID_ERROR, CAN_ENTRY_NOT_EXIT_ERROR
}
 

Error values that functions can return.

More...

Functions

void CAN_Init (LPC_CAN_TypeDef *CANx, uint32_t baudrate)
 Initialize CAN peripheral with given baudrate.
void CAN_DeInit (LPC_CAN_TypeDef *CANx)
 CAN deInit.
Status CAN_SendMsg (LPC_CAN_TypeDef *CANx, CAN_MSG_Type *CAN_Msg)
 Send message data.
Status CAN_ReceiveMsg (LPC_CAN_TypeDef *CANx, CAN_MSG_Type *CAN_Msg)
 Receive message data.
CAN_ERROR FCAN_ReadObj (LPC_CANAF_TypeDef *CANAFx, CAN_MSG_Type *CAN_Msg)
 Receive FullCAN Object.
uint32_t CAN_GetCTRLStatus (LPC_CAN_TypeDef *CANx, CAN_CTRL_STS_Type arg)
 Get CAN Control Status.
uint32_t CAN_GetCRStatus (LPC_CANCR_TypeDef *CANCRx, CAN_CR_STS_Type arg)
 Get CAN Central Status.
void CAN_ModeConfig (LPC_CAN_TypeDef *CANx, CAN_MODE_Type mode, FunctionalState NewState)
 Enable/Disable CAN Mode.
void CAN_SetBaudRate (LPC_CAN_TypeDef *CANx, uint32_t baudrate)
 Setting CAN baud rate (bps)
void CAN_SetAFMode (LPC_CANAF_TypeDef *CANAFx, CAN_AFMODE_Type AFMode)
 Setting Acceptance Filter mode.
CAN_ERROR CAN_SetupAFLUT (LPC_CANAF_TypeDef *CANAFx, AF_SectionDef *AFSection)
 Setup Acceptance Filter Look-Up Table.
CAN_ERROR CAN_LoadFullCANEntry (LPC_CAN_TypeDef *CANx, uint16_t id)
 Load FullCAN entry into AFLUT.
CAN_ERROR CAN_LoadExplicitEntry (LPC_CAN_TypeDef *CANx, uint32_t id, CAN_ID_FORMAT_Type format)
 Add Explicit ID into AF Look-Up Table dynamically.
CAN_ERROR CAN_RemoveEntry (AFLUT_ENTRY_Type EntryType, uint16_t position)
 Remove AFLUT entry (FullCAN entry and Explicit Standard entry)
void CAN_SetupCBS (CAN_INT_EN_Type arg, fnCANCbs_Type *pnCANCbs)
 Install interrupt call-back function.
void CAN_IRQCmd (LPC_CAN_TypeDef *CANx, CAN_INT_EN_Type arg, FunctionalState NewState)
 Enable/Disable CAN Interrupt.
void CAN_IntHandler (LPC_CAN_TypeDef *CANx)
 Standard CAN interrupt handler, this function will check all interrupt status of CAN channels, then execute the call back function if they're already installed.

Detailed Description

: Contains all macro definitions and function prototypes support for CAN firmware library on LPC17xx

Version:
: 1.0
Date:
: 1.June.2009
Author:
: NguyenCao

Software that is described herein is for illustrative purposes only which provides customers with programming information regarding the products. This software is supplied "AS IS" without any warranties. NXP Semiconductors assumes no responsibility or liability for the use of the software, conveys no license or title under any patent, copyright, or mask work right to the product. NXP Semiconductors reserves the right to make changes in the software without notification. NXP Semiconductors also make no representation or warranty that such application will be suitable for the specified use without further testing or modification.

Definition in file lpc17xx_can.h.