32 #ifndef LIB_MAX7456_MAX7456_H_
33 #define LIB_MAX7456_MAX7456_H_
40 #define MAX7456_MODE_PAL 0
41 #define MAX7456_MODE_NTSC 1
43 #define MAX7456_ATTR_NONE 0
44 #define MAX7456_ATTR_INVERT 1
45 #define MAX7456_ATTR_BLINK 2
46 #define MAX7456_ATTR_LBC 4
48 #define MAX7456_PAL_COLUMNS 30
49 #define MAX7456_PAL_ROWS 16
50 #define MAX7456_PAL_HCENTER (MAX7456_PAL_COLUMNS / 2)
51 #define MAX7456_PAL_VCENTER (MAX7456_PAL_ROWS / 2)
53 #define MAX7456_NTSC_COLUMNS 30
54 #define MAX7456_NTSC_ROWS 13
55 #define MAX7456_NTSC_HCENTER (MAX7456_NTSC_COLUMNS / 2)
56 #define MAX7456_NTSC_VCENTER (MAX7456_NTSC_ROWS / 2)
59 #define MAX7456_COLUMNS MAX7456_NTSC_COLUMNS
60 #define MAX7456_HCENTER MAX7456_NTSC_HCENTER
63 #define MAX7456_FMT_H_CENTER 31
101 uint8_t char_index, uint8_t *
data);
112 uint8_t chr, uint8_t attr);
123 const char *s, uint8_t attr);
135 uint8_t *
mode, uint8_t *right, uint8_t *bottom,
136 uint8_t *hcenter, uint8_t *vcenter);
bool PIOS_MAX7456_stall_detect(max7456_dev_t dev)
Detects whether the OSD chip has stalled and attempts to restart it.
struct max7456_dev_s * max7456_dev_t
void PIOS_MAX7456_put(max7456_dev_t dev, uint8_t col, uint8_t row, uint8_t chr, uint8_t attr)
Sets a position of character memory.
uint8_t data[XFER_BYTES_PER_PACKET]
void PIOS_MAX7456_set_mode(max7456_dev_t dev, bool force, uint8_t fallback)
Allows overriding the video mode used by OSD.
void PIOS_MAX7456_puts(max7456_dev_t dev, uint8_t col, uint8_t row, const char *s, uint8_t attr)
Sets a string into character memory.
void PIOS_MAX7456_get_extents(max7456_dev_t dev, uint8_t *mode, uint8_t *right, uint8_t *bottom, uint8_t *hcenter, uint8_t *vcenter)
Gets the extents of the screen.
void PIOS_MAX7456_clear(max7456_dev_t dev)
Clear the screen.
void PIOS_MAX7456_download_char(max7456_dev_t dev, uint8_t char_index, uint8_t *data)
Download a character from the device.
void PIOS_MAX7456_upload_char(max7456_dev_t dev, uint8_t char_index, const uint8_t *data)
Upload a character to the device.
int PIOS_MAX7456_init(max7456_dev_t *dev_out, pios_spi_t spi_handle, uint32_t slave_idx)
Allocate and initialise MAX7456 device.
void PIOS_MAX7456_wait_vsync()