singlewirecan 2.0.0.0
|
Single Wire CAN Click is a compact add-on board that contains an IC for a single wire data link capable of operating with various protocols such as the Controller Area Network (CAN). This board features the NCV7356D1R2G, Single Wire CAN transceiver from ON Semiconductor, which operates from a supply voltage from 5V to 27V with bus speed up to 40 kbps.
We provide a library for the SingleWireCan Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.
This library contains API for SingleWireCan Click driver.
- Initialization function.void singlewirecan_cfg_setup ( singlewirecan_cfg_t *cfg );
SINGLEWIRECAN_RETVAL singlewirecan_init ( singlewirecan_t *ctx, singlewirecan_cfg_t *cfg );
- This function write specified number of bytesvoid singlewirecan_set_operating_mode ( singlewirecan_t *ctx, uint8_t op_mode );
void singlewirecan_generic_write ( singlewirecan_t *ctx, char *data_buf, uint16_t len );
int32_t singlewirecan_generic_read ( singlewirecan_t *ctx, char *data_buf, uint16_t max_len );
This example demonstrate the use of Single Wire CAN click board.
The demo application is composed of two sections :
Initializes the driver and configures the click for the normal operation mode.
Depending on the selected mode, it reads all the received data or sends the desired message every 2 seconds.
The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.
Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.