📄 lcd_messages.c
字号:
if ((mb_status == RVF_GREEN) || (mb_status == RVF_YELLOW)) /* Memory allocation success */
{
msg_ptr->row = row;
msg_ptr->os_hdr.msg_id = LCD_CLEAR_STRING_EVT;
rvf_send_msg (DRIVER_GBL_INFO_PTR->addr_id, msg_ptr);
return (RV_OK);
}
else
{
rvf_send_trace("LCD_ClearString function FAILED ",32, NULL_PARAM,
RV_TRACE_LEVEL_WARNING, R2D_USE_ID );
return(RV_MEMORY_ERR);
}
}
/********************************************************************************/
/* Function Name: LCD_ClearWord */
/* */
/* Purpose:called by Appli, sends lcd_clear_word message into lcd mailbox */
/* */
/* */
/* Input Parameters: row, column, length */
/* Output Parameters: */
/* T_RV_RET */
/********************************************************************************/
T_RV_RET lcd_clear_word(UINT8 row, UINT8 column, UINT16 length)
{
T_RVF_MB_STATUS mb_status;
T_LCD_CLEAR_WORD *msg_ptr;
/* check if the driver has been started */
if ( DRIVER_GBL_INFO_PTR == NULL)
return (RV_NOT_READY);
if (DrvTaskReady == 0)
return(RV_NOT_READY);
mb_status = rvf_get_buf (DRIVER_GBL_INFO_PTR->prim_id, sizeof (T_LCD_CLEAR_WORD ), (void **) &msg_ptr);
if ((mb_status == RVF_GREEN) || (mb_status == RVF_YELLOW)) /* Memory allocation success */
{
msg_ptr->row = row;
msg_ptr->column = column * 6;
msg_ptr->length = length;
msg_ptr->os_hdr.msg_id = LCD_CLEAR_WORD_EVT;
rvf_send_msg (DRIVER_GBL_INFO_PTR->addr_id, msg_ptr);
return (RV_OK);
}
else
{
rvf_send_trace("LCD_ClearWord function FAILED ",31, NULL_PARAM,
RV_TRACE_LEVEL_WARNING, R2D_USE_ID );
return(RV_MEMORY_ERR);
}
}
/********************************************************************************/
/* Function Name: LCD_PutPixel */
/* */
/* Purpose:called by Appli, sends lcd_put_pixel message into lcd mailbox */
/* */
/* */
/* Input Parameters:x,y */
/* Output Parameters: */
/* T_RV_RET */
/********************************************************************************/
T_RV_RET lcd_put_pixel(UINT8 x, UINT8 y)
{
T_RVF_MB_STATUS mb_status;
T_LCD_PUT_PIXEL *msg_ptr;
/* check if the driver has been started */
if ( DRIVER_GBL_INFO_PTR == NULL)
return (RV_NOT_READY);
if (DrvTaskReady == 0)
return(RV_NOT_READY);
mb_status = rvf_get_buf (DRIVER_GBL_INFO_PTR->prim_id, sizeof (T_LCD_PUT_PIXEL ), (void **) &msg_ptr);
if ((mb_status == RVF_GREEN) || (mb_status == RVF_YELLOW)) /* Memory allocation success */
{
msg_ptr->x = x;
msg_ptr->y = y;
msg_ptr->os_hdr.msg_id = LCD_PUT_PIXEL_EVT;
rvf_send_msg (DRIVER_GBL_INFO_PTR->addr_id, msg_ptr);
return (RV_OK);
}
else
{
rvf_send_trace("LCD_PutPixel function FAILED ",29, NULL_PARAM,
RV_TRACE_LEVEL_WARNING, R2D_USE_ID );
return(RV_MEMORY_ERR);
}
}
/********************************************************************************/
/* Function Name: LCD_ClearPixel */
/* */
/* Purpose:called by Appli, sends lcd_clear_pixel message into lcd mailbox */
/* */
/* */
/* Input Parameters:x,y */
/* Output Parameters: */
/* T_RV_RET */
/********************************************************************************/
T_RV_RET lcd_clear_pixel(UINT8 x, UINT8 y)
{
T_RVF_MB_STATUS mb_status;
T_LCD_CLEAR_PIXEL *msg_ptr;
/* check if the driver has been started */
if ( DRIVER_GBL_INFO_PTR == NULL)
return (RV_NOT_READY);
if (DrvTaskReady == 0)
return(RV_NOT_READY);
mb_status = rvf_get_buf (DRIVER_GBL_INFO_PTR->prim_id, sizeof (T_LCD_CLEAR_PIXEL ), (void **) &msg_ptr);
if ((mb_status == RVF_GREEN) || (mb_status == RVF_YELLOW)) /* Memory allocation success */
{
msg_ptr->x = x;
msg_ptr->y = y;
msg_ptr->os_hdr.msg_id = LCD_CLEAR_PIXEL_EVT;
rvf_send_msg (DRIVER_GBL_INFO_PTR->addr_id, msg_ptr);
return (RV_OK);
}
else
{
rvf_send_trace("LCD_ClearPixel function FAILED ",31, NULL_PARAM,
RV_TRACE_LEVEL_WARNING, R2D_USE_ID );
return(RV_MEMORY_ERR);
}
}
/********************************************************************************/
/* Function Name: LCD_DrawLine */
/* */
/* Purpose:called by Appli, sends lcd_draw_line message into lcd mailbox */
/* */
/* */
/* Input Parameters:x1,y1, x2,y2 */
/* Output Parameters: */
/* T_RV_RET */
/********************************************************************************/
T_RV_RET lcd_draw_line(UINT8 x1, UINT8 y1, UINT8 x2, UINT8 y2)
{
T_RVF_MB_STATUS mb_status;
T_LCD_DRAW_LINE *msg_ptr;
/* check if the driver has been started */
if ( DRIVER_GBL_INFO_PTR == NULL)
return (RV_NOT_READY);
if (DrvTaskReady == 0)
return(RV_NOT_READY);
mb_status = rvf_get_buf (DRIVER_GBL_INFO_PTR->prim_id, sizeof (T_LCD_DRAW_LINE ), (void **) &msg_ptr);
if ((mb_status == RVF_GREEN) || (mb_status == RVF_YELLOW)) /* Memory allocation success */
{
msg_ptr->x1 = x1;
msg_ptr->y1 = y1;
msg_ptr->x2 = x2;
msg_ptr->y2 = y2;
msg_ptr->os_hdr.msg_id = LCD_DRAW_LINE_EVT;
rvf_send_msg (DRIVER_GBL_INFO_PTR->addr_id, msg_ptr);
return (RV_OK);
}
else
{
rvf_send_trace("LCD_DrawLine function FAILED ",29, NULL_PARAM,
RV_TRACE_LEVEL_WARNING, R2D_USE_ID );
return(RV_MEMORY_ERR);
}
}
/********************************************************************************/
/* Function Name: LCD_ClearLine */
/* */
/* Purpose:called by Appli, sends lcd_clear_line message into lcd mailbox */
/* */
/* */
/* Input Parameters:x1,y1, x2,y2 */
/* Output Parameters: */
/* T_RV_RET */
/********************************************************************************/
T_RV_RET lcd_clear_line(UINT8 x1, UINT8 y1, UINT8 x2, UINT8 y2)
{
T_RVF_MB_STATUS mb_status;
T_LCD_CLEAR_LINE *msg_ptr;
/* check if the driver has been started */
if ( DRIVER_GBL_INFO_PTR == NULL)
return (RV_NOT_READY);
if (DrvTaskReady == 0)
return(RV_NOT_READY);
mb_status = rvf_get_buf (DRIVER_GBL_INFO_PTR->prim_id, sizeof (T_LCD_CLEAR_LINE ), (void **) &msg_ptr);
if ((mb_status == RVF_GREEN) || (mb_status == RVF_YELLOW)) /* Memory allocation success */
{
msg_ptr->x1 = x1;
msg_ptr->y1 = y1;
msg_ptr->x2 = x2;
msg_ptr->y2 = y2;
msg_ptr->os_hdr.msg_id = LCD_CLEAR_LINE_EVT;
rvf_send_msg (DRIVER_GBL_INFO_PTR->addr_id, msg_ptr);
return (RV_OK);
}
else
{
rvf_send_trace("LCD_ClearLine function FAILED ",30, NULL_PARAM,
RV_TRACE_LEVEL_WARNING, R2D_USE_ID );
return(RV_MEMORY_ERR);
}
}
/********************************************************************************/
/* Function Name: LCD_DrawRectangle */
/* */
/* Purpose:called by Appli, sends lcd_draw_rectangle message into lcd mailbox*/
/* */
/* */
/* Input Parameters:x1,y1, x2,y2 */
/* Output Parameters: */
/* T_RV_RET */
/********************************************************************************/
T_RV_RET lcd_draw_rectangle(UINT8 x1, UINT8 y1, UINT8 x2, UINT8 y2)
{
T_RVF_MB_STATUS mb_status;
T_LCD_DRAW_RECTANGLE *msg_ptr;
/* check if the driver has been started */
if ( DRIVER_GBL_INFO_PTR == NULL)
return (RV_NOT_READY);
if (DrvTaskReady == 0)
return(RV_NOT_READY);
mb_status = rvf_get_buf (DRIVER_GBL_INFO_PTR->prim_id, sizeof (T_LCD_DRAW_RECTANGLE ), (void **) &msg_ptr);
if ((mb_status == RVF_GREEN) || (mb_status == RVF_YELLOW)) /* Memory allocation success */
{
msg_ptr->x1 = x1;
msg_ptr->y1 = y1;
msg_ptr->x2 = x2;
msg_ptr->y2 = y2;
msg_ptr->os_hdr.msg_id = LCD_DRAW_RECTANGLE_EVT;
rvf_send_msg (DRIVER_GBL_INFO_PTR->addr_id, msg_ptr);
return (RV_OK);
}
else
{
rvf_send_trace("LCD_DrawRectangle function FAILED ",34, NULL_PARAM,
RV_TRACE_LEVEL_WARNING, R2D_USE_ID );
return(RV_MEMORY_ERR);
}
}
/********************************************************************************/
/* Function Name: LCD_ClearRectangle */
/* */
/* Purpose:called by Appli, sends lcd_clear_rectangle message into lcd mailbox*/
/* */
/* */
/* Input Parameters:x1,y1, x2,y2 */
/* Output Parameters: */
/* T_RV_RET */
/********************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -