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.
 
 
 
 
 
 

126 lines
3.7 KiB

#ifndef __CLASSSOC_H_INCL__
#define __CLASSSOC_H_INCL__
#include "../../components/base/basicLogCollection.h"
#include "../../../include/device/modules/pru/pru_ss.h"
#include "../../../include/device/modules/pru/tupus_ext.h"
#include "../../../include/device/modules/pwmss/sys_pwmss.h"
/**
* TODO: Add class description
*
* @author gagua
*/
class classSOC {
private:
bool m_bPRMCM_OK;
bool m_bPWM_SS0_OK;
bool m_bPWM_SS1_OK;
bool m_bPWM_SS2_OK;
bool m_bPWM_SS3_OK;
bool m_bPWM_SS4_OK;
bool m_bPWM_SS5_OK;
bool m_bPRU_ICSS0_OK;
bool m_bPRU_ICSS1_OK;
bool m_bADC0_OK;
bool m_bADC1_OK;
void *m_pPRMCM_MMAP;
void *m_pPRU_ICSS0_MMAP;
void *m_pPRU_ICSS1_MMAP;
void *m_pPWM_SS0_MMAP;
void *m_pPWM_SS1_MMAP;
void *m_pPWM_SS2_MMAP;
void *m_pPWM_SS3_MMAP;
void *m_pPWM_SS4_MMAP;
void *m_pPWM_SS5_MMAP;
void *m_pADC0_MMAP;
void *m_pADC1_MMAP;
basicLogCollection *m_pLog;
public:
// Method to fetch singleton instance.
static classSOC* getInstance();
// Destructor
virtual ~classSOC();
protected:
// Constructor - protected so users cannot call it.
classSOC();
private:
// private static member referencing the single instance of the object
// TODO: Replace classSOC with the type of object you want to
// return the single instance of
static classSOC* _instance;
// Copy constructor
// Declared but not defined to prevent auto-generated
// copy constructor. Refer to "Effective C++" by Meyers
classSOC(const classSOC& src);
// Assignment operator
// Declared but not defined to prevent auto-generated
// assignment operator. Refer to "Effective C++" by Meyers
classSOC& operator=(const classSOC& src);
bool access_PRCM_MODULE( void );
bool access_PRUSS_MODULE( uint32_t MODID );
bool access_PWMSS_MODULE( uint32_t MODID );
bool access_ADC_MODULE( uint32_t MODID );
bool enable_SYSTEM_BUSSES( void );
bool enable_PRUSS_MODULE( void );
bool enable_PWMSS_MODULE( uint32_t MODID );
bool enable_ADC01_MODULE( void );
bool reset_PRUSS_MODULE( void );
bool disable_PRUSS_MODULE( void );
public:
/* Reg Accessebility */
volatile structTUPUS *getTUPUS( uint8_t MODID, uint8_t unit );
volatile pruCfg *getPRUSS_GFG( uint8_t MODID );
volatile sysPwmss *getPWMSS_CTRL( uint8_t MODID );
volatile pruCtrl *getPRU_CTRL( uint8_t MODID, uint8_t unit );
bool cleanTUPUS( uint8_t MODID, uint8_t unit );
/* PRUSS Functionality */
bool pru_disable( uint8_t MODID, uint8_t unit );
bool pru_enable( uint8_t MODID, uint8_t unit );
bool pru_clk_disable( uint8_t MODID, uint8_t unit );
bool pru_clk_enable( uint8_t MODID, uint8_t unit );
bool pru_save( uint8_t MODID, uint8_t unit, CSTR Name );
bool pru_load( uint8_t MODID, uint8_t unit, CSTR Name );
bool pru_run( uint8_t MODID, uint8_t unit );
bool pru_stop( uint8_t MODID, uint8_t unit );
bool pru_sreset( uint8_t MODID, uint8_t unit );
/* PRU Core specific */
bool setCoreOnLine( uint8_t unit );
bool sendCoreCommand( uint8_t MODID, uint8_t unit, uint32_t cmd, uint32_t address, uint32_t data );
};
// TODO: Uncomment the copy constructor when you need it.
//inline classSOC::classSOC(const classSOC& src)
//{
// // TODO: copy
//}
// TODO: Uncomment the assignment operator when you need it.
//inline classSOC& classSOC::operator=(const classSOC& rhs)
//{
// if (this == &rhs) {
// return *this;
// }
//
// // TODO: assignment
//
// return *this;
//}
#endif // __CLASSSOC_H_INCL__