#### File: D:\bobes\0 skola\_car4\my matlab\HIL - PID speed\firmware\Vejlupek_Car4_HIL_PIDSpeed_dspic\sources\Vejlupek_Car4_HIL_PIDSpeed_private.h
        1   /*
        2    * File: Vejlupek_Car4_HIL_PIDSpeed_private.h
        3    *
        4    * Real-Time Workshop code generated for Simulink model Vejlupek_Car4_HIL_PIDSpeed.
        5    *
        6    * Model version                        : 1.460
        7    * Real-Time Workshop file version      : 7.3  (R2009a)  15-Jan-2009
        8    * Real-Time Workshop file generated on : Fri Apr 30 16:12:44 2010
        9    * TLC version                          : 7.3 (Jan 18 2009)
       10    * C source code generated on           : Fri Apr 30 16:12:44 2010
       11    *--------------------------------------------------------------
       12    *   Embedded Coder for Microchip dsPIC family.                 |
       13    *   Generate .c and .h files from your Matlab/simulink model   |
       14    *   and compile the diagram to .hex and .coff file that can be |
       15    *   downloaded directly into the microcontroller               |
       16    *                                                              |
       17    * Licence Accorded to Ing. Robert Grepl, Ph.D.                 |
       18    *                     Technical University Brno                |
       19    *                                                              |
       20    *   Written by Lubin KERHUEL -  http://www.kerhuel.eu          |
       21    *  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
       22    *   Version 3.1                               26-Nov-2009      |
       23    *   For Matlab 7.8             R2009a                          |
       24    *--------------------------------------------------------------
       25    */
       26
       27   #ifndef RTW_HEADER_Vejlupek_Car4_HIL_PIDSpeed_private_h_
       28   #define RTW_HEADER_Vejlupek_Car4_HIL_PIDSpeed_private_h_
       29   #include "rtwtypes.h"
       30
       31   /* dsPIC library */
       32   #include "p33fxxxx.h"
       33   #include "timer.h"
       34   #define fcy                            20000000
       35
       36   /*initialization Block: <S16>/PWM Motor Output*/
       37   #include "pwm12.h"
       38   #ifndef UCHAR_MAX
       39   #include <limits.h>
       40   #endif
       41
       42   #if ( UCHAR_MAX != (0xFFU) ) || ( SCHAR_MAX != (0x7F) )
       43   #error "Code was generated for compiler with different sized uchar/char. Consider adjusting Emulation Hardware word size settings on the Hardware Implementation pane to match your compiler word sizes as defined in the compiler's limits.h header file. Alternatively, you can select 'None' for Emulation Hardware and select the 'Enable portable word sizes' option for ERT based targets, which will disable the preprocessor word size checks."
       44   #endif
       45
       46   #if ( USHRT_MAX != (0xFFFFU) ) || ( SHRT_MAX != (0x7FFF) )
       47   #error "Code was generated for compiler with different sized ushort/short. Consider adjusting Emulation Hardware word size settings on the Hardware Implementation pane to match your compiler word sizes as defined in the compilers limits.h header file. Alternatively, you can select 'None' for Emulation Hardware and select the 'Enable portable word sizes' option for ERT based targets, this will disable the preprocessor word size checks."
       48   #endif
       49
       50   #if ( UINT_MAX != (0xFFFFU) ) || ( INT_MAX != (0x7FFF) )
       51   #error "Code was generated for compiler with different sized uint/int. Consider adjusting Emulation Hardware word size settings on the Hardware Implementation pane to match your compiler word sizes as defined in the compilers limits.h header file. Alternatively, you can select 'None' for Emulation Hardware and select the 'Enable portable word sizes' option for ERT based targets, this will disable the preprocessor word size checks."
       52   #endif
       53
       54   #if ( ULONG_MAX != (0xFFFFFFFFUL) ) || ( LONG_MAX != (0x7FFFFFFFL) )
       55   #error "Code was generated for compiler with different sized ulong/long. Consider adjusting Emulation Hardware word size settings on the Hardware Implementation pane to match your compiler word sizes as defined in the compilers limits.h header file. Alternatively, you can select 'None' for Emulation Hardware and select the 'Enable portable word sizes' option for ERT based targets, this will disable the preprocessor word size checks."
       56   #endif
       57
       58   #define Tx_BUFF_SIZE_Uart1             32
       59   #define Rx_BUFF_SIZE_Uart1             32
       60   #ifndef __RTWTYPES_H__
       61   #error This file requires rtwtypes.h to be included
       62   #else
       63   #ifdef TMWTYPES_PREVIOUSLY_INCLUDED
       64   #error This file requires rtwtypes.h to be included before tmwtypes.h
       65   #else
       66
       67   /* Check for inclusion of an incorrect version of rtwtypes.h */
       68   #ifndef RTWTYPES_ID_C08S16I16L32N16F1
       69   #error This code was generated with a different "rtwtypes.h" than the file included
       70   #endif                                 /* RTWTYPES_ID_C08S16I16L32N16F1 */
       71   #endif                                 /* TMWTYPES_PREVIOUSLY_INCLUDED */
       72   #endif                                 /* __RTWTYPES_H__ */
       73
       74   #define _SPI1EN                        (SPI1STATbits.SPIEN)
       75   #define _SPI2EN                        (SPI2STATbits.SPIEN)
       76
       77   extern volatile uint8_T TxPtrHaut_Uart1 ;
       78   extern volatile uint8_T TxPtrBas_Uart1 ;
       79   extern volatile uint8_T TxTab_Uart1[Tx_BUFF_SIZE_Uart1];
       80   extern volatile uint8_T RxPtrHaut_Uart1 ;
       81   extern volatile uint8_T RxPtrBas_Uart1 ;
       82   extern volatile uint8_T RxTab_Uart1[Rx_BUFF_SIZE_Uart1];
       83   extern uint8_T send232Buff_Uart1 (int16_T valeur, uint8_T cannal);
       84   extern uint16_T GetQEI();
       85   extern void QEIInit();
       86   void sMultiWordShl(const uint32_T u1[], int16_T n1, uint16_T n2, uint32_T y[],
       87                      int16_T n);
       88   void sLong2MultiWord(int32_T u, uint32_T y[], int16_T n);
       89   void MultiWordAdd(const uint32_T u1[], const uint32_T u2[], uint32_T y[],
       90                     int16_T n);
       91   uint32_T MultiWord2uLong(const uint32_T u[]);
       92   void sMultiWordShr(const uint32_T u1[], int16_T n1, uint16_T n2, uint32_T y[],
       93                      int16_T n);
       94   void Vejlupek_Car4_HIL_PIDSpeed_step0(void);
       95   void Vejlupek_Car4_HIL_PIDSpeed_step1(void);
       96
       97   #endif                                 /* RTW_HEADER_Vejlupek_Car4_HIL_PIDSpeed_private_h_ */
       98
       99   /* File trailer for Real-Time Workshop generated code.
      100    *
      101    * [EOF]
      102    */