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 MCP2542_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
69 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
70 cfg.stb = MIKROBUS( mikrobus, MIKROBUS_AN )
77#define MCP2542_DRV_RX_BUFFER_SIZE 500
78#define MCP2542_DRV_TX_BUFFER_SIZE 500
85#define MCP2542_RETVAL uint8_t
87#define MCP2542_OK 0x00
88#define MCP2542_INIT_ERROR 0xFF
95#define MCP2542_STANDBY_MODE_ON 1
96#define MCP2542_STANDBY_MODE_OFF 0
#define MCP2542_DRV_RX_BUFFER_SIZE
Definition mcp2542.h:77
#define MCP2542_DRV_TX_BUFFER_SIZE
Definition mcp2542.h:78
#define MCP2542_RETVAL
Definition mcp2542.h:85
uint8_t mcp2542_generic_single_read(mcp2542_t *ctx)
Generic single read function.
void mcp2542_generic_multi_write(mcp2542_t *ctx, uint8_t *data_buf, uint8_t len)
Generic multi write function.
void mcp2542_default_cfg(mcp2542_t *ctx)
Click Default Configuration function.
void mcp2542_generic_single_write(mcp2542_t *ctx, uint8_t tx_data)
Generic single write function.
void mcp2542_set_mode(mcp2542_t *ctx, uint8_t mode)
Set device mode.
void mcp2542_generic_multi_read(mcp2542_t *ctx, uint8_t *data_buf, uint8_t len)
Generic multi read function.
MCP2542_RETVAL mcp2542_init(mcp2542_t *ctx, mcp2542_cfg_t *cfg)
Initialization function.
void mcp2542_cfg_setup(mcp2542_cfg_t *cfg)
Config Object Initialization function.
Click configuration structure definition.
Definition mcp2542.h:128
uint32_t baud_rate
Definition mcp2542.h:141
bool uart_blocking
Definition mcp2542.h:142
uart_data_bits_t data_bit
Definition mcp2542.h:143
pin_name_t tx_pin
Definition mcp2542.h:132
pin_name_t rx_pin
Definition mcp2542.h:131
uart_stop_bits_t stop_bit
Definition mcp2542.h:145
uart_parity_t parity_bit
Definition mcp2542.h:144
pin_name_t stb
Definition mcp2542.h:136
Click ctx object definition.
Definition mcp2542.h:112
digital_out_t stb
Definition mcp2542.h:115
uart_t uart
Definition mcp2542.h:117