Defines | Variables

global.h File Reference

Global definitions and macros. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define EXTERN   extern
#define WHEEL_SIZE   1280U
 This defines the wheel circumference in millimeters.
#define SPEEDLIMIT_MAX   250U
 This value defines the maximum speed at which the motor can be activated in pedelec mode while the driver is pedaling.
#define SPEEDLIMIT_MIN   30U
 This value defines the minimum speed required to enable the motor.
#define DEFAULT_MAGNET_NUMBER_TACHO   1U
 This value defines the default number of magnets attached to activate the tacho reed switch.
#define DEFAULT_MAGNET_NUMBER_PEDAL   1U
 This value defines the default number of magnets attached to activate the pedal reed switch.
#define RXD_PORT   PORTD
#define RXD_DDR   DDRD
#define RXD_BIT   PD0
#define TXD_PORT   PORTD
#define TXD_DDR   DDRD
#define TXD_BIT   PD1
#define LED1_PORT   PORTB
#define LED1_DDR   DDRB
#define LED1_BIT   PB1
#define LED2_PORT   PORTB
#define LED2_DDR   DDRB
#define LED2_BIT   PB0
#define LED3_PORT   PORTD
#define LED3_DDR   DDRD
#define LED3_BIT   PD7
#define LED4_PORT   PORTD
#define LED4_DDR   DDRD
#define LED4_BIT   PD6
#define LED5_PORT   PORTD
#define LED5_DDR   DDRD
#define LED5_BIT   PD4
#define MUX_VOLT_PORT   PORTC
#define MUX_VOLT_DDR   DDRC
#define MUX_VOLT_BIT   PC4
#define MUX_CURR_PORT   PORTC
#define MUX_CURR_DDR   DDRC
#define MUX_CURR_BIT   PC5
#define SPEAKER_PORT   PORTB
#define SPEAKER_DDR   DDRB
#define SPEAKER_BIT   PB2
#define RELAY_PORT   PORTD
#define RELAY_DDR   DDRD
#define RELAY_BIT   PD5
#define FAN_PORT   PORTC
#define FAN_DDR   DDRC
#define FAN_BIT   PC3
#define INT0_PORT   PORTD
#define INT0_DDR   DDRD
#define INT0_BIT   PD2
#define INT1_PORT   PORTD
#define INT1_DDR   DDRD
#define INT1_BIT   PD3
#define VREF_PORT   PORTC
#define VREF_DDR   DDRC
#define VREF_BIT   7
#define CSBASE_PORT   PORTC
#define CSBASE_DDR   DDRC
#define CSBASE_BIT   PC1
#define R3_PORT   PORTC
#define R3_DDR   DDRC
#define R3_BIT   PC0
#define VTH_PORT   PORTC
#define VTH_DDR   DDRC
#define VTH_BIT   PC2
#define SWITCH_PORT   PORTC
#define SWITCH_DDR   DDRC
#define SWITCH_BIT   6
#define ADC_SWITCH   ADC6
#define ADC_TEMPERATURE   ADC2
#define ADC_VOLTAGE   ADC0
#define ADC_VREF   ADC7
#define ADC_CURRENT   ADC1
#define MAX_CURRENT   523U
 This value defines the maximum current as ADC value.
#define VALUE_TEMP_FAN   45U
 This value defines the fan activation temperature.
#define VALUE_TEMP_WARN   70U
 This value defines temperature warning threshold.
#define VALUE_TEMP_ERROR   80U
 This value defines temperature error threshold.
#define ONE_MINUTE_MS   ((UINT32)60000UL)
 This value is just a difinition for one minute in milliseconds.
#define FW_VERSION   1172U
 This value defines the firmware version which will be stored in flash memory.
#define APPLICATION_CRC   0x5C751A3FUL
 This value defines the firmware CRC32 checksum version which will be stored in flash memory.
#define CRC32POLY   0xEDB88320UL
#define STATIC   static
#define LOCAL_STATIC   static
#define CONST   const
#define VOLATILE   volatile
#define HIGH_BYTE(x)   ((UINT8) (x >> 8U))
 This macro returns the higher byte of an UINT16 value.
#define LOW_BYTE(x)   ((UINT8) x)
 This macro returns the lower byte of an UINT16 value.
#define LED1_ON()   LED1_PORT &= ~(1U << LED1_BIT);
 Macro function to turn LED1 on.
#define LED1_OFF()   LED1_PORT |= (1U << LED1_BIT);
 Macro function to turn LED1 off.
#define LED2_ON()   LED2_PORT &= ~(1U << LED2_BIT);
 Macro function to turn LED2 on.
#define LED2_OFF()   LED2_PORT |= (1U << LED2_BIT);
 Macro function to turn LED2 off.
#define LED3_ON()   LED3_PORT &= ~(1U << LED3_BIT);
 Macro function to turn LED3 on.
#define LED3_OFF()   LED3_PORT |= (1U << LED3_BIT);
 Macro function to turn LED3 off.
#define LED4_ON()   LED4_PORT &= ~(1U << LED4_BIT);
 Macro function to turn LED4 on.
#define LED4_OFF()   LED4_PORT |= (1U << LED4_BIT);
 Macro function to turn LED4 off.
#define LED5_ON()   LED5_PORT &= ~(1U << LED5_BIT);
 Macro function to turn LED5 on.
#define LED5_OFF()   LED5_PORT |= (1U << LED5_BIT);
 Macro function to turn LED5 off.
#define ALL_LEDS_ON()
 Short macro to turn all LEDs on (used for flashing)
#define ALL_LEDS_OFF()
 Short macro to turn all LEDs off (used for flashing)
#define MUX_CURR()
 Macro to switch the multiplexer to current mode.
#define MUX_VOLT()
 Macro to switch the multiplexer to voltage mode.

Variables

const UINT32 g_u32ApplicationCRC
 UINT32 variable to store the firmware checksum at a dedicated memory position.
const UINT16 g_u16ApplicationVersion
 UINT16 variable to store the application firmware version at a dedicated memory position.
const S_MEM_STRUCTRUE sMemoryEEPROM
 Variable to reserve memory for structure in EEPROM.

Detailed Description

Author:
Philipp Bank
Copyright:
Creative Commons by-nc-sa 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)

Definition in file global.h.