Functions
Functions
Peripheral Driver » APP DRIVER » DC

## Functions
uint16_t | graphics_dc_init (app_graphics_dc_params_t *dc_params, graphics_dc_irq_event_notify_cb evt_cb)
| init Graphics DC dev More...
void | graphics_dc_deinit (void)
| de-init Graphics DC dev, just called when needed to reboot/reset More...
void | graphics_dc_pins_reinit (void)
| re-init i/o for Graphics DC dev with pre-init i/o setting More...
void | app_graphics_dc_set_power_state (graphics_dc_power_state_e state)
| Switch power state for DC module. More...
void | app_graphics_dc_freq_set (graphics_dc_clock_freq_e clock_freq)
| DC clock frequency set. More...
void | app_graphics_dc_spi_send (uint8_t cmd_8bit, uint32_t address_24bit, uint8_t *data, uint32_t length)
| Send 1 Byte CMD,3 Byte ADDR And N Byte Data in 1-wire SPI Mode. More...
void | app_graphics_dc_dspi_send_cmd_in_3wire_1lane (uint8_t cmd)
| Send single cmd in 3-wire mode for DSPI (no DCX and 1 more MSB Bit for cmd indicator) More...
void | app_graphics_dc_dspi_send_cmd_data_in_3wire_1lane (uint8_t cmd, uint8_t data)
| Send single cmd &data in 3-wire mode for DSPI (no DCX and 1 more MSB Bit for cmd/data indicator) More...
void | app_graphics_dc_dspi_send_cmd_data_in_4wire_2lane (uint16_t cmd, uint16_t data)
| Send cmd &data in 4-wire mode for DSPI (DCX as SD1, and 1 more MSB Bit for cmd/data indicator) More...
void | app_graphics_dc_dspi_send_cmd_datas_in_4wire_2lane (uint16_t cmd, uint16_t *data, int length)
| Send cmd &data in 4-wire mode for DSPI (DCX as SD1, and 1 more MSB Bit for cmd/data indicator) More...
app_graphics_dc_frame_result_e | app_graphics_dc_send_single_frame (uint32_t which_layer, app_graphics_dc_framelayer_t *frame_layer, app_graphics_dc_cmd_t *dc_cmd, app_graphics_dc_access_type_e access_type)
| Send one whole frame by DC. More...

## Detailed Description

## Function Documentation

## ◆ app_graphics_dc_dspi_send_cmd_data_in_3wire_1lane()

void app_graphics_dc_dspi_send_cmd_data_in_3wire_1lane | ( | uint8_t | cmd,
|  | uint8_t | data
| ) |  |

Send single cmd &data in 3-wire mode for DSPI (no DCX and 1 more MSB Bit for cmd/data indicator)

Note
  Timing Diagram : CSN: |_________________________________________________________________________| CLK: __|-|_|-|_|-|_|-|_|-|_|-|_|-|_|-|_|-|_|-|_|-|_|-|_|-|_|-|_|-|_|-|_|-|_|-|__ SD0: __[0][ ———8Bit CMD————][1][ ———8Bit DATA———– ]__ (18-Bit in All) DCX: ___________________________________________________________________________ (Always Low)

Parameters

  [in] | cmd | 8bits command
  [in] | data | 8bits data

## ◆ app_graphics_dc_dspi_send_cmd_data_in_4wire_2lane()

void app_graphics_dc_dspi_send_cmd_data_in_4wire_2lane | ( | uint16_t | cmd,
|  | uint16_t | data
| ) |  |

Send cmd &data in 4-wire mode for DSPI (DCX as SD1, and 1 more MSB Bit for cmd/data indicator)

Note
  Timing Diagram : CSN: |___________________________________________| CLK: __|-|_|-|_|...|-|_|-|_|-|_|-|_|....|-|_|-|___ SD0: __[0][ —H8Bit CMD–][1][ –H8Bit DATA– ]__ (18Bit in All ) DCX: __[0][ —L8Bit CMD–][1][ –L8Bit DATA– ]__ (use DCX as SD1)

Parameters

  [in] | cmd | 16bits command
  [in] | data | 16bits data

## ◆ app_graphics_dc_dspi_send_cmd_datas_in_4wire_2lane()

void app_graphics_dc_dspi_send_cmd_datas_in_4wire_2lane | ( | uint16_t | cmd,
|  | uint16_t * | data,
|  | int | length
| ) |  |

Send cmd &data in 4-wire mode for DSPI (DCX as SD1, and 1 more MSB Bit for cmd/data indicator)

