CANpie FD
CAN programming interface environment - Version 3.08
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Modules Pages
demo_buffer_config.c

//============================================================================//
// File: demo_buffer_config.c //
// Description: Example for CANpie message buffer configuration //
// //
// Copyright 2017 MicroControl GmbH & Co. KG //
// 53844 Troisdorf - Germany //
// www.microcontrol.net //
// //
//----------------------------------------------------------------------------//
// Redistribution and use in source and binary forms, with or without //
// modification, are permitted provided that the following conditions //
// are met: //
// 1. Redistributions of source code must retain the above copyright //
// notice, this list of conditions, the following disclaimer and //
// the referenced file 'LICENSE'. //
// 2. Redistributions in binary form must reproduce the above copyright //
// notice, this list of conditions and the following disclaimer in the //
// documentation and/or other materials provided with the distribution. //
// 3. Neither the name of MicroControl nor the names of its contributors //
// may be used to endorse or promote products derived from this software //
// without specific prior written permission. //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
// You may obtain a copy of the License at //
// //
// http://www.apache.org/licenses/LICENSE-2.0 //
// //
// Unless required by applicable law or agreed to in writing, software //
// distributed under the License is distributed on an "AS IS" BASIS, //
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //
// See the License for the specific language governing permissions and //
// limitations under the License. //
//============================================================================//
#include "cp_core.h"
#include "cp_msg.h"
//----------------------------------------------------------------------------//
// DemoReceiveBufferConfiguration() //
// //
//----------------------------------------------------------------------------//
void DemoReceiveBufferConfiguration(CpPort_ts * ptsCanPortV)
{
//----------------------------------------------------------------
// set message buffer 2 as receive buffer for classic CAN frame
// with Standard Identifier 211h
//
CpCoreBufferConfig(ptsCanPortV,
(uint32_t) 0x211,
//----------------------------------------------------------------
// set message buffer 3 as receive buffer for classic CAN frame
// with Extended Identifier 18EEFF00h
//
CpCoreBufferConfig(ptsCanPortV,
(uint32_t) 0x18EEFF00,
}
//----------------------------------------------------------------------------//
// DemoTransmitBufferConfiguration() //
// //
//----------------------------------------------------------------------------//
void DemoTransmitBufferConfiguration(CpPort_ts * ptsCanPortV)
{
//----------------------------------------------------------------
// set message buffer 1 as transmit buffer for classic CAN frame
// with Standard Identifier 123h, DLC = 4
//
(uint32_t) 0x123,
CpCoreBufferSetDlc(ptsCanPortV, eCP_BUFFER_1, 4);
}




CpCoreBufferConfig
CpStatus_tv CpCoreBufferConfig(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, uint32_t ulIdentifierV, uint32_t ulAcceptMaskV, uint8_t ubFormatV, uint8_t ubDirectionV)
Initialise message buffer.
cp_msg.h
CANpie message access
cp_core.h
CANpie core functions.
eCP_BUFFER_1
@ eCP_BUFFER_1
Definition: canpie.h:898
CP_MASK_STD_FRAME
#define CP_MASK_STD_FRAME
Definition: canpie.h:297
CpCoreBufferSetDlc
CpStatus_tv CpCoreBufferSetDlc(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, uint8_t ubDlcV)
Set DLC of specified buffer.
eCP_BUFFER_DIR_RCV
@ eCP_BUFFER_DIR_RCV
Definition: canpie.h:937
CP_MSG_FORMAT_CBFF
#define CP_MSG_FORMAT_CBFF
Definition: canpie.h:414
CP_MASK_EXT_FRAME
#define CP_MASK_EXT_FRAME
Definition: canpie.h:308
eCP_BUFFER_3
@ eCP_BUFFER_3
Definition: canpie.h:904
eCP_BUFFER_2
@ eCP_BUFFER_2
Definition: canpie.h:901
eCP_BUFFER_DIR_TRM
@ eCP_BUFFER_DIR_TRM
Definition: canpie.h:940
CP_MSG_FORMAT_CEFF
#define CP_MSG_FORMAT_CEFF
Definition: canpie.h:425