Added c and h file used for mapping pins on the processor
Files are not complete and will be added to continuously
This commit is contained in:
parent
7b2ead9c30
commit
bf20290dc4
132
UAV-ControlSystem/inc/stm32f4xx_revo.h
Normal file
132
UAV-ControlSystem/inc/stm32f4xx_revo.h
Normal file
@ -0,0 +1,132 @@
|
||||
/*
|
||||
* stm32f4xx_revo.h
|
||||
*
|
||||
* Created on: 8 sep. 2016
|
||||
* Author: len12007
|
||||
*/
|
||||
|
||||
#ifndef UTILITIES_STM32F4XX_REVO_STM32F4XX_REVO_H_
|
||||
#define UTILITIES_STM32F4XX_REVO_STM32F4XX_REVO_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------- */
|
||||
#include "stm32f4xx_hal.h"
|
||||
|
||||
//Code here
|
||||
|
||||
//Leds? (taken from betaflight REVO h file)
|
||||
#define Led0_PIN GPIO_PIN_5 //Correct?
|
||||
#define Led0_GPIO_PORT GPIOB //Correct?
|
||||
#define Led1 GPIO_PIN_4 //Correct?
|
||||
#define Led1_GPIO_PORT GPIOB //Correct?
|
||||
|
||||
|
||||
//Servo out, To be used for motors?
|
||||
#define SERVO_OUT_1_PIN GPIO_PIN_0
|
||||
#define SERVO_OUT_1_GPIO_PORT GPIOB
|
||||
#define SERVO_OUT_2_PIN GPIO_PIN_1
|
||||
#define SERVO_OUT_2_GPIO_PORT GPIOB
|
||||
#define SERVO_OUT_3_PIN GPIO_PIN_3
|
||||
#define SERVO_OUT_3_GPIO_PORT GPIOA
|
||||
#define SERVO_OUT_4_PIN GPIO_PIN_2
|
||||
#define SERVO_OUT_4_GPIO_PORT GPIOA
|
||||
#define SERVO_OUT_5_PIN GPIO_PIN_1
|
||||
#define SERVO_OUT_5_GPIO_PORT GPIOA
|
||||
#define SERVO_OUT_6_PIN GPIO_PIN_0
|
||||
#define SERVO_OUT_6_GPIO_PORT GPIOA
|
||||
|
||||
|
||||
/* Flex I/O 1-10 */
|
||||
//#define FLEX_IO_1_PIN GND
|
||||
//#define FLEX_IO_1_PORT GND
|
||||
//#define FLEX_IO_2_PIN VCC_UNREG
|
||||
//#define FLEX_IO_2_PORT VCC_UNREG
|
||||
#define FLEX_IO_3_PIN GPIO_PIN_12
|
||||
#define FLEX_IO_3_PORT GPIOB
|
||||
#define FLEX_IO_4_PIN GPIO_PIN_13
|
||||
#define FLEX_IO_4_PORT GPIOB
|
||||
#define FLEX_IO_5_PIN GPIO_PIN_14
|
||||
#define FLEX_IO_5_PORT GPIOB
|
||||
#define FLEX_IO_6_PIN GPIO_PIN_15
|
||||
#define FLEX_IO_6_PORT GPIOB
|
||||
#define FLEX_IO_7_PIN GPIO_PIN_6
|
||||
#define FLEX_IO_7_PORT GPIOC
|
||||
#define FLEX_IO_8_PIN GPIO_PIN_7
|
||||
#define FLEX_IO_8_PORT GPIOC
|
||||
#define FLEX_IO_9_PIN GPIO_PIN_8
|
||||
#define FLEX_IO_9_PORT GPIOC
|
||||
#define FLEX_IO_10_PIN GPIO_PIN_9
|
||||
#define FLEX_IO_10_PORT GPIOC
|
||||
|
||||
|
||||
/* Communication */
|
||||
#define USE_USART1
|
||||
#define USART1_RX_PIN GPIO_PIN_10
|
||||
#define USART1_RX_PORT GPIOA
|
||||
#define USART1_TX_PIN GPIO_PIN_9
|
||||
#define USART1_TX_PORT GPIOA
|
||||
|
||||
#define USE_USART3
|
||||
#define USART3_RX_PIN GPIO_PIN_11
|
||||
#define USART3_RX_PORT GPIOB
|
||||
#define USART3_TX_PIN GPIO_PIN_10
|
||||
#define USART3_TX_PORT GPIOB
|
||||
|
||||
#define USE_USART6
|
||||
#define USART6_RX_PIN GPIO_PIN_7
|
||||
#define USART6_RX_PORT GPIOC
|
||||
#define USART6_TX_PIN GPIO_PIN_6
|
||||
|
||||
#define USART6_TX_PORT GPIOC
|
||||
|
||||
|
||||
/* Gyro */
|
||||
#define GYRO
|
||||
#define MPU6000_CS_PIN GPIO_PIN_4
|
||||
#define MPU6000_CS_PORT GPIOA
|
||||
|
||||
#define MPU6000_SPI_INSTANCE SPI1 //Dont know if necessary for us to specify
|
||||
|
||||
|
||||
/* Baro */
|
||||
|
||||
|
||||
/* Compass */
|
||||
|
||||
|
||||
/* GPS */
|
||||
|
||||
|
||||
/* Define all the moter of the system, servos + extra */
|
||||
#define MOTOR_1_PIN SERVO_OUT_1_PIN
|
||||
#define MOTOR_1_PORT SERVO_OUT_1_GPIO_PORT
|
||||
#define MOTOR_2_PIN SERVO_OUT_2_PIN
|
||||
#define MOTOR_2_PORT SERVO_OUT_2_GPIO_PORT
|
||||
#define MOTOR_3_PIN SERVO_OUT_3_PIN
|
||||
#define MOTOR_3_PORT SERVO_OUT_3_GPIO_PORT
|
||||
#define MOTOR_4_PIN SERVO_OUT_4_PIN
|
||||
#define MOTOR_4_PORT SERVO_OUT_4_GPIO_PORT
|
||||
#define MOTOR_5_PIN SERVO_OUT_5_PIN
|
||||
#define MOTOR_5_PORT SERVO_OUT_5_GPIO_PORT
|
||||
#define MOTOR_6_PIN SERVO_OUT_6_PIN
|
||||
#define MOTOR_6_PORT SERVO_OUT_6_GPIO_PORT
|
||||
#define MOTOR_7_PIN
|
||||
#define MOTOR_7_PORT
|
||||
#define MOTOR_8_PIN
|
||||
#define MOTOR_8_PORT
|
||||
#define MOTOR_9_PIN
|
||||
#define MOTOR_9_PORT
|
||||
#define MOTOR_10_PIN
|
||||
#define MOTOR_10_PORT
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* UTILITIES_STM32F4XX_REVO_STM32F4XX_REVO_H_ */
|
9
UAV-ControlSystem/src/stm32f4xx_revo.c
Normal file
9
UAV-ControlSystem/src/stm32f4xx_revo.c
Normal file
@ -0,0 +1,9 @@
|
||||
/*
|
||||
* stm32f4xx-REVO.c
|
||||
*
|
||||
* Created on: 8 sep. 2016
|
||||
* Author: len12007
|
||||
*/
|
||||
|
||||
|
||||
#include "stm32f4xx_revo.h"
|
Reference in New Issue
Block a user