cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

gean_3054931
Contributor II

Hi,

How to generate one mili second using timer in fx3s?

thank you...

0 Likes
1 Solution
abhinavg_21
Moderator
Moderator

Create a new callback function named say, Timercb()

CyU3PTimer Timer;     // define this handle

void TimerCb()

{

// Here you get the callback after  Time_in_millisecond

}

void TimerInit(void)

{

CyU3PReturnStatus_t apiRetStatus = CY_U3P_SUCCESS;

apiRetStatus = CyU3PTimerCreate(&Timer, TimerCb, 0, Time_in_millisecond, Time_in_millisecond, 1);

if (apiRetStatus != CY_U3P_SUCCESS)

{

   CyU3PDebugPrint (2, "TimerCreate failed, Error Code = %d\r\n", apiRetStatus);

}

}

Note: For further understanding you can refer to CyU3PTimerCreate() API in API Guide

Regards

Abhinav

View solution in original post

1 Reply
abhinavg_21
Moderator
Moderator

Create a new callback function named say, Timercb()

CyU3PTimer Timer;     // define this handle

void TimerCb()

{

// Here you get the callback after  Time_in_millisecond

}

void TimerInit(void)

{

CyU3PReturnStatus_t apiRetStatus = CY_U3P_SUCCESS;

apiRetStatus = CyU3PTimerCreate(&Timer, TimerCb, 0, Time_in_millisecond, Time_in_millisecond, 1);

if (apiRetStatus != CY_U3P_SUCCESS)

{

   CyU3PDebugPrint (2, "TimerCreate failed, Error Code = %d\r\n", apiRetStatus);

}

}

Note: For further understanding you can refer to CyU3PTimerCreate() API in API Guide

Regards

Abhinav

View solution in original post