brushless8 2.0.0.0
main.c File Reference

Brushless8 Click example. More...

#include "brushless8.h"
#include "board.h"
#include "math.h"
#include "log.h"

Macros

#define BRUSHLESS8_MODE   BRUSHLESS8_PWM
 
#define COMM_DELAY   500
 

Functions

void application_init (void)
 
void application_task (void)
 
int main (void)
 

Detailed Description

Brushless8 Click example.

Description

This example showcases how to initialize and use the Brushless 8 click. This application is a schowcase of controlling speed and direction of brushless motor with hall sesnor.

The demo application is composed of two sections :

Application Init

Initializes the click board to appropriate settings based on selected mode. Initialization settings are sent through I2C bus and the motor itself is controlled via PWM or DAC over I2C. Modes:

  • BRUSHLESS8_PWM
  • BRUSHLESS8_DAC

Application Task

This example demonstrates the use of Brushless 8 click board. Brushless 8 click communicates with the device via I2C driver in order to set adequate voltage level for connected motor. Current PWM/DAC settings being output are sent via logger. Results are being sent to the Usart Terminal where you can track their changes.

Note
Take into consideration that the jumper on Brushless 8 click board has to be set adequately for selected mode ( VSPSEL ).
Author
Nikola Peric

Macro Definition Documentation

◆ BRUSHLESS8_MODE

#define BRUSHLESS8_MODE   BRUSHLESS8_PWM

◆ COMM_DELAY

#define COMM_DELAY   500

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 )