Community Translation - Output PSoC 6 CapSense Data Through EZI2C in ModusToolbox 2.0 – KBA229699

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Kenshow
Level 8
Level 8
Distributor - Marubun (Japan)
50 solutions authored 25 solutions authored 10 solutions authored

Hi,

I would like to translate KBA229699 into Japanese.

Please confirm to my work

Thanks,

Kenshow

0 Likes
2 Replies
JennaJo
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hello, Kenshow-san

Yes, it's good to translate.

Please work to do that.

Thanks,

Jenna

Jenna Jo
0 Likes
Kenshow
Level 8
Level 8
Distributor - Marubun (Japan)
50 solutions authored 25 solutions authored 10 solutions authored

Jenna-san,

I finished translating Japanese.
Please check below.

Thanks,

Kenshow

Original KBA:

Output PSoC 6 CapSense Data Through EZI2C in ModusToolbox 2.0 – KBA229699

Translated by Kenshow

==============================

タイトル: ModusToolbox 2.0でEZI2Cを介したPSoC 6の CapSenseのデータ出力– KBA229699

バージョン:**

質問
ModusToolbox® 2.0EZI2Cを介してどのようにPSoC® 6CapSense®のデータを出力すればよいのでしょうか?

回答
CapSense Tunerツールを使用する代わりに、以下を実行してEZI2Cを使用してCapSenseデータをI2Cマスターに出力します。

1. カスタマイズされたI2Cデータバッファを定義します。バッファタイプは、配列または構造体になります。

2. バッファ内の各シフトレジスタを定義して、各レジスタにロードされるCapSenseパラメーターを指定します。例えば:

struct

{

uint16 rawcount[2];

uint16 baseline[2];

uint16 diffcount[2];

uint8 idac[2];

uint8 compidac[2];

}csd_param;

3. 以下のAPIを使用して、プライマリスレーブアドレス要求でI2Cマスターに認識されるようI2Cデータバッファーを設定します。

            void Cy_SCB_EZI2C_SetBuffer1(CySCB_Type const *base, uint8_t *buffer, uint32_t size, uint32_t rwBoundary,

  cy_stc_scb_ezi2c_context_t

*context)

4. 実行中にI2CのデータバッファにCapSenseデータを手動でロードします。

rawcountbaselinediffcountmodulation IDACCompensation IDACなどのセンサーパラメーターを取得する手順を実装すとためのコードを使用します。以下は、rawcountIDACを取得する2つのコードスニペットです。

Sensor Rawcounttの取得

uint32_t Cy_CapSense_getraw(

uint32_t widgetId,

uint32_t sensorId,

const cy_stc_capsense_context_t * context)

{

    uint32_t result = 0uL;

    if (widgetId < context->ptrCommonConfig->numWd)

    {

        if (sensorId < context->ptrWdConfig[widgetId].numSns)

        {

            result = context->ptrWdConfig[widgetId].ptrSnsContext[sensorId].raw;

        }

    }

    return result;

}

ウィジェットIDACの取得

uint32_t Cy_CapSense_getidac(

uint32_t widgetId,

uint32_t sensorId,

const cy_stc_capsense_context_t * context)

{

    uint32_t result = 0uL;

    if (widgetId < context->ptrCommonConfig->numWd)

    {

        if (sensorId < context->ptrWdConfig[widgetId].numSns)

        {

            result = context->ptrWdConfig[widgetId].ptrWdContext[widgetId].idacMod[0];

        }

    }

    return result;

}

==============================

14-May-2020

Kenshow

 

0 Likes