Code covered by the BSD License  

Highlights from
MPC555 Motor Control Function Blockset

MPC555 Motor Control Function Blockset

by

 

20 Mar 2006 (Updated )

Additional I/O blocks for MPC555 target - specifically targetting TPU functionality

mpc555_mtrctrl_tpu_itc(block, callback_fn, varargin)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function varargout = mpc555_mtrctrl_tpu_itc(block, callback_fn, varargin)
%
function varargout = mpc555_mtrctrl_tpu_itc(block, callback_fn, varargin)
% This is the entry function to allow the appropriate callback functions to
% be run
switch callback_fn
    case 'itc_mode'
        i_callback_itc_mode(block);
    case 'itc_use_links'
        i_callback_itc_use_links(block);
    case 'param_max_count'
        i_callback_param_max_count(block);
    case 'bank_specify'
        i_callback_bank_specify(block);
    otherwise
        error('Invalid callback');
end
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function parameterspecs = i_getparameterspecs()
% 
function parameterspecs = i_getparameterspecs()

parameterspecs(1).ParamName = 'param_max_count';
parameterspecs(1).PrettyName = 'MAX_COUNT';
parameterspecs(1).MinVal = 1;
parameterspecs(1).MaxVal = 2^16-1;
parameterspecs(1).DataType = 'uint16';
parameterspecs(1).ArrayLengthMin = 1;
parameterspecs(1).ArrayLengthMax = 1;
parameterspecs(1).ErrorMessage = '';
parameterspecs(1).SpecialConditions = [];

end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function i_callback_itc_mode(block)
%
function i_callback_itc_mode(block)

enable_conds(1).param_names = {'itc_mode'};
enable_conds(1).param_conditions = {'Continual'};
enable_conds(1).to_enable = {'param_max_count'};
enable_conds(1).to_disable = {};
enable_conds(1).to_hide = {};
enable_conds(1).reciprocal = 1;

mpc555_mtrctrl_maskparam(enable_conds);

end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function i_callback_itc_use_links(block)
%
function i_callback_itc_use_links(block)
enable_conds(1).param_names = {'itc_use_links'};
enable_conds(1).param_conditions = {'on'};
enable_conds(1).to_enable = {'param_link_start', 'param_link_count'};
enable_conds(1).to_disable = {};
enable_conds(1).to_hide = {};
enable_conds(1).reciprocal = 1;

mpc555_mtrctrl_maskparam(enable_conds);

end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function i_callback_param_max_count(block)
%
function i_callback_param_max_count(block)
parameterspecs = i_getparameterspecs();
[valid_value] = mpc555_mtrctrl_validate_mask_value(block, parameterspecs(1));
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function i_callback_bank_specify(block)
%
function i_callback_bank_specify(block)

enable_conds(1).param_names = {'bank_specify'};
enable_conds(1).param_conditions = {'Channel and Parameter Index'};
enable_conds(1).to_disable = {'alias_bank_address'};
enable_conds(1).to_enable = {'bank_channel', 'bank_parameter'};
enable_conds(1).to_hide = {};
enable_conds(1).reciprocal = 0;

enable_conds(2).param_names = {'bank_specify'};
enable_conds(2).param_conditions = {'Alias'};
enable_conds(2).to_enable = {'alias_bank_address'};
enable_conds(2).to_disable = {'bank_channel', 'bank_parameter'};
enable_conds(2).to_hide = {};
enable_conds(2).reciprocal = 0;

enable_conds(3).param_names = {'bank_specify'};
enable_conds(3).param_conditions = {'Unused Parameter Entry'};
enable_conds(3).to_enable = {};
enable_conds(3).to_disable = {'bank_channel', 'bank_parameter', 'alias_bank_address'};
enable_conds(3).to_hide = {};
enable_conds(3).reciprocal = 0;

mpc555_mtrctrl_maskparam(enable_conds);

end

Contact us