fan 2.0.0.0
main.c File Reference

Fan Click Example. More...

#include "board.h"
#include "log.h"
#include "fan.h"

Macros

#define FAN_DUTY_RATIO_0_PER   0
 
#define FAN_DUTY_RATIO_10_PER   10
 
#define FAN_DUTY_RATIO_100_PER   100
 
#define FAN_PWM_BASE_FREQ_ZERO_SCALE   0x00
 
#define FAN_PWM_BASE_FREQ_HALF_SCALE   0x80
 
#define FAN_PWM_BASE_FREQ_FULL_SCALE   0xFF
 

Functions

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

Detailed Description

Fan Click Example.

Description

This application is controller for powering and regulating of fan.

The demo application is composed of two sections :

Application Init

Initialization of click driver and usb uart serial terminal for results logging.

Application Task

Performs a control of the fan and reads rotation per minute (RPM). Results will be sent to the usb uart terminal.

Author
Nemanja Medakovic

Macro Definition Documentation

◆ FAN_DUTY_RATIO_0_PER

#define FAN_DUTY_RATIO_0_PER   0

PWM duty ratio 0 pecrents - zero scale. >

◆ FAN_DUTY_RATIO_100_PER

#define FAN_DUTY_RATIO_100_PER   100

PWM duty ratio 100 percents - full scale. >

◆ FAN_DUTY_RATIO_10_PER

#define FAN_DUTY_RATIO_10_PER   10

PWM duty ratio 10 percents - step. >

◆ FAN_PWM_BASE_FREQ_FULL_SCALE

#define FAN_PWM_BASE_FREQ_FULL_SCALE   0xFF

PWM base frequency full scale. >

◆ FAN_PWM_BASE_FREQ_HALF_SCALE

#define FAN_PWM_BASE_FREQ_HALF_SCALE   0x80

PWM base frequency half scale. >

◆ FAN_PWM_BASE_FREQ_ZERO_SCALE

#define FAN_PWM_BASE_FREQ_ZERO_SCALE   0x00

PWM base frequency zero scale. >

Function Documentation

◆ application_init()

void application_init ( void )

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 )