Difference between revisions of "User:FabienM"

From ArmadeusWiki
Jump to: navigation, search
(Blog)
 
(13 intermediate revisions by the same user not shown)
Line 8: Line 8:
 
* [[Led sensor]]
 
* [[Led sensor]]
 
* [[vim | The best editor in the world]]
 
* [[vim | The best editor in the world]]
 +
 +
= Trucs =
 +
 +
== Python en environnement virtuel ==
 +
 +
Un pense bète pour installer la version voulue de python en environnement virtuel avec virtualenv:
 +
 +
=== virtualenv et autre tkinter ===
 +
 +
<pre>
 +
apt-get install python-tk python3-tk tk-dev
 +
apt-get install python-virtualenv
 +
</pre>
 +
 +
=== Python 3.7.4 ===
 +
 +
<pre>
 +
sudo apt-get install libffi-dev
 +
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz
 +
tar -Jxvf Python-3.7.4.tar.xz
 +
cd Python-3.7.4
 +
./configure --enable-shared
 +
make
 +
sudo make install
 +
sudo ldconfig /usr/local/lib
 +
</pre>
 +
 +
=== virtualenv ===
 +
 +
* Virtual env configuration:
 +
 +
<pre>
 +
apt-get install python-virtualenv
 +
mkdir virtenv
 +
cd virtenv
 +
virtualenv --python=/usr/local/bin/python3.7 envp37
 +
</pre>
 +
 +
* enum bug fix:
 +
 +
<pre>
 +
cd ~/virtenv/envp37/lib/python3.7
 +
ln -s /usr/local/lib/python3.7/enum.py
 +
</pre>
 +
 +
* Activation:
 +
<pre>
 +
source /home/armadeus/virtenv/envp37/bin/activate
 +
</pre>
 +
 +
* Desactivation:
 +
<pre>
 +
deactivate
 +
</pre>
  
 
= '''P'''eripheral '''O'''n '''D'''emand =
 
= '''P'''eripheral '''O'''n '''D'''emand =
Line 107: Line 161:
 
</source>
 
</source>
  
=== Python ===
+
=== Python 2 ===
  
 
<source lang="python">
 
<source lang="python">
Line 114: Line 168:
 
     print "Press enter to continue"
 
     print "Press enter to continue"
 
     raw_input()
 
     raw_input()
 +
 +
</source>
 +
 +
=== Python 3 ===
 +
 +
 +
<source lang="python">
 +
 +
def pressEnterToContinue():
 +
    print("Press enter to continue")
 +
    input()
  
 
</source>
 
</source>
Line 127: Line 192:
 
* [[APF6_SP_DDR3_PINOUT]]
 
* [[APF6_SP_DDR3_PINOUT]]
 
* [[APF6_SP The full howto]]
 
* [[APF6_SP The full howto]]
 +
 +
== Wavedrom ==
 +
 +
If [https://github.com/Martoni/mediawiki_wavedrom wavedrom plugin] is installed on this wiki, we can see a beautiful waves bellow :
 +
 +
<wavedrom>
 +
{ signal: [
 +
  { name: "clk",  wave: "p......" },
 +
  { name: "bus",  wave: "x.34.5x",  data: "head body tail" },
 +
  { name: "wire", wave: "0.1..0." },
 +
]}
 +
</wavedrom>
 +
 +
= Blog =
 +
 +
* [[2022_02_18_Container_docker_pour_vieux_BSP]]

Latest revision as of 16:40, 18 February 2022

<< liste des membres


Mes petites bidouilles avec l'armadeus

Trucs

Python en environnement virtuel

Un pense bète pour installer la version voulue de python en environnement virtuel avec virtualenv:

virtualenv et autre tkinter

apt-get install python-tk python3-tk tk-dev
apt-get install python-virtualenv

Python 3.7.4

sudo apt-get install libffi-dev
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz
tar -Jxvf Python-3.7.4.tar.xz
cd Python-3.7.4
./configure --enable-shared
make
sudo make install
sudo ldconfig /usr/local/lib

virtualenv

  • Virtual env configuration:
apt-get install python-virtualenv
mkdir virtenv
cd virtenv
virtualenv --python=/usr/local/bin/python3.7 envp37
  • enum bug fix:
cd ~/virtenv/envp37/lib/python3.7
ln -s /usr/local/lib/python3.7/enum.py
  • Activation:
source /home/armadeus/virtenv/envp37/bin/activate
  • Desactivation:
deactivate

Peripheral On Demand

Participation à la documentation ArmadeuS Project

Trash

Projets

Liens utiles

Somes usefull tricks

press a button

Here, function to «press enter to continue» on apf in different languages :

setbit /proc/driver/gpio/portFmode 13 1 # set pin as gpio
setbit /proc/driver/gpio/portFdir 13 0  # set pin as input
setbit /proc/driver/gpio/portFirq 13 1  # irq on rising edge

/usr/bin/testsuite/testbutton /dev/gpio/PF13 3

With testbutton program comming from target/linux/modules/fpga/wishbone_example/wb_button. Type «make» in this directory to compile it.

Logging with timestamps in seconds

#!/bin/sh
while true
do
LIGHT=$(cat /sys/class/hwmon/hwmon0/device/in3_input)
TIME=$(date +%s)
echo $TIME", sec, "$LIGHT", mV," >> log;
sleep 2
done

Press enter to continue

C

#include <stdio.h>

void pressEnterToContinue(void)
{
    printf("Press enter to continue\n");
    getc(stdin);//XXX 
    while( getc(stdin) != '\n') ; 
}

C++

#include <stdio.h> //XXX
#include <iostream>

void pressEnterToContinue(void)
{
    cout << "Press enter to continue" << endl;
    getc(stdin); //XXX
    std::cin.ignore( std::numeric_limits <std::streamsize> ::max(), '\n' );
}

Python 2

def pressEnterToContinue():
    print "Press enter to continue"
    raw_input()

Python 3

def pressEnterToContinue():
    print("Press enter to continue")
    input()

Kernel Driver

bac à sable

Dessin.svg

Wavedrom

If wavedrom plugin is installed on this wiki, we can see a beautiful waves bellow :

Blog