HardFOC Core
API reference
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
CO_driver_target.h File Reference

CANopenNode v4 target definitions for the generic HardFOC driver (CO_driver_hardfoc.c). More...

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "hf_co_driver.h"

Go to the source code of this file.

Classes

struct  CO_CANrxMsg_t
 
struct  CO_CANrx_t
 
struct  CO_CANtx_t
 
struct  CO_CANmodule_t
 
struct  CO_storage_entry_t
 

Macros

#define CO_LITTLE_ENDIAN
 
#define CO_SWAP_16(x)   (x)
 
#define CO_SWAP_32(x)   (x)
 
#define CO_SWAP_64(x)   (x)
 
#define CO_CAN_MAX_LEN   HF_CO_CAN_MAX_LEN
 
#define CO_CANrxMsg_readIdent(msg)   ((uint16_t)(((const CO_CANrxMsg_t*)(msg))->ident & 0x07FFU))
 
#define CO_CANrxMsg_readDLC(msg)   (((const CO_CANrxMsg_t*)(msg))->dlc)
 
#define CO_CANrxMsg_readData(msg)   (((const CO_CANrxMsg_t*)(msg))->data)
 
#define CO_LOCK_CAN_SEND(CAN_MODULE)   hf_co_lock(CAN_MODULE)
 
#define CO_UNLOCK_CAN_SEND(CAN_MODULE)   hf_co_unlock(CAN_MODULE)
 
#define CO_LOCK_EMCY(CAN_MODULE)   hf_co_lock(CAN_MODULE)
 
#define CO_UNLOCK_EMCY(CAN_MODULE)   hf_co_unlock(CAN_MODULE)
 
#define CO_LOCK_OD(CAN_MODULE)   hf_co_lock(CAN_MODULE)
 
#define CO_UNLOCK_OD(CAN_MODULE)   hf_co_unlock(CAN_MODULE)
 
#define CO_MemoryBarrier()   __sync_synchronize()
 
#define CO_FLAG_READ(rxNew)   ((rxNew) != NULL)
 
#define CO_FLAG_SET(rxNew)
 
#define CO_FLAG_CLEAR(rxNew)
 

Typedefs

typedef uint_fast8_t bool_t
 
typedef float float32_t
 
typedef double float64_t
 

Functions

void hf_co_lock (CO_CANmodule_t *CANmodule)
 
void hf_co_unlock (CO_CANmodule_t *CANmodule)
 

Detailed Description

CANopenNode v4 target definitions for the generic HardFOC driver (CO_driver_hardfoc.c).

This directory is on the include path instead of CANopenNode's example/, so the stack picks this file up. It provides:

SPDX-License-Identifier: GPL-3.0-or-later

Macro Definition Documentation

◆ CO_CAN_MAX_LEN

#define CO_CAN_MAX_LEN   HF_CO_CAN_MAX_LEN

Payload bytes of every CANopenNode RX/TX buffer.

◆ CO_CANrxMsg_readData

#define CO_CANrxMsg_readData (   msg)    (((const CO_CANrxMsg_t*)(msg))->data)

◆ CO_CANrxMsg_readDLC

#define CO_CANrxMsg_readDLC (   msg)    (((const CO_CANrxMsg_t*)(msg))->dlc)

◆ CO_CANrxMsg_readIdent

#define CO_CANrxMsg_readIdent (   msg)    ((uint16_t)(((const CO_CANrxMsg_t*)(msg))->ident & 0x07FFU))

◆ CO_FLAG_CLEAR

#define CO_FLAG_CLEAR (   rxNew)
Value:
do { \
CO_MemoryBarrier(); \
(rxNew) = NULL; \
} while (0)

◆ CO_FLAG_READ

#define CO_FLAG_READ (   rxNew)    ((rxNew) != NULL)

◆ CO_FLAG_SET

#define CO_FLAG_SET (   rxNew)
Value:
do { \
CO_MemoryBarrier(); \
(rxNew) = (void*)1L; \
} while (0)

◆ CO_LITTLE_ENDIAN

#define CO_LITTLE_ENDIAN

◆ CO_LOCK_CAN_SEND

#define CO_LOCK_CAN_SEND (   CAN_MODULE)    hf_co_lock(CAN_MODULE)

◆ CO_LOCK_EMCY

#define CO_LOCK_EMCY (   CAN_MODULE)    hf_co_lock(CAN_MODULE)

◆ CO_LOCK_OD

#define CO_LOCK_OD (   CAN_MODULE)    hf_co_lock(CAN_MODULE)

◆ CO_MemoryBarrier

#define CO_MemoryBarrier ( )    __sync_synchronize()

◆ CO_SWAP_16

#define CO_SWAP_16 (   x)    (x)

◆ CO_SWAP_32

#define CO_SWAP_32 (   x)    (x)

◆ CO_SWAP_64

#define CO_SWAP_64 (   x)    (x)

◆ CO_UNLOCK_CAN_SEND

#define CO_UNLOCK_CAN_SEND (   CAN_MODULE)    hf_co_unlock(CAN_MODULE)

◆ CO_UNLOCK_EMCY

#define CO_UNLOCK_EMCY (   CAN_MODULE)    hf_co_unlock(CAN_MODULE)

◆ CO_UNLOCK_OD

#define CO_UNLOCK_OD (   CAN_MODULE)    hf_co_unlock(CAN_MODULE)

Typedef Documentation

◆ bool_t

typedef uint_fast8_t bool_t

◆ float32_t

typedef float float32_t

◆ float64_t

typedef double float64_t

Function Documentation

◆ hf_co_lock()

void hf_co_lock ( CO_CANmodule_t *  CANmodule)

Take / release the CANmodule lock (recursive; never held across a blocking call).

◆ hf_co_unlock()

void hf_co_unlock ( CO_CANmodule_t *  CANmodule)