-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c8f369a
commit 1801dbc
Showing
788 changed files
with
82,451 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/****************************************************************************** | ||
Filename : test_MSP430FR5994.h | ||
Author : pry | ||
Date : 22/07/2017 | ||
Licence : LGPL v3+; see COPYING for details. | ||
Description : The testbench for MSP430FR5994. | ||
******************************************************************************/ | ||
|
||
/* Includes ******************************************************************/ | ||
#include "RMP.h" | ||
/* End Includes **************************************************************/ | ||
|
||
/* Defines *******************************************************************/ | ||
/* How to read counter */ | ||
#define COUNTER_READ() 0 //((TIM2->CNT)<<1) | ||
/* Are we doing minimal measurements? */ | ||
/* #define MINIMAL_SIZE */ | ||
/* The MSP430 timers are all 16 bits, so */ | ||
typedef u16 tim_t; | ||
/* End Defines ***************************************************************/ | ||
|
||
/* Globals *******************************************************************/ | ||
#ifndef MINIMAL_SIZE | ||
void Int_Handler(void); | ||
ptr_t Stack_1[128]; | ||
struct RMP_Thd Thd_1={0}; | ||
ptr_t Stack_2[128]; | ||
struct RMP_Thd Thd_2={0}; | ||
struct RMP_Sem Sem_1={0}; | ||
//TIM_HandleTypeDef TIM2_Handle={0}; | ||
//TIM_HandleTypeDef TIM4_Handle={0}; | ||
/* End Globals ***************************************************************/ | ||
|
||
/* Begin Function:Timer_Init ************************************************** | ||
Description : Initialize the timer for timing measurements. This function needs | ||
to be adapted to your specific hardware. | ||
Input : None. | ||
Output : None. | ||
Return : None. | ||
******************************************************************************/ | ||
void Timer_Init(void) | ||
{ | ||
/* Initialize timer 2 to run at the same speed as the CPU */ | ||
|
||
} | ||
/* End Function:Timer_Init ***************************************************/ | ||
|
||
/* Begin Function:Int_Init **************************************************** | ||
Description : Initialize an periodic interrupt source. This function needs | ||
to be adapted to your specific hardware. | ||
Input : None. | ||
Output : None. | ||
Return : None. | ||
******************************************************************************/ | ||
void Int_Init(void) | ||
{ | ||
/* Initialize timer 2 to run at the same speed as the CPU */ | ||
|
||
} | ||
|
||
|
||
/* The interrupt handler */ | ||
void TIM4_IRQHandler(void) | ||
{ | ||
Int_Handler(); | ||
} | ||
/* End Function:Int_Init *****************************************************/ | ||
|
||
/* Begin Function:Int_Disable ************************************************* | ||
Description : Disable the periodic interrupt source. This function needs | ||
to be adapted to your specific hardware. | ||
Input : None. | ||
Output : None. | ||
Return : None. | ||
******************************************************************************/ | ||
void Int_Disable(void) | ||
{ | ||
/* Disable timer 4 interrupt */ | ||
|
||
} | ||
#endif | ||
/* End Function:Int_Disable **************************************************/ | ||
|
||
/* End Of File ***************************************************************/ | ||
|
||
/* Copyright (C) Evo-Devo Instrum. All rights reserved ***********************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
MProkaron/Include/Platform/MSP430/Chips/MSP430FR5994/platform_MSP430FR5994.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/****************************************************************************** | ||
Filename : platform_MSP430FR5994.h | ||
Author : pry | ||
Date : 24/06/2017 | ||
Licence : LGPL v3+; see COPYING for details. | ||
Description: The configuration file for MSP43FR5994. | ||
******************************************************************************/ | ||
|
||
/* Defines *******************************************************************/ | ||
/* The TI-supplied header */ | ||
#include <msp430.h> | ||
|
||
/* The maximum number of preemption priority levels in the system. | ||
* This parameter must be divisible by the word length - 16 is usually sufficient */ | ||
#define RMP_MAX_PREEMPT_PRIO 16 | ||
/* The maximum number of slices allowed */ | ||
#define RMP_MAX_SLICES 10000 | ||
/* The maximum number of semaphore counts allowed */ | ||
#define RMP_SEM_MAX_NUM 1000 | ||
/* Are we using custom hooks? */ | ||
#define RMP_USE_HOOKS RMP_FALSE | ||
/* The stzck size of the init thread */ | ||
#define RMP_INIT_STACK_SIZE 128 | ||
|
||
/* We are using MSP430X */ | ||
#define RMP_MSP430_X RMP_TRUE | ||
|
||
/* Other low-level initialization stuff - clock and serial */ | ||
#define RMP_MSP430_LOW_LEVEL_INIT() \ | ||
do \ | ||
{ \ | ||
/* Stop the WDT */ \ | ||
WDTCTL = WDTPW | WDTHOLD; \ | ||
} \ | ||
while(0) | ||
|
||
/* This is for debugging output */ | ||
#define RMP_MSP430_PUTCHAR(CHAR) \ | ||
do \ | ||
{ \ | ||
} \ | ||
while(0) | ||
/* End Defines ***************************************************************/ | ||
|
||
/* End Of File ***************************************************************/ | ||
|
||
/* Copyright (C) Evo-Devo Instrum. All rights reserved ***********************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
/****************************************************************************** | ||
Filename : platform_msp430.h | ||
Author : pry | ||
Date : 01/04/2017 | ||
Licence : LGPL v3+; see COPYING for details. | ||
Description : The header of "platform_msp430.c". | ||
******************************************************************************/ | ||
|
||
/* Defines *******************************************************************/ | ||
#ifdef __HDR_DEFS__ | ||
#ifndef __PLATFORM_MSP430_H_DEFS__ | ||
#define __PLATFORM_MSP430_H_DEFS__ | ||
/*****************************************************************************/ | ||
/* Basic Types ***************************************************************/ | ||
#if(DEFINE_BASIC_TYPES==TRUE) | ||
|
||
#ifndef __S32__ | ||
#define __S32__ | ||
typedef signed long s32; | ||
#endif | ||
|
||
#ifndef __S16__ | ||
#define __S16__ | ||
typedef signed int s16; | ||
#endif | ||
|
||
#ifndef __S8__ | ||
#define __S8__ | ||
typedef signed char s8; | ||
#endif | ||
|
||
#ifndef __U32__ | ||
#define __U32__ | ||
typedef unsigned long u32; | ||
#endif | ||
|
||
#ifndef __U16__ | ||
#define __U16__ | ||
typedef unsigned int u16; | ||
#endif | ||
|
||
#ifndef __U8__ | ||
#define __U8__ | ||
typedef unsigned char u8; | ||
#endif | ||
|
||
#endif | ||
/* End Basic Types ***********************************************************/ | ||
|
||
/* Begin Extended Types ******************************************************/ | ||
#ifndef __PTR_T__ | ||
#define __PTR_T__ | ||
/* The typedef for the pointers - This is the raw style. Pointers must be unsigned */ | ||
#if(RMP_MSP430_X==RMP_TRUE) | ||
typedef u32 ptr_t; | ||
#else | ||
typedef u16 ptr_t; | ||
#endif | ||
#endif | ||
|
||
#ifndef __CNT_T__ | ||
#define __CNT_T__ | ||
/* The typedef for the count variables */ | ||
typedef s16 cnt_t; | ||
#endif | ||
|
||
#ifndef __RET_T__ | ||
#define __RET_T__ | ||
#if(RMP_MSP430_X==RMP_TRUE) | ||
/* The type for return value */ | ||
typedef s32 ret_t; | ||
#else | ||
typedef s16 ret_t; | ||
#endif | ||
#endif | ||
/* End Extended Types ********************************************************/ | ||
|
||
/* System macros *************************************************************/ | ||
/* Compiler "extern" keyword setting */ | ||
#define EXTERN extern | ||
/* The order of bits in one CPU machine word */ | ||
#define RMP_WORD_ORDER 4 | ||
/* The maximum length of char printing - no need to change this in most cases */ | ||
#define RMP_KERNEL_DEBUG_MAX_STR 128 | ||
/* The offset of the stack when initializing */ | ||
#define RMP_INIT_STACK RMP_INIT_STACK_TAIL(17) | ||
|
||
/* The CPU and application specific macros are here */ | ||
#include "platform_msp430_conf.h" | ||
/* End System macros *********************************************************/ | ||
|
||
/* MSP430 specific macros ****************************************************/ | ||
|
||
/*****************************************************************************/ | ||
/* __PLATFORM_MSP430_H_DEFS__ */ | ||
#endif | ||
/* __HDR_DEFS__ */ | ||
#endif | ||
/* End Defines ***************************************************************/ | ||
|
||
/* Structs *******************************************************************/ | ||
#ifdef __HDR_STRUCTS__ | ||
#ifndef __PLATFORM_MSP430_H_STRUCTS__ | ||
#define __PLATFORM_MSP430_H_STRUCTS__ | ||
/* We used structs in the header */ | ||
|
||
/* Use defines in these headers */ | ||
#define __HDR_DEFS__ | ||
#undef __HDR_DEFS__ | ||
/*****************************************************************************/ | ||
|
||
/*****************************************************************************/ | ||
/* __PLATFORM_MSP430_H_STRUCTS__ */ | ||
#endif | ||
/* __HDR_STRUCTS__ */ | ||
#endif | ||
/* End Structs ***************************************************************/ | ||
|
||
/* Private Global Variables **************************************************/ | ||
#if(!(defined __HDR_DEFS__||defined __HDR_STRUCTS__)) | ||
#ifndef __PLATFORM_MSP430_MEMBERS__ | ||
#define __PLATFORM_MSP430_MEMBERS__ | ||
|
||
/* In this way we can use the data structures and definitions in the headers */ | ||
#define __HDR_DEFS__ | ||
|
||
#undef __HDR_DEFS__ | ||
|
||
#define __HDR_STRUCTS__ | ||
|
||
#undef __HDR_STRUCTS__ | ||
|
||
/* If the header is not used in the public mode */ | ||
#ifndef __HDR_PUBLIC_MEMBERS__ | ||
/*****************************************************************************/ | ||
|
||
/*****************************************************************************/ | ||
/* End Private Global Variables **********************************************/ | ||
|
||
/* Private C Function Prototypes *********************************************/ | ||
/*****************************************************************************/ | ||
|
||
/*****************************************************************************/ | ||
#define __EXTERN__ | ||
/* End Private C Function Prototypes *****************************************/ | ||
|
||
/* Public Global Variables ***************************************************/ | ||
/* __HDR_PUBLIC_MEMBERS__ */ | ||
#else | ||
#define __EXTERN__ EXTERN | ||
/* __HDR_PUBLIC_MEMBERS__ */ | ||
#endif | ||
|
||
/*****************************************************************************/ | ||
|
||
/*****************************************************************************/ | ||
|
||
/* End Public Global Variables ***********************************************/ | ||
|
||
/* Public C Function Prototypes **********************************************/ | ||
/*****************************************************************************/ | ||
/* Interrupts */ | ||
EXTERN void RMP_Disable_Int(void); | ||
EXTERN void RMP_Enable_Int(void); | ||
|
||
__EXTERN__ ptr_t RMP_MSB_Get(ptr_t Val); | ||
EXTERN void _RMP_Start(ptr_t Entry, ptr_t Stack); | ||
EXTERN void _RMP_Yield(void); | ||
|
||
/* Initialization */ | ||
__EXTERN__ void _RMP_Stack_Init(ptr_t Entry, ptr_t Stack, ptr_t Arg); | ||
__EXTERN__ void _RMP_Low_Level_Init(void); | ||
__EXTERN__ void RMP_Putchar(char Char); | ||
__EXTERN__ void _RMP_Plat_Hook(void); | ||
/*****************************************************************************/ | ||
/* Undefine "__EXTERN__" to avoid redefinition */ | ||
#undef __EXTERN__ | ||
/* __PLATFORM_MSP430_MEMBERS__ */ | ||
#endif | ||
/* !(defined __HDR_DEFS__||defined __HDR_STRUCTS__) */ | ||
#endif | ||
/* End Public C Function Prototypes ******************************************/ | ||
|
||
/* End Of File ***************************************************************/ | ||
|
||
/* Copyright (C) Evo-Devo Instrum. All rights reserved ***********************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/****************************************************************************** | ||
Filename : platform_msp430_conf.h | ||
Author : pry | ||
Date : 24/06/2017 | ||
Licence : LGPL v3+; see COPYING for details. | ||
Description: The configuration file for MSP430 MCUs. | ||
******************************************************************************/ | ||
|
||
/* Config Includes ***********************************************************/ | ||
#include "Platform/MSP430/Chips/MSP430FR5994/platform_MSP430FR5994.h" | ||
/* End Config Includes *******************************************************/ | ||
|
||
/* End Of File ***************************************************************/ | ||
|
||
/* Copyright (C) Evo-Devo Instrum. All rights reserved ***********************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.