Loading...
Searching...
No Matches
can_trx.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
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
21#ifndef CAN_CAN_TRX_H
22#define CAN_CAN_TRX_H
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
31typedef enum {
32 TRX_NORMAL_MODE = 0,
33 TRX_SILENT_MODE,
34 TRX_SLEEP_MODE,
35 /* single wire can modes */
36 TRX_HIGH_SPEED_MODE,
37 TRX_HIGH_VOLTAGE_WAKE_UP_MODE
39
43typedef struct trx_driver trx_driver_t;
44
52
56struct trx_driver {
65 int (*init)(can_trx_t *dev);
66
76 int (*set_mode)(can_trx_t *dev, can_trx_mode_t mode);
77};
78
88
99
100#ifdef __cplusplus
101}
102#endif
103
104#endif /* CAN_CAN_TRX_H */
can_trx_mode_t
trx transceiver mode
Definition can_trx.h:31
int can_trx_init(can_trx_t *dev)
initialize a transceiver
int can_trx_set_mode(can_trx_t *dev, can_trx_mode_t mode)
transceiver set mode
struct can_trx can_trx_t
Generic transceiver descriptor.
Generic transceiver descriptor.
Definition can_trx.h:48
can_trx_mode_t mode
current mode
Definition can_trx.h:50
const trx_driver_t * driver
driver
Definition can_trx.h:49
Generic transceiver driver.
Definition can_trx.h:56
int(* init)(can_trx_t *dev)
initialize the trx device
Definition can_trx.h:65
int(* set_mode)(can_trx_t *dev, can_trx_mode_t mode)
set mode interface
Definition can_trx.h:76