canfd 2.0.0.0
canfd.h File Reference

This file contains API for CAN FD Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_uart.h"

Go to the source code of this file.

Data Structures

struct  canfd_t
 Click ctx object definition. More...
 
struct  canfd_cfg_t
 Click configuration structure definition. More...
 

Macros

#define CANFD_MAP_MIKROBUS(cfg, mikrobus)
 
#define CANFD_RETVAL   uint8_t
 
#define CANFD_OK   0x00
 
#define CANFD_INIT_ERROR   0xFF
 
#define CANFD_PIN_STATE_ENABLE   0x01
 
#define CANFD_PIN_STATE_DISABLE   0x00
 
#define CANFD_NULL   0x00
 
#define CANFD_OPERATING_MODE_NORMAL   0
 
#define CANFD_OPERATING_MODE_RECEIVE   1
 
#define CANFD_OPERATING_MODE_STAND_BY   2
 
#define CANFD_OPERATING_MODE_SLEEP   3
 
#define DRV_RX_BUFFER_SIZE   500
 

Typedefs

typedef uint8_t canfd_error_t
 Error type.
 

Functions

void canfd_cfg_setup (canfd_cfg_t *cfg)
 Config Object Initialization function.
 
CANFD_RETVAL canfd_init (canfd_t *ctx, canfd_cfg_t *cfg)
 Initialization function.
 
void canfd_set_wke_pin (canfd_t *ctx, uint8_t state)
 Set WKE ( wake-up ) pin state.
 
void canfd_set_stb_pin (canfd_t *ctx, uint8_t state)
 Set RST ( reset ) pin state.
 
uint8_t canfd_get_err_pin (canfd_t *ctx)
 Set ERR ( INT ) pin state.
 
void canfd_set_stand_by_stb_pin (canfd_t *ctx, uint8_t stb_state)
 Set STB ( RST ) pin state.
 
void canfd_set_mode_en_pin (canfd_t *ctx, uint8_t en_state)
 Set EN ( CS ) pin state.
 
void canfd_generic_write (canfd_t *ctx, char *data_buf, uint16_t len)
 Generic write function.
 
int32_t canfd_generic_read (canfd_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function.
 
void canfd_set_operating_mode (canfd_t *ctx, uint8_t op_mode)
 Operation mode.
 

Detailed Description

This file contains API for CAN FD Click driver.