Subversion Repositories Code-Repo

Rev

Rev 234 | Go to most recent revision | Blame | Last modification | View Log | RSS feed

// PIC32MX795F512L

#ifndef DEFINES_H
#define DEFINES_H

#include <xc.h>
#include <plib.h>
#include <stdint.h>

// Uncomment ONE of the following:
//#define CEREBOT_32MX7
 #define CEREBOT_MX7CK

// Power supply must be 5V for proper operation of the board!

#define CPU_CLOCK_HZ    80000000UL
#define PERIPHERAL_CLOCK_HZ 80000000UL
#define CPU_CT_HZ       (CPU_CLOCK_HZ/2UL)
#define MS_TO_CT_TICKS  (CPU_CLOCK_HZ/2000UL)
#define US_TO_CT_TICKS  (CPU_CLOCK_HZ/2000000UL)

#define ADDRESS_EEPROM 0x50
#define ADDRESS_CONTROLLER_1 0x24
#define ADDRESS_CONTROLLER_2 0x25

// LED1 = G12, LED2 = G13, LED3 = G14, LED4 = G15 (active high)
#define LED1_TRIS TRISGbits.TRISG12
#define LED1_LAT LATGbits.LATG12
#define LED2_TRIS TRISGbits.TRISG13
#define LED2_LAT LATGbits.LATG13
#define LED3_TRIS TRISGbits.TRISG14
#define LED3_LAT LATGbits.LATG14
#define LED4_TRIS TRISGbits.TRISG15
#define LED4_LAT LATGbits.LATG15

void Delay_MS(uint32_t delay_ms);
void Delay_US(uint32_t delay_us);

#endif /* DEFINES_H */