|
brazos-trapezoidal
|
Header file for main.h.c. More...
#include <stdint.h>#include "TrapSless.h"

Go to the source code of this file.
Macros | |
| #define | ATOD_IRQ_PRIO 1 |
| #define | DMA_IRQ_PRIO 2 |
| #define | TIM0_IRQ_PRIO 3 |
| #define | TIM1_IRQ_PRIO 4 |
Functions | |
| int | main (void) |
| Main function. More... | |
| void | main_init (void) |
| Main initialization function . Executes at start of main function. More... | |
| void | main_step (void) |
| Main step function (FOR SIMULATION ONLY). Executes at control rate of 4KHz. More... | |
| void | SysTickCallBack () |
| Systick call back function Passed as argument of systick_initialize function at TimerInterrut.c Call rate of 250 us. More... | |
| void | main__Start_Motor (int16_t speed, int16_t accel) |
| Main motor start function. More... | |
| void | main__Stop_Motor (void) |
| Main motor stop function. More... | |
| void * | main__pointerUart0 () |
| Get the uart0 configuration pointer. Used by Serial Buffer module. More... | |
Variables | |
| TRAPSLESS_PATTERN_TYPE | TrapSlessData |
Header file for main.h.c.
Definition in file main.h.
| #define ATOD_IRQ_PRIO 1 |
| int main | ( | void | ) |
| void * main__pointerUart0 | ( | ) |
| void main__Start_Motor | ( | int16_t | speed, |
| int16_t | accel | ||
| ) |
| void main_init | ( | void | ) |
Main initialization function . Executes at start of main function.
< XBAR peripheral initialization
< GPIO peripheral initialization
< LSI initialization
< Microcontroller clocks initialization
< Timer Interrupt (Systick) initialization
< Calibration initialization
< Trapezoidal motor control initialization
< LEDs at off condition
< LEDs at off condition
< DMA enable request is set to true, enable it, when appropriate
< Analog to Digital converter configuration
< Dma configuration
< TIM0 is the pwm timer and its timer period is set for 40MHz clock with 16KHz operation. As it is triangular counter, the equation is divided by 2
< AdvDelay is the location of the pwm trigger, which is the peak of the triangular counter of pwm with a delay of 83 counts, or 2.1 [us], at 40MHz
< Setup the pwm (timers, pins and interrupts)
< ADC sequence is reset to get started
< Uart configuration - UART0 (PC interface) and UART1 (Jlink on board)
< API006MemoryRW module configuration
< API023MotorControl module configuration
< Tsp module configuration (Theta serial protocol)
< watchdog module initialization
< Enable write access to all other registers by writing 0x1ACCE551
< Update the value of 32-bit LOAD register - 64MHz counter targeting 150ms 64000000*0.150 = 9600000
< Reloads the counter from the value in WDOG LOAD
< Enable the interrupt event, WDOGINT. Set HIGH to Enable the counter and the interrupt
< Enable Watchdog reset output, WDOGRES. Set HIGH to enable the reset
< Disable write access by writing any other value than 0x1ACCE551
< Service the watchdog
< Tick timer for Bemf counting - free running counter
< Initialize Tick Timer as Free Runner Counter for Bemf time counting - 40MHz counter
< Set the source clock of the tick counter as HSOC = 40MHz
< Set the multiplier of clock of the tick counter as 1
Definition at line 489 of file main.c.


| void main_step | ( | void | ) |
| void SysTickCallBack | ( | ) |
|
extern |
< Struct variable carry all motor control related informatin
Definition at line 21 of file TrapSless.c.