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

cross mob
MiRe_4638356
Level 3
Level 3
First like received First like given

I am going around in circles with the UDBs - how do I get data (3 bytes/24 bits in this case) from a programme into a FIFO (without using Ax or Dx)?

A trivial question, I know!

Thank you,

Mike

0 Likes
1 Solution
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

An example is found in the Shift Register component.

The ShiftReg_WriteData() function is used to store a 24bit value into a 24bit width FIFO register using the CY_SET_REG24() macro.

    cystatus ShiftReg_WriteData(uint32 shiftData)

                                                                        

    {

        cystatus result;

        result = CYRET_INVALID_STATE;

        /* Writes data into the input FIFO if it is not FULL */

        if(ShiftReg_RET_FIFO_FULL != (ShiftReg_GetFIFOStatus(ShiftReg_IN_FIFO)))

        {

            CY_SET_REG24(ShiftReg_IN_FIFO_VAL_LSB_PTR, shiftData);

            result = CYRET_SUCCESS;

        }

        return(result);

    }

The register address ShiftReg_IN_FIFO_VAL_LSB_PTR is defined in the header file as follows.

        #define ShiftReg_IN_FIFO_VAL_LSB_PTR        ( (reg32 *) \

                                        ShiftReg_bSR_sC24_BShiftRegDp_u0__F0_REG )

Regards,

Noriaki

View solution in original post

4 Replies