Loading...
Searching...
No Matches
raw.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016 OTA keys S.A.
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser General
5 * Public License v2.1. See the file LICENSE in the top level directory for more
6 * details.
7 */
8
24#ifndef CAN_RAW_H
25#define CAN_RAW_H
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#include "sched.h"
32#include "can/can.h"
33#include "can/common.h"
34#include "can/device.h"
35
36#ifdef MODULE_CAN_MBOX
37#include "mbox.h"
38#endif
39
40#ifdef MODULE_TRX
41#include "can/can_trx.h"
42#endif
43
47#define RAW_CAN_DEV_UNDEF (-1)
48
63int raw_can_send(int ifnum, const struct can_frame *frame, kernel_pid_t pid);
64
78int raw_can_abort(int ifnum, int handle);
79
95int raw_can_subscribe_rx(int ifnum, struct can_filter *filter, kernel_pid_t pid, void *param);
96
108int raw_can_unsubscribe_rx(int ifnum, struct can_filter *filter, kernel_pid_t pid, void *param);
109
121
131int raw_can_get_can_opt(int ifnum, can_opt_t *opt);
132
142int raw_can_set_can_opt(int ifnum, can_opt_t *opt);
143
144#if defined(MODULE_CAN_MBOX) || defined(DOXYGEN)
159int raw_can_send_mbox(int ifnum, const struct can_frame *frame, mbox_t *mbox);
160
178int raw_can_subscribe_rx_mbox(int ifnum, struct can_filter *filter, mbox_t *mbox, void *param);
179
191int raw_can_unsubscribe_rx_mbox(int ifnum, struct can_filter *filter, mbox_t *mbox, void *param);
192#endif
193
202int raw_can_power_down(int ifnum);
203
212int raw_can_power_up(int ifnum);
213
221int raw_can_get_ifnum_by_name(const char *name);
222
230const char *raw_can_get_name_by_ifnum(int ifnum);
231
241
257int raw_can_set_bitrate(int ifnum, uint32_t bitrate, uint32_t sample_point);
258
259#if defined(MODULE_CAN_TRX) || defined(DOXYGEN)
271int raw_can_set_trx(int ifnum, can_trx_t *trx);
272#endif
273
274#ifdef __cplusplus
275}
276#endif
277
278#endif /* CAN_RAW_H */
int raw_can_free_frame(can_rx_data_t *frame)
Free a received frame.
int raw_can_power_down(int ifnum)
Power down a given interface.
int raw_can_get_ifnum_by_name(const char *name)
Get the interface number of a given interface.
int raw_can_power_up(int ifnum)
Power up a given interface.
int raw_can_get_can_opt(int ifnum, can_opt_t *opt)
Get a CAN option opt from interface ifnum.
int raw_can_subscribe_rx(int ifnum, struct can_filter *filter, kernel_pid_t pid, void *param)
Subscribe to a CAN filter.
int raw_can_unsubscribe_rx_mbox(int ifnum, struct can_filter *filter, mbox_t *mbox, void *param)
Unsubscribe from reception for the given CAN filter and mbox.
int raw_can_unsubscribe_rx(int ifnum, struct can_filter *filter, kernel_pid_t pid, void *param)
Unsubscribe from reception for the given CAN filter on pid thread.
int raw_can_set_can_opt(int ifnum, can_opt_t *opt)
Set a CAN option opt to interface ifnum.
int raw_can_send(int ifnum, const struct can_frame *frame, kernel_pid_t pid)
Send a CAN frame.
int raw_can_abort(int ifnum, int handle)
Abort a CAN frame.
int raw_can_subscribe_rx_mbox(int ifnum, struct can_filter *filter, mbox_t *mbox, void *param)
Subscribe to a CAN filter.
int raw_can_send_mbox(int ifnum, const struct can_frame *frame, mbox_t *mbox)
Send a CAN frame.
const char * raw_can_get_name_by_ifnum(int ifnum)
Get the interface name of a given interface number.
int raw_can_set_trx(int ifnum, can_trx_t *trx)
Set a transceiver for a given interface.
int raw_can_set_bitrate(int ifnum, uint32_t bitrate, uint32_t sample_point)
Set the given bitrate/sample_point to the given ifnum.
candev_dev_t * raw_can_get_dev_by_ifnum(int ifnum)
Get the candev descriptor from a given interface number.
CAN generic transceiver interface.
int16_t kernel_pid_t
Unique process identifier.
Definition sched.h:139
Mailbox API.
Scheduler API definition.
Controller Area Network filter.
Definition can.h:101
Controller Area Network frame.
Definition can.h:88
Structure to pass a CAN option.
Definition common.h:72
Received data structure.
Definition common.h:122
Generic transceiver descriptor.
Definition can_trx.h:48
candev descriptor to pass to the device thread
Definition device.h:69
Mailbox struct definition.
Definition mbox.h:41
Definitions high-level CAN interface.
Definitions of high-level CAN interface.
Definitions of CAN device interface.