From: richardbarry Date: Thu, 28 Apr 2011 14:56:15 +0000 (+0000) Subject: Add in functions required to configure the ACE in the SmartFusion demo. X-Git-Tag: V7.0.1~30 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=95dc0e38a231026a32480bf753d74fc90b58c617;p=freertos Add in functions required to configure the ACE in the SmartFusion demo. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1394 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Demo/CORTEX_A2F200_IAR_and_Keil/MicroSemi_Code/drivers_config/mss_ace/ace_config.c b/Demo/CORTEX_A2F200_IAR_and_Keil/MicroSemi_Code/drivers_config/mss_ace/ace_config.c new file mode 100644 index 000000000..acd270690 --- /dev/null +++ b/Demo/CORTEX_A2F200_IAR_and_Keil/MicroSemi_Code/drivers_config/mss_ace/ace_config.c @@ -0,0 +1,157 @@ +/***************************************************************************** +* (c) Copyright Actel Corporation. All rights reserved. +* +*ACE configuration .c file +*Created by Actel MSS_ACE Configurator Fri Dec 17 12:12:19 2010 +* +*/ + +#include "../../drivers/mss_ace/mss_ace_configurator.h" +#include "ace_config.h" +#include "ace_handles.h" + +#include + + +/*----------------------------------------------------------------------------- +*AB Configuration +*---------------------------------------------------------------------------*/ +ace_adc_config_t g_ace_adc_config[ACE_NB_OF_ADC] = +{ + { + 4096, /* uint16_t adc_resolution */ + 2560 /* uint16_t va_ref */ + }, + { + 4096, /* uint16_t adc_resolution */ + 2560 /* uint16_t va_ref */ + }, + { + 4096, /* uint16_t adc_resolution */ + 2560 /* uint16_t va_ref */ + } +}; + +/*----------------------------------------------------------------------------- +*Current Monitor Resistor Values +*---------------------------------------------------------------------------*/ +const uint32_t g_ace_current_resistors[ACE_NB_OF_CURRENT_MONITORS] = +{ + 100000, /*CM0 ( USED AS CURRENT MONITOR ) */ + 1, /*CM1 ( NOT USED AS CURRENT MONITOR ) */ + 1, /*CM2 ( NOT USED AS CURRENT MONITOR ) */ + 1, /*CM3 ( NOT USED AS CURRENT MONITOR ) */ + 1 /*CM4 ( NOT USED AS CURRENT MONITOR ) */ +}; + +/*----------------------------------------------------------------------------- +*Analog Channels +*---------------------------------------------------------------------------*/ +/* Names*/ +const uint8_t g_ace_channel_0_name[] = "CurrentMonitor_0"; +const uint8_t g_ace_channel_1_name[] = "VoltageMonitor_0"; +const uint8_t g_ace_channel_2_name[] = "TemperatureMonitor_0"; + +/* Number of Flags per Channel*/ +#define CHANNEL_0_NB_OF_FLAGS 0 +#define CHANNEL_1_NB_OF_FLAGS 0 +#define CHANNEL_2_NB_OF_FLAGS 0 + +/* Input Channel to Flag Array Association*/ + +/* Channel Table*/ +ace_channel_desc_t g_ace_channel_desc_table[ACE_NB_OF_INPUT_CHANNELS] = +{ + { + g_ace_channel_0_name, /* const uint8_t * p_sz_channel_name */ + CM0, /* adc_channel_id_t signal_id; */ + 14, /* uint16_t signal_ppe_offset */ + CHANNEL_0_NB_OF_FLAGS, /* uint16_t nb_of_flags */ + 0 /* uint16_t * p_flags_array */ + }, + { + g_ace_channel_1_name, /* const uint8_t * p_sz_channel_name */ + TM0, /* adc_channel_id_t signal_id; */ + 23, /* uint16_t signal_ppe_offset */ + CHANNEL_1_NB_OF_FLAGS, /* uint16_t nb_of_flags */ + 0 /* uint16_t * p_flags_array */ + }, + { + g_ace_channel_2_name, /* const uint8_t * p_sz_channel_name */ + TM1, /* adc_channel_id_t signal_id; */ + 32, /* uint16_t signal_ppe_offset */ + CHANNEL_2_NB_OF_FLAGS, /* uint16_t nb_of_flags */ + 0 /* uint16_t * p_flags_array */ + } +}; + +/*----------------------------------------------------------------------------- +*Threshold Flags +*---------------------------------------------------------------------------*/ +/* Flag Names*/ +/* Flag Table*/ +#if ACE_NB_OF_PPE_FLAGS != 0 + ppe_flag_desc_t g_ppe_flags_desc_table[ACE_NB_OF_PPE_FLAGS] = + { + }; +#endif + +/*----------------------------------------------------------------------------- +*Sequencer Procedures +*---------------------------------------------------------------------------*/ +/* Procedure Name and Microcode*/ +const uint8_t g_ace_sse_proc_0_name[] = "ADC0_MAIN"; +const uint16_t g_ace_sse_proc_0_sequence[] = +{ + 0x1705, 0x1601, 0x155c, 0x14c4, + 0x0000, 0x152d, 0x8a0c, 0x1309, + 0x0000, 0x14c3, 0x0000, 0x8a04, + 0x152d, 0x970c, 0x132f, 0x0000, + 0x14c8, 0x0000, 0x9704, 0x1301, + 0x0000, 0x1002 +}; + +const uint8_t g_ace_sse_proc_1_name[] = "ADC1_MAIN"; +const uint16_t g_ace_sse_proc_1_sequence[] = +{ + 0x2705, 0x2601, 0x2200 +}; + +const uint8_t g_ace_sse_proc_2_name[] = "ADC2_MAIN"; +const uint16_t g_ace_sse_proc_2_sequence[] = +{ + 0x3705, 0x3601, 0x3200 +}; + + + +/* Procedure Table*/ +ace_procedure_desc_t g_sse_sequences_desc_table[ACE_NB_OF_SSE_PROCEDURES] = +{ + { + g_ace_sse_proc_0_name, /* const uint8_t * p_sz_proc_name */ + 2, /* uint16_t sse_loop_pc */ + 0, /* uint16_t sse_load_offset */ + sizeof(g_ace_sse_proc_0_sequence) / sizeof(uint16_t), /* uint16_t sse_ucode_length */ + g_ace_sse_proc_0_sequence, /* const uint16_t * sse_ucode */ + 0 /* uint8_t sse_pc_id */ + }, + { + g_ace_sse_proc_1_name, /* const uint8_t * p_sz_proc_name */ + 24, /* uint16_t sse_loop_pc */ + 22, /* uint16_t sse_load_offset */ + sizeof(g_ace_sse_proc_1_sequence) / sizeof(uint16_t), /* uint16_t sse_ucode_length */ + g_ace_sse_proc_1_sequence, /* const uint16_t * sse_ucode */ + 1 /* uint8_t sse_pc_id */ + }, + { + g_ace_sse_proc_2_name, /* const uint8_t * p_sz_proc_name */ + 27, /* uint16_t sse_loop_pc */ + 25, /* uint16_t sse_load_offset */ + sizeof(g_ace_sse_proc_2_sequence) / sizeof(uint16_t), /* uint16_t sse_ucode_length */ + g_ace_sse_proc_2_sequence, /* const uint16_t * sse_ucode */ + 2 /* uint8_t sse_pc_id */ + } +}; + + diff --git a/Demo/CORTEX_A2F200_IAR_and_Keil/MicroSemi_Code/drivers_config/mss_ace/ace_config.h b/Demo/CORTEX_A2F200_IAR_and_Keil/MicroSemi_Code/drivers_config/mss_ace/ace_config.h new file mode 100644 index 000000000..8f8c584d8 --- /dev/null +++ b/Demo/CORTEX_A2F200_IAR_and_Keil/MicroSemi_Code/drivers_config/mss_ace/ace_config.h @@ -0,0 +1,37 @@ +/***************************************************************************** +* (c) Copyright Actel Corporation. All rights reserved. +* +*ACE configuration .h file +*Created by Actel MSS_ACE Configurator Fri Dec 17 12:12:19 2010 +* +*/ + +#ifndef ACE_CONFIG_H +#define ACE_CONFIG_H + + +/*----------------------------------------------------------------------------- +*COMMON VALUES +*---------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------- +*AB VALUES +*---------------------------------------------------------------------------*/ +#define ACE_NB_OF_ADC 3 +#define ACE_NB_OF_CURRENT_MONITORS 5 +#define MAX_CHANNEL_NAME_LENGTH 20 +#define ACE_NB_OF_INPUT_CHANNELS 3 + +/*----------------------------------------------------------------------------- +*SSE VALUES +*---------------------------------------------------------------------------*/ +#define ACE_NB_OF_SSE_PROCEDURES 3 +#define MAX_PROCEDURE_NAME_LENGTH 9 + +/*----------------------------------------------------------------------------- +*PPE VALUES +*---------------------------------------------------------------------------*/ +#define ACE_NB_OF_PPE_FLAGS 0 +#define MAX_FLAG_NAME_LENGTH 0 + +#endif diff --git a/Demo/CORTEX_A2F200_IAR_and_Keil/MicroSemi_Code/drivers_config/mss_ace/ace_handles.h b/Demo/CORTEX_A2F200_IAR_and_Keil/MicroSemi_Code/drivers_config/mss_ace/ace_handles.h new file mode 100644 index 000000000..86782c013 --- /dev/null +++ b/Demo/CORTEX_A2F200_IAR_and_Keil/MicroSemi_Code/drivers_config/mss_ace/ace_handles.h @@ -0,0 +1,41 @@ +/***************************************************************************** +* (c) Copyright Actel Corporation. All rights reserved. +* +*ACE configuration .h file +*Created by Actel MSS_ACE Configurator Fri Dec 17 12:12:19 2010 +* +*/ + +#ifndef ACE_HANDLES_H +#define ACE_HANDLES_H + + +/*----------------------------------------------------------------------------- +*Analog input channel handles +*---------------------------------------------------------------------------*/ +typedef enum { + CurrentMonitor_0 = 0, + VoltageMonitor_0, + TemperatureMonitor_0, + NB_OF_ACE_CHANNEL_HANDLES +} ace_channel_handle_t; + +/*----------------------------------------------------------------------------- +*Flag Handles +*---------------------------------------------------------------------------*/ +typedef enum { + NB_OF_ACE_FLAG_HANDLES = 0 +} ace_flag_handle_t; + +/*----------------------------------------------------------------------------- +*Procedure Handles +*---------------------------------------------------------------------------*/ +typedef enum { + ADC0_MAIN = 0, + ADC1_MAIN, + ADC2_MAIN, + NB_OF_ACE_PROCEDURE_HANDLES +} ace_procedure_handle_t; + + +#endif