TOP Contributors

  1. MIKROE (2663 codes)
  2. Alcides Ramos (358 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (137089 times)
  2. FAT32 Library (70232 times)
  3. Network Ethernet Library (56102 times)
  4. USB Device Library (46434 times)
  5. Network WiFi Library (42053 times)
  6. FT800 Library (41384 times)
  7. GSM click (29111 times)
  8. mikroSDK (26560 times)
  9. PID Library (26489 times)
  10. microSD click (25486 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

CXPI click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.11

mikroSDK Library: 2.0.0.0

Category: CXPI

Downloaded: 130 times

Not followed.

License: MIT license  

CXPI Click is a compact add-on board that contains a transceiver that supports the next-generation automotive communication protocol. This board features the BD41000AFJ-C, a transceiver for the CXPI (Clock Extension Peripheral Interface) communication from Rohm Semiconductor.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "CXPI click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "CXPI click" changes.

Do you want to report abuse regarding "CXPI click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


CXPI click

CXPI Click is a compact add-on board that contains a transceiver that supports the next-generation automotive communication protocol. This board features the BD41000AFJ-C, a transceiver for the CXPI (Clock Extension Peripheral Interface) communication from Rohm Semiconductor.

cxpi_click.png

click Product page


Click library

  • Author : Stefan Ilic
  • Date : Aug 2021.
  • Type : UART type

Software Support

We provide a library for the CXPI 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 from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

This library contains API for CXPI Click driver.

Standard key functions :

  • cxpi_cfg_setup Config Object Initialization function.

    void cxpi_cfg_setup ( cxpi_cfg_t *cfg );
  • cxpi_init Initialization function.

    err_t cxpi_init ( cxpi_t *ctx, cxpi_cfg_t *cfg );

Example key functions :

  • cxpi_send_command Send command.

    void cxpi_send_command ( cxpi_t *ctx, char *command );
  • cxpi_set_pwm_pin_state Set PWM pin state function.

    void cxpi_set_pwm_pin_state ( cxpi_t *ctx, uint8_t pin_state );
  • cxpi_set_through_mode Set through mode function.

    void cxpi_set_through_mode ( cxpi_t *ctx );

Example Description

This is an example that demonstrates the use of the CXPI Click board.

The demo application is composed of two sections :

Application Init

Initializes UART driver. In addition to this module is placed inside transmitter/receiver working mode cappable of transmission/receive the data.


void application_init ( void ) {
    log_cfg_t log_cfg;  /**< Logger config object. */
    cxpi_cfg_t cxpi_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );

    // Click initialization.

    cxpi_cfg_setup( &cxpi_cfg );
    CXPI_MAP_MIKROBUS( cxpi_cfg, MIKROBUS_1 );
    err_t init_flag  = cxpi_init( &cxpi, &cxpi_cfg );
    if ( UART_ERROR == init_flag ) {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }
    log_info( &logger, " Application Task " );
    cxpi_set_through_mode( &cxpi );

#ifdef DEMO_APP_TRANSMITER
    log_printf( &logger, "------------------\r\n" );
    log_printf( &logger, "    Send data:    \r\n" );
    log_printf( &logger, "      MikroE      \r\n" );
    Delay_ms ( 1000 );
#endif

#ifdef DEMO_APP_RECEIVER 
    log_printf( &logger, "------------------\r\n" );
    log_printf( &logger, "   Receive data  \r\n" );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
#endif

    log_printf( &logger, "------------------\r\n" );
}

Application Task

Transmitter/Receiver task depend on uncommented code Receiver logging each received byte to the UART for data logging, while transmitted send messages every 5 seconds.


void application_task ( void ) {
#ifdef DEMO_APP_RECEIVER 
    cxpi_process( );
    if ( current_rsp_buf > 0 ) {
        log_printf( &logger, "%s", current_rsp_buf );
        cxpi_clear_current_rsp_buf( );
    }
#endif 

#ifdef DEMO_APP_TRANSMITER
    cxpi_send_command( &cxpi, &demo_message[ 0 ] );
    log_printf( &logger, " Sent data : %s",  &demo_message[ 0 ] );
    log_printf( &logger, "------------------\r\n" ); 
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
#endif
}

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.CXPI

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. UART terminal is available in all MikroElektronika compilers.


ALSO FROM THIS AUTHOR

Current 6 click

0

Current 6 Click is a compact add-on board providing a precise and accurate current sensing solution. This board features the MAX40080, a fast-response bi-directional current-sense amplifier from Analog Devices. The device features ultra-low 5uV input offset voltage, very-low 0.2% gain error, and includes an analog-to-digital converter with programmable sample rate and 12-bit resolution featuring I2C compatible interface. It also features a wake-up current-threshold and auto-shutdown mode when the I2C is inactive, both designed to minimize power consumption. The current-shunt monitor can measure voltage signals on common-mode voltages ranging from -0.1V (ground sensing) to 36V, independent of the supply voltage. This Click board™ delivers higher performance to industrial control and automation applications, load and power supplies monitoring, telecom equipment, and many more.

[Learn More]

REC-PLAY click

5

Rec&amp;Play Click is a digital voice recorder on a Click board. It is based around the ISD3900, a multi-message record and playback device.

[Learn More]

MRAM 2 click

0

MRAM 2 Click is a compact add-on board for applications that must store and retrieve data and programs quickly using a small number of pins.

[Learn More]