42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
67#define CANFD5_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
69 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
70 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
71 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
72 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT );
79#define CANFD5_RETVAL uint8_t
82#define CANFD5_INIT_ERROR 0xFF
89#define DRV_RX_BUFFER_SIZE 500
96#define CANFD5_PIN_STATE_DISABLE 0x00
97#define CANFD5_PIN_STATE_ENABLE 0x01
104#define CANFD5_OPERATING_MODE_NORMAL 0x00
105#define CANFD5_OPERATING_MODE_STAND_BY 0x01
106#define CANFD5_OPERATING_MODE_SLEEP 0x02
#define DRV_RX_BUFFER_SIZE
Definition canfd5.h:89
#define CANFD5_RETVAL
Definition canfd5.h:79
void canfd5_generic_write(canfd5_t *ctx, char *data_buf, uint16_t len)
Generic write function.
void canfd5_set_wak_pin_state(canfd5_t *ctx, uint8_t wak_state)
Set WAK pin state function.
void canfd5_cfg_setup(canfd5_cfg_t *cfg)
Config Object Initialization function.
void canfd5_set_normal_operating_mode(canfd5_t *ctx)
Set normal operating mode function.
int32_t canfd5_generic_read(canfd5_t *ctx, char *data_buf, uint16_t max_len)
Generic read function.
void canfd5_set_slp_pin_state(canfd5_t *ctx, uint8_t slp_state)
Set SLP pin state function.
CANFD5_RETVAL canfd5_init(canfd5_t *ctx, canfd5_cfg_t *cfg)
Initialization function.
void canfd5_set_standby_operating_mode(canfd5_t *ctx)
Set stand-by operating mode function.
void canfd5_set_sleep_operating_mode(canfd5_t *ctx)
Set sleep operating mode function.
uint8_t canfd5_get_cts_pin_state(canfd5_t *ctx)
Set WAK pin state function.
void canfd5_set_operating_mode(canfd5_t *ctx, uint8_t op_mode)
Set operating mode function.
uint8_t canfd5_error_t
Error type.
Definition canfd5.h:168
Click configuration structure definition.
Definition canfd5.h:143
uint32_t baud_rate
Definition canfd5.h:157
bool uart_blocking
Definition canfd5.h:158
uart_data_bits_t data_bit
Definition canfd5.h:159
pin_name_t tx_pin
Definition canfd5.h:147
pin_name_t rx_pin
Definition canfd5.h:146
uart_stop_bits_t stop_bit
Definition canfd5.h:161
pin_name_t int_pin
Definition canfd5.h:153
pin_name_t pwm
Definition canfd5.h:152
uart_parity_t parity_bit
Definition canfd5.h:160
pin_name_t cs
Definition canfd5.h:151
Click ctx object definition.
Definition canfd5.h:119
digital_out_t cs
Definition canfd5.h:122
digital_out_t pwm
Definition canfd5.h:123
uart_t uart
Definition canfd5.h:132
digital_in_t int_pin
Definition canfd5.h:128