Jeroen Lodder / Mbed 2 deprecated SteppermotorBoard

Dependencies:   USBDevice mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers CT32B0_PWM.h Source File

CT32B0_PWM.h

Go to the documentation of this file.
00001  /**
00002  * @file    CT32B0_PWM.h
00003  * @brief   Small driver to user CT32B0 for PWM
00004  *
00005  * @author  Jeroen Lodder
00006  * @date        Oktober 2013
00007  *
00008  * @note        Since only one timer is used to supply 4 PWM channels 
00009  *                  a problem occurs because CT32B0 only support 3 PWM channels.
00010  *                  
00011  *                  Since this software is designed for a H-Bridge implementation 
00012  *                  only 2 of 4 PWM channels are required to be active simultaneously.
00013  *                  
00014  *                  This is where the stage variable comes in:
00015  *                  Stage 0: PWM enabled on MAT 0, MAT 1 and MAT 2.
00016  *                  Stage 1: PWM enabled on MAT 0, MAT 1 and MAT 3.
00017  *                  Unused MAT outputs will be pullled down.
00018  * @{
00019  */
00020 #ifndef CT32B0_PWM_H_
00021 #define CT32B0_PWM_H_
00022 
00023 void CT32B0_initpwm(uint32_t period, uint32_t defaultstate);
00024 void CT32B0_reinitpwm();
00025 void CT32B0_start(void);
00026 void CT32B0_stage(uint8_t stagearg);
00027 void CT32B0_reload_mat(void);
00028 void CT32B0_set(uint8_t matnr, uint32_t value);
00029 void CT32B0_deinit(uint8_t state);
00030 void CT32B0_wait_refresh(void);
00031 
00032 #endif //CT32B0_PWM_H_
00033 /**
00034  *@}
00035  */
00036