Note
  Timing Diagram : CSN: |___________________________________________________________________________| CLK: __|-|_|-|_|...|-|_|-|_|-|_|-|_|....|-|_|-|_|-|_|-|_|-|_|-|_|-|_|-|_|-|...-|__ SD0: __[0][ —H8Bit CMD–][1][ –H8Bit DATA– ][1][ –H8Bit DATA– ][1][......]__ (Nx9Bit in All ) DCX: __[0][ —L8Bit CMD–][1][ –L8Bit DATA– ][1][ –L8Bit DATA– ][1][......]__ (use DCX as SD1)

Parameters

  [in] | cmd | 16bits command
  [in] | data | Pointer to data buffer
  [in] | length | Data length

## ◆ app_graphics_dc_dspi_send_cmd_in_3wire_1lane()

void app_graphics_dc_dspi_send_cmd_in_3wire_1lane | ( | uint8_t | cmd | ) |

Send single cmd in 3-wire mode for DSPI (no DCX and 1 more MSB Bit for cmd indicator)

Note
  Timing Diagram : CSN: |______________________________________| CLK: __|-|_|-|_|-|_|-|_|-|_|-|_|-|_|-|_|-|__ SD0: __[0][ ———8Bit CMD———– ]__ (9-Bit in All) DCX: _______________________________________ (Always Low)

Parameters

  [in] | cmd | 8bits command

## ◆ app_graphics_dc_freq_set()

void app_graphics_dc_freq_set | ( | graphics_dc_clock_freq_e | clock_freq | ) |

DC clock frequency set.

Parameters

  [in] | clock_freq | DC clock frequency

Returns
  none

## ◆ app_graphics_dc_send_single_frame()

app_graphics_dc_frame_result_e app_graphics_dc_send_single_frame | ( | uint32_t | which_layer,
|  | app_graphics_dc_framelayer_t * | frame_layer,
|  | app_graphics_dc_cmd_t * | dc_cmd,
|  | app_graphics_dc_access_type_e | access_type
| ) |  |

Send one whole frame by DC.

Parameters

  [in] | which_layer | GRAPHICS_DC_LAYER_0 GRAPHICS_DC_LAYER_1
  [in] | frame_layer | pointer to dc layer setting
  [in] | dc_cmd | pointer to DC control command
  [in] | access_type | GDC_ACCESS_TYPE_SYNC, send frame sync GDC_ACCESS_TYPE_ASYNC, send frame async, must handle the frame result in callback

## ◆ app_graphics_dc_set_power_state()

void app_graphics_dc_set_power_state | ( | graphics_dc_power_state_e | state | ) |

Switch power state for DC module.

Parameters

  [in] | state | power state to switch

Returns
  none

## ◆ app_graphics_dc_spi_send()

void app_graphics_dc_spi_send | ( | uint8_t | cmd_8bit,
|  | uint32_t | address_24bit,
|  | uint8_t * | data,
|  | uint32_t | length
| ) |  |

Send 1 Byte CMD,3 Byte ADDR And N Byte Data in 1-wire SPI Mode.

Note
  Timing Diagram : CSN: |_________________________________________________| CLK: __|-|_|-|_|-|_|-|_|-|_|-|_|-|_|-|_|-|_|-|_|-|_|___ IO0: __[ -1Byte CMD- ][ -3Byte CMD- ][ -NByte Data- ]__

Parameters

  [in] | cmd_8bit | 8bits command
  [in] | address_24bit | 24bits address
  [in] | data | Pointer to data buffer
  [in] | length | Data length

## ◆ graphics_dc_deinit()

void graphics_dc_deinit | ( | void |  | ) |

de-init Graphics DC dev, just called when needed to reboot/reset

## ◆ graphics_dc_init()

uint16_t graphics_dc_init | ( | app_graphics_dc_params_t * | dc_params,
|  | graphics_dc_irq_event_notify_cb | evt_cb
| ) |  |

init Graphics DC dev

Parameters

  [in] | dc_params | pointer to dc init params
  [in] | evt_cb | event callback Note: GDC_IRQ_EVT_FRAME_TRANSMITION_END & GDC_IRQ_EVT_CMD_TRANSMITION_END

Return values

  APP_DRV_SUCCESS |
  APP_DRV_ERR_HAL |
  APP_DRV_ERR_POINTER_NULL |

## ◆ graphics_dc_pins_reinit()

void graphics_dc_pins_reinit | ( | void |  | ) |

re-init i/o for Graphics DC dev with pre-init i/o setting