summaryrefslogtreecommitdiff
path: root/2004/n/fpga/src/packages/servo_const.vhd
blob: b6b5714e2e9057d5d4b4c99de14e81a2b4b611a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
-- servo_const.vhd
-- Eurobot 2004 : APB Team
-- Auteur : Pierre-Andr� Galmes
-- Fichier de d�claration de constantes de pwm.

-- RQ : pour une indentation bien sous vim : 
--	1 - ":set shiftwidth=4"
-- 	2 - se placer sous "package nono_const is"
--	3 - tapez : = puis shift+G

library ieee;
use	ieee.std_logic_1164.all;
use	ieee.std_logic_arith.all;
use	ieee.std_logic_unsigned.all;

use	work.nono_const.all;

-- Constantes relatives au module PWM. 
package servo_const is

    -- Nb de p�riode de l'horloge � 1us pour avoir 1ms : 1000 : x"03E8".
    constant SERVO_VALUE_MIN : T_DOUBLE_OCTET := x"03E8";

    -- Nb de p�riodes de l'horloge � 1us pour avoir 2ms : 2000 : x"07D0".
    constant SERVO_VALUE_MAX : T_DOUBLE_OCTET := x"07D0";

    -- Nb de p�riodes de l'horloge � 1us pour avoir 20ms : 20000 : x"4E20".
    constant SERVO_NB_CYCLE_20MS : T_DOUBLE_OCTET := x"4E20";

    -- Nb de p�riodes de 1us � ajouter pour un incr�ment de 1 dans le 
    -- registre (incr�ment pour un interval). Le calcul est :
    -- 		(PWM_VALUE_MAX - PWM_VALUE_MIN)) / (255 - 0) = 4
    constant SERVO_INC_INT : T_OCTET := x"04";
    
end servo_const;