42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_spi_master.h"
69#define OSD_MAP_MIKROBUS( cfg, mikrobus ) \
70 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
71 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
72 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
73 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
74 cfg.los = MIKROBUS( mikrobus, MIKROBUS_AN ); \
75 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
76 cfg.hsy = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
77 cfg.vsy = MIKROBUS( mikrobus, MIKROBUS_INT )
92#define OSD_VM0_REG 0x00
93#define OSD_VM1_REG 0x01
94#define OSD_HOS_REG 0x02
95#define OSD_VOS_REG 0x03
96#define OSD_DMM_REG 0x04
97#define OSD_DMAH_REG 0x05
98#define OSD_DMAL_REG 0x06
99#define OSD_DMDI_REG 0x07
100#define OSD_CMM_REG 0x08
101#define OSD_CMAH_REG 0x09
102#define OSD_RB0_REG 0x10
103#define OSD_CMAL_REG 0x0A
104#define OSD_CMDI_REG 0x0B
105#define OSD_OSDM_REG 0x0C
106#define OSD_OSDBL_REG 0x6C
107#define OSD_STAT_REG 0xA0
108#define OSD_DMDO_REG 0xB0
109#define OSD_CMDO_REG 0xC0
116#define OSD_WRITE_CMD 0x7F
117#define OSD_READ_CMD 0x80
119#define OSD_CLEAR_DISPLAY 0x04
120#define OSD_CLEAR_DISPLAY_VERT 0x06
121#define OSD_END_STRING 0xFF
122#define OSD_WRITE_NVR 0xA0
124#define OSD_WHITE_LEVEL_80 0x03
125#define OSD_WHITE_LEVEL_90 0x02
126#define OSD_WHITE_LEVEL_100 0x01
127#define OSD_WHITE_LEVEL_120 0x00
129#define OSD_MAX_FONT_ROM 0xFF
130#define OSD_STATUS_REG_NVR_BUSY 0x20
131#define OSD_NVM_RAM_SIZE 0x36
void osd_enable_display_image(osd_t *ctx)
Enable display of OSD image function.
void osd_clears_char_places(osd_t *ctx, uint8_t start_x, uint8_t start_y, uint8_t end_x, uint8_t end_y)
Clears the character places function.
void osd_enable(osd_t *ctx)
Enable OSD function.
uint8_t osd_get_character_data_out(osd_t *ctx)
Get character memory data out function.
err_t osd_init(osd_t *ctx, osd_cfg_t *cfg)
Initialization function.
void osd_disable_video_buffer(osd_t *ctx)
Disable video buffer.
void osd_disable(osd_t *ctx)
Disable OSD function.
void osd_invert_pixels_display(osd_t *ctx)
Invert color of pixels on display function.
void osd_normal_pixels_display(osd_t *ctx)
Normal color of pixels on display function.
void osd_disable_auto_black(osd_t *ctx)
Disable automatic OSD black function.
void osd_write_nvm_character(osd_t *ctx, uint8_t v_chars, uint16_t v_index)
Write NVM character function.
uint8_t osd_get_status(osd_t *ctx)
Get status data function.
void osd_set_blinking_duty_cycle(osd_t *ctx, uint8_t blink_duty_cycle)
Set blinking duty cycle function.
void osd_write_character(osd_t *ctx, uint8_t line_pos, uint8_t row_pos, uint8_t symbol)
Write character by position function.
void osd_disable_display_image(osd_t *ctx)
Disable display of OSD image function.
void osd_write_chars(osd_t *ctx, uint8_t *symbol_buff, osd_write_chars_t *write_ctx)
Write character function.
void osd_blinking_off(osd_t *ctx)
Set blinking OFF function.
void osd_enable_auto_black(osd_t *ctx)
Enable automatic OSD black function.
void osd_character_blinking_off(osd_t *ctx)
Set blinking OFF function.
void osd_soft_reset(osd_t *ctx)
Software reset function.
uint8_t osd_get_hsync(osd_t *ctx)
Get horizontal sync status function.
void osd_clear_display_memory(osd_t *ctx)
Clear display memory.
uint8_t osd_get_vsync(osd_t *ctx)
Get vertical sync status function.
void osd_set_local_background_control(osd_t *ctx, uint8_t lb_mode)
Set local background control function.
void osd_cfg_setup(osd_cfg_t *cfg)
Config Object Initialization function.
void osd_hw_reset(osd_t *ctx)
Hardware reset function.
void osd_set_sharpness(osd_t *ctx, uint8_t s_data)
Set sharpness function.
void osd_write_byte(osd_t *ctx, uint8_t reg_address, uint8_t write_data)
Write the byte of data.
void osd_set_background_mode(osd_t *ctx, uint8_t b_mode)
Set background mode.
void osd_set_operation_mode(osd_t *ctx, uint8_t op_mode)
Set operation mode function.
void osd_set_ntsc(osd_t *ctx)
Set NTSC video standard function.
void osd_default_cfg(osd_t *ctx)
Click Default Configuration function.
uint8_t osd_read_byte(osd_t *ctx, uint8_t reg_address)
Read the byte of data function.
void osd_set_blinking_time(osd_t *ctx, uint8_t blinking_time)
Set blinking time.
void osd_set_pal(osd_t *ctx)
Set PAL video standard function.
uint8_t osd_get_los(osd_t *ctx)
Get loss of sync status function.
void osd_set_character_color_white(osd_t *ctx)
Set the white background of the character function.
void osd_normal_pixels_character(osd_t *ctx)
Normal color of character pixels on display.
void osd_set_video_sync_mode(osd_t *ctx, uint8_t sync_mode)
Set video sync mode function.
void osd_character_blinking_on(osd_t *ctx)
Set blinking ON function.
void osd_set_vertical_offset(osd_t *ctx, uint8_t v_offset)
Set vertical offset function.
void osd_insert_custom_char(osd_t *ctx, uint8_t chr_address, uint8_t custom_char)
Write custom character function.
void osd_set_background_brightness(osd_t *ctx, uint8_t brightness)
Set background brightness function.
void osd_enable_video_buffer(osd_t *ctx)
Enable video buffer.
void osd_set_character_color_black(osd_t *ctx)
Set the black background of the character function.
void osd_set_horizontal_offset(osd_t *ctx, uint8_t h_offset)
Set horizontal offset function.
void osd_blinking_on(osd_t *ctx)
Set blinking ON function.
uint8_t osd_get_display_data_out(osd_t *ctx)
Get display memory data out function.
void osd_invert_pixels_character(osd_t *ctx)
Invert color of character pixels on display.
void osd_vertical_sync_screen(osd_t *ctx, uint8_t vsync)
Enable vertical synchronization of on-screen data function.
Click configuration structure definition.
Definition osd.h:165
pin_name_t hsy
Definition osd.h:175
pin_name_t vsy
Definition osd.h:176
spi_master_chip_select_polarity_t cs_polarity
Definition osd.h:181
pin_name_t los
Definition osd.h:173
pin_name_t sck
Definition osd.h:169
spi_master_mode_t spi_mode
Definition osd.h:180
pin_name_t mosi
Definition osd.h:168
uint32_t spi_speed
Definition osd.h:179
pin_name_t miso
Definition osd.h:167
pin_name_t rst
Definition osd.h:174
pin_name_t cs
Definition osd.h:170
Click ctx object definition.
Definition osd.h:146
spi_master_t spi
Definition osd.h:156
digital_in_t los
Definition osd.h:151
digital_in_t vsy
Definition osd.h:153
digital_in_t hsy
Definition osd.h:152
digital_out_t rst
Definition osd.h:148
pin_name_t chip_select
Definition osd.h:157
Structure for osd_write_chars() call.
Definition osd.h:189
uint8_t line_pos
Definition osd.h:192
uint8_t flags
Definition osd.h:191
uint8_t row_pos
Definition osd.h:193
uint8_t n_byte
Definition osd.h:190