Hilscher netX microcontroller driver  V0.0.5.0
Documentation of the netX driver package
netx_drv_canctrl.c File Reference

CAN controller module driver. More...

#include "netx_drv_user_conf.h"
#include "netx_drv_canctrl.h"
Include dependency graph for netx_drv_canctrl.c:

Go to the source code of this file.

Macros

#define HW_PTR_CANCTRL(var)
 
#define _HW_CONCAT(a, b)   a ## b
 
#define HW_MSK(bf)    _HW_CONCAT(MSK_NX90_, bf)
 
#define HW_SRT(bf)    _HW_CONCAT(SRT_NX90_, bf)
 
#define HW_DFLT_BF_VAL(bf)   _HW_CONCAT(DFLT_BF_VAL_NX90_, bf)
 
#define HW_DFLT_VAL(reg)    _HW_CONCAT(DFLT_VAL_NX90_, reg)
 
#define HW_REGADR(reg)    _HW_CONCAT(Adr_NX90_, reg)
 
#define HW_AREAADR(area)    _HW_CONCAT(Addr_NX90_, area)
 
#define HW_TYPE(area)    _HW_CONCAT(NX90_, area)
 
#define HAL_CANCTRL_CNT   2
 
#define HALDEF(name)   HALDEC(name)
 

Functions

DRV_CANCTRL_RESULT HALDEC() CanCtrl_EnterResetMode (unsigned int uiInst)
 
DRV_CANCTRL_RESULT HALDEC() CanCtrl_LeaveResetMode (unsigned int uiInst)
 
DRV_CANCTRL_RESULT HALDEC() CanCtrl_SetBaudrate (unsigned int uiInst, uint32_t ulBaudrate, unsigned int uOversampling)
 
DRV_CANCTRL_RESULT HALDEC() CanCtrl_SetSingleAcceptanceFilter (unsigned int uiInst, DRV_CANCTRL_SINGLEFILTER_T *ptFilter)
 
DRV_CANCTRL_RESULT HALDEC() CanCtrl_GetSingleAcceptanceFilter (unsigned int uiInst, DRV_CANCTRL_SINGLEFILTER_T *ptFilter)
 
DRV_CANCTRL_RESULT HALDEC() CanCtrl_SetDualAcceptanceFilter (unsigned int uiInst, DRV_CANCTRL_DUALFILTER_T *ptFilter)
 
DRV_CANCTRL_RESULT HALDEC() CanCtrl_GetDualAcceptanceFilter (unsigned int uiInst, DRV_CANCTRL_DUALFILTER_T *ptFilter)
 
DRV_CANCTRL_RESULT HALDEC() CanCtrl_EnterListenMode (unsigned int uiInst)
 
DRV_CANCTRL_RESULT HALDEC() CanCtrl_LeaveListenMode (unsigned int uiInst)
 
DRV_CANCTRL_RESULT HALDEC() CanCtrl_EnterSelftestMode (unsigned int uiInst)
 
DRV_CANCTRL_RESULT HALDEC() CanCtrl_LeaveSelftestMode (unsigned int uiInst)
 
DRV_CANCTRL_RESULT HALDEC() CanCtrl_SendMessage (unsigned int uiInst, DRV_CANCTRL_MESSAGE_T *ptMessage, bool fSingleShot, bool fSelfRx)
 
DRV_CANCTRL_RESULT HALDEC() CanCtrl_AbortMessage (unsigned int uiInst)
 
DRV_CANCTRL_RESULT HALDEC() CanCtrl_ReceiveMessage (unsigned int uiInst, DRV_CANCTRL_MESSAGE_T *ptMessage)
 
uint32_t HALDEC() CanCtrl_GetRxMessageCnt (unsigned int uiInst)
 
uint32_t HALDEC() CanCtrl_GetMode (unsigned int uiInst)
 
uint32_t HALDEC() CanCtrl_GetStatus (unsigned int uiInst)
 
uint32_t HALDEC() CanCtrl_GetAndClearIrqStatus (unsigned int uiInst)
 
DRV_CANCTRL_RESULT HALDEC() CanCtrl_SetIrqMask (unsigned int uiInst, uint32_t ulIrqMask)
 
uint32_t HALDEC() CanCtrl_GetIrqMask (unsigned int uiInst)
 
uint32_t HALDEC() CanCtrl_GetAndClearArblostStatus (unsigned int uiInst)
 
uint32_t HALDEC() CanCtrl_GetAndClearErrorCode (unsigned int uiInst)
 
DRV_CANCTRL_RESULT HALDEC() CanCtrl_SetWarningLimit (unsigned int uiInst, uint32_t ulLimit)
 
uint32_t HALDEC() CanCtrl_GetWarningLimit (unsigned int uiInst)
 
DRV_CANCTRL_RESULT HALDEC() CanCtrl_SetRxErrorCnt (unsigned int uiInst, uint32_t ulCnt)
 
uint32_t HALDEC() CanCtrl_GetRxErrorCnt (unsigned int uiInst)
 
DRV_CANCTRL_RESULT HALDEC() CanCtrl_SetTxErrorCnt (unsigned int uiInst, uint32_t ulCnt)
 
uint32_t HALDEC() CanCtrl_GetTxErrorCnt (unsigned int uiInst)
 
DRV_CANCTRL_RESULT HALDEC() CanCtrl_SetPrm (unsigned int uiInst, DRV_CANCTRL_PRM_E ePrmID, uint32_t ulPrmVal)
 
DRV_CANCTRL_RESULT HALDEC() CanCtrl_GetPrm (unsigned int uiInst, DRV_CANCTRL_PRM_E ePrmID, uint32_t *pulPrmVal)
 

Detailed Description

CAN controller module driver.

Warning
WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! The pad_ctrl has to be modified to use the can! The following lines of code has to be added at best to the main. It is necessary to gain the modification rights for the proper registers by reading and writing the asic access key and directly after this the pad_ctrl value of the pin shall be modified to the value 0x00000041. The following both lines of code show this by reading and wirting the key, followed by setting the value
((volatile unsigned int *) 0xff4012c0)[0] = ((volatile unsigned int *) 0xff4012c0)[0];
((volatile unsigned int *) 0xff401000)[47] = 0x41ull;
Revision
6592
Date
2019-12-17 14:14:57 +0100 (Di, 17 Dez 2019)
Note
Exclusion of Liability for this demo software: The following software is intended for and must only be used for reference and in an evaluation laboratory environment. It is provided without charge and is subject to alterations. There is no warranty for the software, to the extent permitted by applicable law. Except when otherwise stated in writing the copyright holders and/or other parties provide the software "as is" without warranty of any kind, either expressed or implied. Please refer to the Agreement in README_DISCLAIMER.txt, provided together with this file! By installing or otherwise using the software, you accept the terms of this Agreement. If you do not agree to the terms of this Agreement, then do not install or use the Software!

Definition in file netx_drv_canctrl.c.