Jump to content

IIC Input Mapping to SRIO


Digineural
 Share

Recommended Posts

I'm looking to map UI input buttons to an input matrix that is managed by an IC over IIC. I think I'm having a little trouble modifying the SEQ to manage this process. Here is a rundown of what I was looking to do with the least evasive code changes possible.

I'm merely asking if I'm moving down the right path or if there is a better way.

I can only have up to 12 switches per IC and only 4 addresses on the IIC bus so that still leaves all the encoders and a few switches to still go through APP_DIN_NotifyToggle

1. I want to create a mapping table that defines a IIC mapping to SRIO mapping using the following layout: IIC ADDR, IIC PIN, SR, SR PIN

2. I thought if I create a new TASK, that I can copy APP_DIN_NotifyToggle and modify it to look sort of like the following but the key is passing everything to the existing button handler


typedef{

  u32 pin;

  u32 pin_value;

}tIIC_Input_Mapping;


void TASK_IIC_DIN_Handler() {

   // Convert the IIC input to a DIN mapping

  tIIC_Input_Mapping IIC_Input_Mapping = IIC_TO_DIN_MAPPING( /*IIC Input logic here */ );

  // forward to UI button handler

  SEQ_UI_Button_Handler(IIC_Input_Mapping.pin, IIC_Input_Mapping.pin_value); 

}

Thoughts? Am I moving down the right path?

Edited by Digineural
Link to comment
Share on other sites

In the MBSEQ V4 application I've reduced the heap memory to get more space for other variables, therefore it won't be possible to add another task.

But you could just hook the handler into the existing SEQ_TASK_Period1ms in app.c

The input mapping won't be required, as a mapping already exists - just add an offset to the pin number, such as +128 to get unique pin numbers which can be referenced in the MBSEQ_HW.V4 file (128 = SR 17 pin 0 upwards)

best regards, thorsten.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...