Rčtol
www.electronics.cat

mini6410

4 [ca] - Programa Qt de codi obert de control dels ports GPK8 i GPK13 del mini6410
4 [en] - Open source Qt application to control GPK8 and GPK13 ports on mini6410
4 [es] - Programa Qt de código abierto de control de los puertos GPK8 y GPK13 del mini6410

GPK8 and GPK13 are located at CON9 on mini6410 board :

imatges/SDIO_II.png

A simple hardware to test GPK8 and GPK13 can be :

imatges/GPK8_13sch.png

Using as base devmem2.c at http://www.simtec.co.uk/appnotes/AN0014/ and datasheet S3C6410X.pdf :

gpk8_13w.c: Writes GPK8 and GPK13 at mini6410 if there are 3 arguments. Without arguments it shows status info of GPK8 and GPK13.
To compile : arm-linux-gcc gpk8_13w.c -o gpk8_13w
use : ./gpk8_13w a b
a : 0 or 1 to be written to GPK8
b : 0 or 1 to be written to GPK13
for instance :
./gpk8_13w 0 1

(It writes 0 to GPK8 and 1 to GPK13)
Code and binary : gpk8_13w.zip

Qt code, rcS and binary : qtGpk.zip


imatges/gpkInfo001.png
imatges/gpkInfo002.png
imatges/gpkInfo003.png
imatges/gpkInfo004.png

To remove dialog's title bar is used Qt::FramelessWindowHint as an argument of QDialog :
QecGpk::QecGpk(QWidget *parent) :
    QDialog(parent, Qt::FramelessWindowHint | Qt::WindowSystemMenuHint),
    ui(new Ui::QecGpk)
{
    ui->setupUi(this);
    ucCounter = 0x00;
    bCounting = false;
    ui->horizontalSlider->setMinimum(100);
    nSliderValue = ui->horizontalSlider->value();
    connect(this,SIGNAL(vSignalCounterButtonPressed(QString)),
            this,SLOT(vSlotUpdateGuiWidgets(QString)));
    timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(vTimerManagement()));
}

vTimerManagement() slot function :
void QecGpk::vTimerManagement(){
    ucCounter++;
    if(ucCounter > 0x03)
        ucCounter = 0x00;
    ui->checkBoxGPK8->setChecked(ucCounter & 0x01);
    ui->checkBoxGPK13->setChecked(ucCounter & 0x02);
    vUpdateLeds();
}

Direct system calls to gpk8_13w :
void QecGpk::vUpdateLeds(){
    if(ui->checkBoxGPK8->isChecked()){
        if(ui->checkBoxGPK13->isChecked())
            system("./root/Applications/electronics.cat/proves/gpk8_13w 0 0");
        else
            system("./root/Applications/electronics.cat/proves/gpk8_13w 0 1");
    }else{
        if(ui->checkBoxGPK13->isChecked())
            system("./root/Applications/electronics.cat/proves/gpk8_13w 1 0");
        else
            system("./root/Applications/electronics.cat/proves/gpk8_13w 1 1");
    }
}


<<