You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.9 KiB
61 lines
1.9 KiB
#ifndef __SITARA_PRUSS_HEADER__
|
|
#define __SITARA_PRUSS_HEADER__
|
|
|
|
#include <stdio.h>
|
|
#include <fcntl.h>
|
|
#include <unistd.h>
|
|
#include <errno.h>
|
|
#include <string.h>
|
|
#include <sys/mman.h>
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
|
|
//#define CLI_NCURSES
|
|
|
|
#ifdef CLI_NCURSES
|
|
#include "../../../../cli/cli.h"
|
|
#endif
|
|
|
|
#include "../../general/sitara-am437x.h"
|
|
#include "pru_ctrl.h"
|
|
#include "pru_cfg.h"
|
|
#include "tupus_ext.h"
|
|
|
|
#define PRUSS_BLOCK_SIZE 0x400000 // 4MB
|
|
#define PRU_HALT_TIMEOUT 0xFFFF
|
|
#define DEFAULT_PRU_SIGNAL_REACTION 5
|
|
|
|
//#define PRUSS0_DATA_SIZE 0x1000
|
|
//#define PRUSS0_CODE_SIZE 0x1000
|
|
|
|
//#define PRUSS1_DATA_SIZE 0x2000
|
|
//#define PRUSS1_CODE_SIZE 0x3000
|
|
|
|
bool init_PRU_ICSS0( void );
|
|
bool init_PRU_ICSS1( void );
|
|
bool pru_disable( uint8_t system, uint8_t unit );
|
|
bool pru_enable( uint8_t system, uint8_t unit );
|
|
bool pru_clk_disable( uint8_t system, uint8_t unit );
|
|
bool pru_clk_enable( uint8_t system, uint8_t unit );
|
|
bool _pru_load( uint8_t system, uint8_t unit, char *fileName );
|
|
bool _pru_save( uint8_t system, uint8_t unit, char *fileName );
|
|
bool _pru_sreset( uint8_t system, uint8_t unit );
|
|
bool _pru_run( uint8_t system, uint8_t unit );
|
|
bool _pru_stop( uint8_t system, uint8_t unit );
|
|
bool _pru_waitForHalt( uint8_t system, uint8_t unit );
|
|
void close_PRU_ICSS0( void );
|
|
void close_PRU_ICSS1( void );
|
|
bool _setHost0Online( void );
|
|
bool _setHost2Online( void );
|
|
bool _setHost3Online( void );
|
|
bool _setHost1Online( void );
|
|
|
|
volatile structTUPUS *_getTUPUS(uint8_t system, uint8_t unit );
|
|
volatile pruCfg *_getPRUSS_GFG( uint8_t system );
|
|
volatile pruCtrl *_getPRU_CTRL( uint8_t system, uint8_t unit );
|
|
|
|
void _cleanTUPUS( uint8_t system, uint8_t unit );
|
|
void _setCoreOnline( uint8_t system, uint8_t unit );
|
|
bool _sendCommand( uint8_t system, uint8_t unit, uint32_t cmd, uint32_t address, uint32_t data );
|
|
|
|
#endif
|