spiisolator6 2.0.0.0
main.c File Reference

SPIIsolator6 Click example. More...

#include "board.h"
#include "log.h"
#include "spiisolator6.h"

Macros

#define DEVICE_NAME   "Accel 22 click"
 
#define DEVICE_SPI_READ_REG   0x0B
 
#define DEVICE_REG_ID   0x00
 
#define DEVICE_ID   0xAD
 

Functions

void spiisolator6_get_accel22_device_id (spiisolator6_t *ctx)
 SPI Isolator 6 get accel 22 device id function.
 
void application_init (void)
 
void application_task (void)
 
int main (void)
 

Detailed Description

SPIIsolator6 Click example.

Description

This example demonstrates the use of SPI Isolator 6 click board by reading the device ID of the connected Accel 22 click board.

The demo application is composed of two sections :

Application Init

Initializes the driver and logger.

Application Task

Reads and checks the device ID of the connected Accel 22 click board, and displays the results on the USB UART approximately once per second.

Note
Make sure to provide VCC power supply on VCC-EXT pin.
Author
Stefan Filipovic

Macro Definition Documentation

◆ DEVICE_ID

#define DEVICE_ID   0xAD

◆ DEVICE_NAME

#define DEVICE_NAME   "Accel 22 click"

◆ DEVICE_REG_ID

#define DEVICE_REG_ID   0x00

◆ DEVICE_SPI_READ_REG

#define DEVICE_SPI_READ_REG   0x0B

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

< 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 LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )

◆ spiisolator6_get_accel22_device_id()

void spiisolator6_get_accel22_device_id ( spiisolator6_t * ctx)

SPI Isolator 6 get accel 22 device id function.

This function reads and checks the device ID of the connected Accel 22 click board.

Parameters
[in]ctx: Click context object. See spiisolator6_t object definition for detailed explanation.
Returns
None.
Note
None.