mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 17:18:00 +02:00
gotthard2 and mythen3: programming fpga, reboot; jungfrau, ctb: modified programming (#74)
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* Define GPIO pins if not defined
|
||||
@ -49,4 +50,4 @@ void stopWritingFPGAprogram(FILE* filefp);
|
||||
* @param filefp pointer to flash
|
||||
* @return 0 for success, 1 for fail (cannot write)
|
||||
*/
|
||||
int writeFPGAProgram(char* fpgasrc, size_t fsize, FILE* filefp);
|
||||
int writeFPGAProgram(char* fpgasrc, uint64_t fsize, FILE* filefp);
|
46
slsDetectorServers/slsDetectorServer/include/programFpgaNios.h
Executable file
46
slsDetectorServers/slsDetectorServer/include/programFpgaNios.h
Executable file
@ -0,0 +1,46 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/** Notify microcontroller of successful server start up */
|
||||
void NotifyServerStartSuccess();
|
||||
|
||||
/** create notification file to notify watchdog of critical tasks (to not shutdown) */
|
||||
void CreateNotificationForCriticalTasks();
|
||||
|
||||
/** write 1 to notification file to postpone shut down process if requested*/
|
||||
void NotifyCriticalTask();
|
||||
|
||||
/** write 0 to notification file to allow shut down process if requested */
|
||||
void NotifyCriticalTaskDone();
|
||||
|
||||
/** reset fpga and controller(only implemented for >= v1.1 boards) */
|
||||
void rebootControllerAndFPGA();
|
||||
|
||||
/** finds the right mtd drive
|
||||
* @param mess error message
|
||||
* @returns ok or fail
|
||||
*/
|
||||
int findFlash(char* mess);
|
||||
|
||||
/** erase flash */
|
||||
void eraseFlash();
|
||||
|
||||
/** erase and write flash
|
||||
* @param mess error message
|
||||
* @param fpgasrc program source
|
||||
* @param fsize file size
|
||||
* @returns ok or fail
|
||||
*/
|
||||
int eraseAndWriteToFlash(char* mess, char* fpgasrc, uint64_t fsize);
|
||||
|
||||
/**
|
||||
* Write FPGA Program to flash
|
||||
* @param mess error message
|
||||
* @param fpgasrc source program
|
||||
* @param fsize size of program
|
||||
* @param filefp pointer to flash
|
||||
* @return ok or fail
|
||||
*/
|
||||
int writeFPGAProgram(char* mess, char* fpgasrc, uint64_t fsize, FILE* filefp);
|
@ -366,10 +366,10 @@ int getFrequency(enum CLKINDEX ind);
|
||||
void configureSyncFrequency(enum CLKINDEX ind);
|
||||
void setPipeline(enum CLKINDEX ind, int val);
|
||||
int getPipeline(enum CLKINDEX ind);
|
||||
extern void eraseFlash(); // programfpga.h
|
||||
extern int startWritingFPGAprogram(FILE** filefp); // programfpga.h
|
||||
extern void stopWritingFPGAprogram(FILE* filefp); // programfpga.h
|
||||
extern int writeFPGAProgram(char* fpgasrc, size_t fsize, FILE* filefp); // programfpga.h
|
||||
extern void eraseFlash(); // programFpgaBlackfin.h
|
||||
extern int startWritingFPGAprogram(FILE** filefp); // programFpgaBlackfin.h
|
||||
extern void stopWritingFPGAprogram(FILE* filefp); // programFpgaBlackfin.h
|
||||
extern int writeFPGAProgram(char* fpgasrc, uint64_t fsize, FILE* filefp); // programFpgaBlackfin.h
|
||||
// patterns
|
||||
uint64_t writePatternIOControl(uint64_t word);
|
||||
uint64_t writePatternClkControl(uint64_t word);
|
||||
@ -401,10 +401,10 @@ int validatePhaseinDegrees(enum CLKINDEX ind, int val, int retval);
|
||||
int setThresholdTemperature(int val);
|
||||
int setTemperatureControl(int val);
|
||||
int setTemperatureEvent(int val);
|
||||
extern void eraseFlash(); // programfpga.h
|
||||
extern int startWritingFPGAprogram(FILE** filefp); // programfpga.h
|
||||
extern void stopWritingFPGAprogram(FILE* filefp); // programfpga.h
|
||||
extern int writeFPGAProgram(char* fpgasrc, size_t fsize, FILE* filefp); // programfpga.h
|
||||
extern void eraseFlash(); // programFpgaBlackfin.h
|
||||
extern int startWritingFPGAprogram(FILE** filefp); // programFpgaBlackfin.h
|
||||
extern void stopWritingFPGAprogram(FILE* filefp); // programFpgaBlackfin.h
|
||||
extern int writeFPGAProgram(char* fpgasrc, uint64_t fsize, FILE* filefp); // programFpgaBlackfin.h
|
||||
void alignDeserializer();
|
||||
|
||||
// eiger specific - iodelay, pulse, rate, temp, activate, delay nw parameter
|
||||
@ -480,7 +480,15 @@ enum burstMode getBurstMode();
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if defined(MYTHEN3D) || defined(GOTTHARD2D)
|
||||
extern void NotifyServerStartSuccess();
|
||||
extern void CreateNotificationForCriticalTasks();
|
||||
extern void rebootControllerAndFPGA(); // programFpgaNios.h
|
||||
extern int findFlash(char* mess); // programFpgaNios.h
|
||||
extern void eraseFlash(); // programFpgaNios.h
|
||||
extern int eraseAndWriteToFlash(char* mess, char* fpgasrc, uint64_t fsize); // programFpgaNios.h
|
||||
extern int writeFPGAProgram(char* mess, char* fpgasrc, uint64_t fsize, FILE* filefp); // programFpgaNios.h
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(JUNGFRAUD) || defined(EIGERD)
|
||||
|
@ -20,6 +20,9 @@ void validate64(int64_t arg, int64_t retval, char* modename, enum numberMode num
|
||||
int executeCommand(char* command, char* result, enum TLogLevel level);
|
||||
int M_nofunc(int);
|
||||
int M_nofuncMode(int);
|
||||
#if defined(MYTHEN3D) || defined(GOTTHARD2D)
|
||||
extern void rebootControllerAndFPGA();
|
||||
#endif
|
||||
|
||||
// functions called by client
|
||||
int exec_command(int);
|
||||
|
Reference in New Issue
Block a user