paparazzi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paparazzi-commits] [4963]


From: antoine drouin
Subject: [paparazzi-commits] [4963]
Date: Tue, 15 Jun 2010 17:35:12 +0000

Revision: 4963
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=4963
Author:   poine
Date:     2010-06-15 17:35:12 +0000 (Tue, 15 Jun 2010)
Log Message:
-----------

tmp file for deubing using servo connector as GPIOs

Added Paths:
-----------
    paparazzi3/trunk/sw/airborne/stm32/my_debug_servo.h

Added: paparazzi3/trunk/sw/airborne/stm32/my_debug_servo.h
===================================================================
--- paparazzi3/trunk/sw/airborne/stm32/my_debug_servo.h                         
(rev 0)
+++ paparazzi3/trunk/sw/airborne/stm32/my_debug_servo.h 2010-06-15 17:35:12 UTC 
(rev 4963)
@@ -0,0 +1,49 @@
+#ifndef MY_DEBUG_SERVO_H
+#define MY_DEBUG_SERVO_H
+
+
+/* using servo 2 connector as debug */
+
+
+#define DEBUG_SERVO1_INIT() {                                          \
+    /* S1: PC6    S2: PC7    S3: PC8 */                                        
\
+    GPIO_InitTypeDef GPIO_InitStructure;                               \
+    GPIOC->BSRR = GPIO_Pin_6 | GPIO_Pin_7 | GPIO_Pin_8 ;               \
+    RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE);              \
+    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7 | GPIO_Pin_8;        
\
+    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;                   \
+    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;                  \
+    GPIO_Init(GPIOC, &GPIO_InitStructure);                             \
+  }
+
+#define DEBUG_SERVO2_INIT() {                                  \
+    /* S4: PC9 */                                              \
+    GPIO_InitTypeDef GPIO_InitStructure;                       \
+    GPIOC->BSRR = GPIO_Pin_9;                                  \
+    RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE);      \
+    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;                  \
+    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;           \
+    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;          \
+    GPIO_Init(GPIOC, &GPIO_InitStructure);                     \
+    /* S5: PB8 and S6: PB9 */                                  \
+    GPIOB->BSRR = GPIO_Pin_8 | GPIO_Pin_9;                     \
+    RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);      \
+    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9;     \
+    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;           \
+    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;          \
+    GPIO_Init(GPIOB, &GPIO_InitStructure);                     \
+  }
+
+#define DEBUG_S1_TOGGLE() {  GPIOC->ODR ^= GPIO_Pin_6; }
+
+#define DEBUG_S2_TOGGLE() {  GPIOC->ODR ^= GPIO_Pin_7; }
+
+#define DEBUG_S3_TOGGLE() {  GPIOC->ODR ^= GPIO_Pin_8; }
+
+#define DEBUG_S4_TOGGLE() {  GPIOC->ODR ^= GPIO_Pin_9; }
+
+#define DEBUG_S5_TOGGLE() {  GPIOB->ODR ^= GPIO_Pin_8; }
+
+#define DEBUG_S6_TOGGLE() {  GPIOB->ODR ^= GPIO_Pin_9; }
+
+#endif /* MY_DEBUG_SERVO_H */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]