Loading...
Searching...
No Matches

Definitions of CAN device interface. More...

Detailed Description

Definitions of CAN device interface.

Author
Vincent Dupont vince.nosp@m.nt@o.nosp@m.takey.nosp@m.s.co.nosp@m.m
Toon Stegen toon..nosp@m.steg.nosp@m.en@al.nosp@m.tran.nosp@m..com

Definition in file device.h.

#include "can/candev.h"
#include "sched.h"
+ Include dependency graph for device.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  candev_params
 Parameters to initialize a candev. More...
 
struct  candev_dev
 candev descriptor to pass to the device thread More...
 
#define CAN_MAX_RATE_ERROR   (50) /* 5 % */
 Maximum bit-rate error allowed when computing bittimings in tenth of percent.
 
#define CAN_DLL_NUMOF   (1)
 Maximum number of interfaces which can be registered on DLL.
 
typedef struct candev_params candev_params_t
 Parameters to initialize a candev.
 
typedef struct candev_dev candev_dev_t
 candev descriptor to pass to the device thread
 
kernel_pid_t can_device_init (char *stack, int stacksize, char priority, const char *name, candev_dev_t *params)
 Initialize a CAN device thread.
 
int can_device_calc_bittiming (uint32_t clock, const struct can_bittiming_const *timing_const, struct can_bittiming *bittiming)
 Fill in a bittiming structure from bittiming->bitrate and timing_const.
 

Macro Definition Documentation

◆ CAN_DLL_NUMOF

#define CAN_DLL_NUMOF   (1)

Maximum number of interfaces which can be registered on DLL.

Definition at line 49 of file device.h.

◆ CAN_MAX_RATE_ERROR

#define CAN_MAX_RATE_ERROR   (50) /* 5 % */

Maximum bit-rate error allowed when computing bittimings in tenth of percent.

Definition at line 42 of file device.h.

Function Documentation

◆ can_device_calc_bittiming()

int can_device_calc_bittiming ( uint32_t  clock,
const struct can_bittiming_const timing_const,
struct can_bittiming bittiming 
)

Fill in a bittiming structure from bittiming->bitrate and timing_const.

Parameters
[in]clockthe clock of the CAN controller
[in]timing_constthe timing parameter of the CAN controller
[in,out]bittimingthe calculated bittiming (bitrate field must be set)
Returns
0 on success
< 0 on error

◆ can_device_init()

kernel_pid_t can_device_init ( char *  stack,
int  stacksize,
char  priority,
const char *  name,
candev_dev_t params 
)

Initialize a CAN device thread.

This function sets up a CAN device thread

Parameters
[in]stackthe device thread stack
[in]stacksizethe device thread stack size
[in]prioritythe device thread priority
[in]namethe device thread name
[in]paramsthe parameters containing the device pointer and the ifnum
Returns
the pid of the created thread