Updated Aufgabe2-4
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#µController dependent flags
|
||||
MCFLAGS =-mcpu=cortex-a9 -march=armv7-a -mthumb -mthumb-interwork -mfloat-abi=softfp -mfpu=neon
|
||||
|
||||
#Optimization
|
||||
OPTIMIZE=-O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections
|
||||
|
||||
@@ -7,5 +8,4 @@ OPTIMIZE=-O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-section
|
||||
DEBUG =-g3
|
||||
|
||||
#Linker flags
|
||||
LDFLAGS = -nostartfiles -Xlinker --gc-sections
|
||||
|
||||
LDFLAGS = -nostartfiles -Xlinker --gc-sections -lm
|
||||
|
||||
@@ -8,13 +8,13 @@ SRC += $(SRC_DIR)/ucos_v1_42/ucos/bsp/src/$(ARCH)/asm_vectors.S
|
||||
SRC += $(SRC_DIR)/ucos_v1_42/ucos/components/ucos_osii/src/bsp/$(ARCH)/ucos_osii_bsp.c
|
||||
SRC += $(SRC_DIR)/ucos_v1_42/ucos/components/ucos_common/src/$(ARCH)/cpu_bsp.c
|
||||
|
||||
SRC += $(SRC_DIR)/Modules/MMU/mmu.c
|
||||
|
||||
|
||||
SRC += $(SRC_DIR)/APP/$(APP)/$(ARCH)/core$(CORE)/main.c
|
||||
SRC += $(SRC_DIR)/APP/$(APP)/$(ARCH)/core$(CORE)/src/app_hooks.c
|
||||
SRC += $(SRC_DIR)/APP/$(APP)/$(ARCH)/core$(CORE)/src/uartps_cfg.c
|
||||
|
||||
SRC += $(SRC_DIR)/ucos_v1_42/micrium_source/uCOS-II/Ports/ARM-Cortex-A/Generic/GNU/os_cpu_a_vfp-none.S
|
||||
SRC += $(SRC_DIR)/ucos_v1_42/micrium_source/uCOS-II/Ports/ARM-Cortex-A/Generic/GNU/os_cpu_a_vfp-d32.S
|
||||
SRC += $(SRC_DIR)/ucos_v1_42/micrium_source/uCOS-II/Ports/ARM-Cortex-A/Generic/GNU/os_cpu_c.c
|
||||
|
||||
SRC += $(SRC_DIR)/ucos_v1_42/micrium_source/uC-CPU/Cache/ARM/armv7_generic_l1/GNU/cpu_cache_armv7_generic_l1_a.S
|
||||
@@ -36,3 +36,6 @@ SRC += $(SRC_DIR)/ucos_v1_42/micrium_source/uC-Common/Collections/slist.c
|
||||
SRC += $(SRC_DIR)/ucos_v1_42/micrium_source/uC-Common/Auth/auth.c
|
||||
|
||||
-include $(SRC_DIR)/ucos_v1_42/micrium_source/uCOS-II/Source/subdir.mk
|
||||
|
||||
#mmu
|
||||
SRC += $(SRC_DIR)/Modules/MMU/mmu.c
|
||||
|
||||
@@ -151,6 +151,9 @@ void App_TaskDelHook (OS_TCB *ptcb)
|
||||
#if OS_VERSION >= 251
|
||||
void App_TaskIdleHook (void)
|
||||
{
|
||||
__asm volatile( "dsb" );
|
||||
__asm volatile( "wfi" );
|
||||
__asm volatile( "isb" );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ SRC += $(SRC_DIR)/APP/$(APP)/$(ARCH)/core$(CORE)/src/ttc_timer.c
|
||||
SRC += $(SRC_DIR)/APP/$(APP)/$(ARCH)/core$(CORE)/src/xttcps_g.c
|
||||
SRC += $(SRC_DIR)/APP/$(APP)/$(ARCH)/core$(CORE)/src/xgpiops_g.c
|
||||
|
||||
SRC += $(SRC_DIR)/ucos_v1_42/micrium_source/uCOS-II/Ports/ARM-Cortex-A/Generic/GNU/os_cpu_a_vfp-none.S
|
||||
SRC += $(SRC_DIR)/ucos_v1_42/micrium_source/uCOS-II/Ports/ARM-Cortex-A/Generic/GNU/os_cpu_a_vfp-d32.S
|
||||
SRC += $(SRC_DIR)/ucos_v1_42/micrium_source/uCOS-II/Ports/ARM-Cortex-A/Generic/GNU/os_cpu_c.c
|
||||
|
||||
SRC += $(SRC_DIR)/ucos_v1_42/micrium_source/uC-CPU/Cache/ARM/armv7_generic_l1/GNU/cpu_cache_armv7_generic_l1_a.S
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
#include <lib_def.h>
|
||||
|
||||
#include "../../../../Aufgabe3/ps7/core0/cfg/xparameters.h"
|
||||
#include <xparameters.h>
|
||||
|
||||
#define APP_CPU_ENABLED DEF_ENABLED
|
||||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* gt_cfg.h
|
||||
*
|
||||
* Created on: Aug 19, 2014
|
||||
* Author: matthiasb
|
||||
*/
|
||||
|
||||
#ifndef GT_CFG_H_
|
||||
#define GT_CFG_H_
|
||||
|
||||
#define GT_USE_NP_REGIONS 1
|
||||
#define GT_USE_NP_MEAS 1
|
||||
#define GT_NUM_OF_TASKS 3
|
||||
#define GT_REPORT_CONSOLE 0
|
||||
#define GT_REPORT_SVC 0
|
||||
|
||||
#define GT_TTC_DEVICE_ID XPAR_PS7_TTC_2_DEVICE_ID
|
||||
#define GT_TTC_PWM_INTR_ID XPAR_XTTCPS_2_INTR
|
||||
#define GT_TIMER_TICKS_PER_SEC 10000
|
||||
|
||||
#include "../../../../Aufgabe3/ps7/core0/cfg/gt_core_cfg.h"
|
||||
|
||||
#endif /* GT_CFG_H_ */
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* imu.h
|
||||
*
|
||||
* Created on: Nov 6, 2018
|
||||
* Author: laurenzb
|
||||
*/
|
||||
|
||||
#ifndef SRC_APP_AUFGABE7_PS7_CORE0_CFG_IMU_H_
|
||||
#define SRC_APP_AUFGABE7_PS7_CORE0_CFG_IMU_H_
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "../../../../Aufgabe3/ps7/core0/cfg/xparameters.h"
|
||||
#include "xiicps.h"
|
||||
|
||||
|
||||
|
||||
|
||||
#define MPU9250_AD 0x68 //Adresse d. I²C slaves festlegen
|
||||
#define GYRO_CONFIG_AD 0x1B //Gyroskop config register
|
||||
#define ACCEL_CONFIG_1_AD 0x1C //Beschleunigungssensor config reg1
|
||||
#define ACCEL_CONFIG_2_AD 0x1D //Beschleunigungssensor config reg1
|
||||
#define CONFIG_AD 0x1A //IMU config reg
|
||||
#define PWR_MGMT_1_AD 0x6B //cloc power management register
|
||||
#define GYRO_XOUT_H_AD 0x43 //hier das Startregister der Gyroskopdaten
|
||||
#define ACCEL_XOUT_H_AD 0x3B //startreg Accel Daten
|
||||
|
||||
#define IIC_DEVICE_ID XPAR_XIICPS_1_DEVICE_ID //??? in xparameters.h noch die iic Daten für das Gerät festlegen?
|
||||
#define IIC_SCLK_RATE 100000
|
||||
|
||||
unsigned int mpu9250_Imu_Init(void *pdata);
|
||||
uint8_t mpu9250_Iic_Init();
|
||||
void mpu9250_Init(void);
|
||||
uint8_t mpu9250_Write_Reg(uint8_t iic_address, uint8_t data);
|
||||
int8_t mpu9250_Read_Data(uint8_t iic_address, uint8_t length, u8 RecvBuffer[]);
|
||||
uint8_t mpu9250_Map_Gyro_Data(int16_t result[]);
|
||||
uint8_t mpu9250_Map_Acc_Data(int16_t result[]);
|
||||
uint8_t mpu9250_Read_Status(int16_t result[]);
|
||||
unsigned int mpu9250_Get_Data_Task(void *pdata);
|
||||
|
||||
|
||||
|
||||
#endif /* SRC_APP_AUFGABE7_PS7_CORE0_CFG_IMU_H_ */
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
/*
|
||||
* pid.h
|
||||
*
|
||||
* Created on: Jan 28, 2019
|
||||
* Author: laurenzb
|
||||
*/
|
||||
|
||||
#ifndef SRC_APP_AUFGABE7_PS7_CORE0_CFG_PID_H_
|
||||
#define SRC_APP_AUFGABE7_PS7_CORE0_CFG_PID_H_
|
||||
|
||||
unsigned int pid_Init(void *pdata);
|
||||
int16_t pid_Constrain(int16_t value, int16_t lowerBorder, int16_t higherBorder);
|
||||
unsigned int pid_Task(void *pdata);
|
||||
int16_t map(int16_t x, int16_t in_min, int16_t in_max, int16_t out_min, int16_t out_max);
|
||||
|
||||
|
||||
|
||||
#endif /* SRC_APP_AUFGABE7_PS7_CORE0_CFG_PID_H_ */
|
||||
@@ -11,5 +11,9 @@
|
||||
#define SRC_APP_AUFGABE3_PS7_CORE0_CFG_TTC_TIMER_H_
|
||||
|
||||
|
||||
//Dummy-Define for Excercise 3 only, there is no PID yet
|
||||
#ifndef PID_BOUND
|
||||
#define PID_BOUND 1000
|
||||
#endif
|
||||
|
||||
#endif /* SRC_APP_AUFGABE3_PS7_CORE0_CFG_TTC_TIMER_H_ */
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#define DEF_ENABLED 1
|
||||
#define DEF_DISABLED 0
|
||||
|
||||
#include "../../../../Aufgabe3/ps7/core0/cfg/xparameters_ps.h"
|
||||
#include "xparameters_ps.h"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -18,8 +18,14 @@
|
||||
#include "ttc_timer.h"
|
||||
|
||||
|
||||
int16_t pidValue = 0;
|
||||
|
||||
void InitDoneCallback(void * p_arg) {
|
||||
(void) p_arg;
|
||||
CPU_SR cpu_sr;
|
||||
OS_ENTER_CRITICAL();
|
||||
// This is a critcal section. Usefull for accessing global variables shared between tasks
|
||||
OS_EXIT_CRITICAL();
|
||||
UCOS_Print("OS started!\r\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -151,6 +151,9 @@ void App_TaskDelHook (OS_TCB *ptcb)
|
||||
#if OS_VERSION >= 251
|
||||
void App_TaskIdleHook (void)
|
||||
{
|
||||
__asm volatile( "dsb" );
|
||||
__asm volatile( "wfi" );
|
||||
__asm volatile( "isb" );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "ucos_int.h"
|
||||
#include "ttc_timer.h"
|
||||
#include "xgpiops.h"
|
||||
#include "pid.h"
|
||||
|
||||
|
||||
#define TTC_PWM_INTR_ID XPAR_XTTCPS_0_INTR
|
||||
|
||||
@@ -18,7 +18,7 @@ SRC += $(SRC_DIR)/APP/$(APP)/$(ARCH)/core$(CORE)/src/xttcps_g.c
|
||||
SRC += $(SRC_DIR)/APP/$(APP)/$(ARCH)/core$(CORE)/src/xgpiops_g.c
|
||||
SRC += $(SRC_DIR)/APP/$(APP)/$(ARCH)/core$(CORE)/src/xiicps_g.c
|
||||
|
||||
SRC += $(SRC_DIR)/ucos_v1_42/micrium_source/uCOS-II/Ports/ARM-Cortex-A/Generic/GNU/os_cpu_a_vfp-none.S
|
||||
SRC += $(SRC_DIR)/ucos_v1_42/micrium_source/uCOS-II/Ports/ARM-Cortex-A/Generic/GNU/os_cpu_a_vfp-d32.S
|
||||
SRC += $(SRC_DIR)/ucos_v1_42/micrium_source/uCOS-II/Ports/ARM-Cortex-A/Generic/GNU/os_cpu_c.c
|
||||
|
||||
SRC += $(SRC_DIR)/ucos_v1_42/micrium_source/uC-CPU/Cache/ARM/armv7_generic_l1/GNU/cpu_cache_armv7_generic_l1_a.S
|
||||
|
||||
@@ -21,12 +21,14 @@
|
||||
#define IIC_DEVICE_ID XPAR_XIICPS_1_DEVICE_ID
|
||||
#define IIC_SCLK_RATE 4000000
|
||||
|
||||
|
||||
int mpu9250_Imu_Init(void *pdata);
|
||||
uint8_t mpu9250_Iic_Init();
|
||||
void mpu9250_Init(void);
|
||||
uint8_t mpu9250_Write_Reg();
|
||||
int8_t mpu9250_Read_Data();
|
||||
uint8_t mpu9250_Read_Status();
|
||||
void mpu9250_Get_Data_Task();
|
||||
int mpu9250_Get_Data_Task(void *pdata);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
/*
|
||||
* pid.h
|
||||
*
|
||||
* Created on: Jan 28, 2019
|
||||
* Author: laurenzb
|
||||
*/
|
||||
|
||||
#ifndef SRC_APP_AUFGABE7_PS7_CORE0_CFG_PID_H_
|
||||
#define SRC_APP_AUFGABE7_PS7_CORE0_CFG_PID_H_
|
||||
|
||||
unsigned int pid_Init(void *pdata);
|
||||
int16_t pid_Constrain(int16_t value, int16_t lowerBorder, int16_t higherBorder);
|
||||
unsigned int pid_Task(void *pdata);
|
||||
int16_t map(int16_t x, int16_t in_min, int16_t in_max, int16_t out_min, int16_t out_max);
|
||||
|
||||
|
||||
|
||||
#endif /* SRC_APP_AUFGABE7_PS7_CORE0_CFG_PID_H_ */
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* ttc_timer.h
|
||||
*
|
||||
* Created on: Nov 13, 2018
|
||||
* Author: laurenzb
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef SRC_APP_AUFGABE7_PS7_CORE0_CFG_TTC_TIMER_H_
|
||||
#define SRC_APP_AUFGABE7_PS7_CORE0_CFG_TTC_TIMER_H_
|
||||
|
||||
//#define INTC_DEVICE_ID XPAR_SCUGIC_0_DEVICE_ID
|
||||
//#define TTC_DEVICE_ID XPAR_XTTCPS_0_DEVICE_ID
|
||||
//#define TICK_TIMER_FREQ_HZ 100 /* Tick timer counter's output frequency */
|
||||
//#define TTC_PWM_DEVICE_ID XPAR_XTTCPS_0_DEVICE_ID
|
||||
//
|
||||
//
|
||||
//#define TTC_PWM_DEVICE_ID XPAR_XTTCPS_0_DEVICE_ID
|
||||
//#define TTC_PWM_INTR_ID XPAR_XTTCPS_0_INTR
|
||||
//#define TTCPS_CLOCK_HZ XPAR_XTTCPS_0_CLOCK_HZ
|
||||
//
|
||||
//
|
||||
//#define TICK_TIMER_FREQ_HZ 100 /* Tick timer counter's output frequency */
|
||||
//#define PWM_OUT_FREQ 350 /* PWM timer counter's output frequency */
|
||||
//
|
||||
//#define TICKS_PER_CHANGE_PERIOD TICK_TIMER_FREQ_HZ * 5 /* Tick signals PWM */
|
||||
|
||||
int timer_Task(void *pdata);
|
||||
int timer_Init();
|
||||
|
||||
#endif /* SRC_APP_AUFGABE7_PS7_CORE0_CFG_TTC_TIMER_H_ */
|
||||
@@ -151,6 +151,9 @@ void App_TaskDelHook (OS_TCB *ptcb)
|
||||
#if OS_VERSION >= 251
|
||||
void App_TaskIdleHook (void)
|
||||
{
|
||||
__asm volatile( "dsb" );
|
||||
__asm volatile( "wfi" );
|
||||
__asm volatile( "isb" );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
* from the IMU/MPU 9250 via I2C
|
||||
* Created on: Nov 6, 2018
|
||||
* Author: laurenzb
|
||||
* more information to iic at:
|
||||
* https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/iicps/examples/xiicps_polled_master_example.c
|
||||
* https://forums.xilinx.com/t5/Embedded-Development-Tools/XIIC-PS-Master-Send-polled/td-p/664488
|
||||
*/
|
||||
#include "imu.h"
|
||||
#include "xiicps.h"
|
||||
@@ -16,7 +19,7 @@
|
||||
#include "ucos_bsp.h"
|
||||
|
||||
|
||||
void mpu9250_Get_Data_Task() {
|
||||
int mpu9250_Get_Data_Task(void *pdata) {
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +27,7 @@ uint8_t mpu9250_Iic_Init(){
|
||||
|
||||
}
|
||||
|
||||
void mpu9250_Init(void){
|
||||
int mpu9250_Init(void *pdata){
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user