@ GNU AS
.syntax unified
.cpu cortex-m4
.thumb
.fpu fpv4-sp-d16


.EQU  SSD1306_X_SIZE, 128
.EQU  SSD1306_Y_SIZE, 32
.EQU  SSD1306_BUFFER_SIZE, ( SSD1306_X_SIZE * SSD1306_Y_SIZE ) / 8

.EQU  SSD1306_I2C_TIMEOUT, 100
.EQU  SSD1306_I2C_ADDRESS, 0x78

.EQU  SSD1306_I2C_CONTROL_BYTE_COMMAND, 0x00
.EQU  SSD1306_I2C_CONTROL_BYTE_DATA, 0x40

.EQU  SSD1306_SET_DISPLAY_OFF, 0xAE
.EQU  SSD1306_SET_DISPLAY_ON, 0xAF
.EQU  SSD1306_SET_MUX_RATIO, 0xA8
.EQU  SSD1306_SET_DISPLAY_OFFSET, 0xD3
.EQU  SSD1306_SET_MEMORY_ADDRESSING_MODE, 0x20
.EQU  SSD1306_HORIZONTAL_ADDRESSING_MODE, 0x00
.EQU  SSD1306_VERTICAL_ADDRESSING_MODE, 0x01
.EQU  SSD1306_PAGE_ADDRESSING_MODE, 0x10
.EQU  SSD1306_SET_INVERSE_COLOR, 0xA7
.EQU  SSD1306_SET_NORMAL_COLOR, 0xA6
.EQU  SSD1306_SET_PRE_CHARGE_PERIOD, 0xD9
.EQU  SSD1306_SET_MIRROR_VERTICALLY, 0xC0
.EQU  SSD1306_SET_NO_MIRROR_VERTICALLY, 0xC8      @ Set COM Output Scan Direction
.EQU  SSD1306_SET_MIRROR_HORIZONTALLY, 0xA0
.EQU  SSD1306_SET_NO_MIRROR_HORIZONTALLY, 0xA1    @ Set segment re-map 0 to 127
.EQU  SSD1306_SET_CONTRAST_CONTROL_REGISTER, 0x81
.EQU  SSD1306_SET_VCOMH, 0xDB
.EQU  SSD1306_065xVCC_VCOMH, 0x00
.EQU  SSD1306_077xVCC_VCOMH, 0x20
.EQU  SSD1306_083xVCC_VCOMH, 0x30
.EQU  SSD1306_SET_COM_PINS_HW_CONF, 0xDA
.EQU  SSD1306_SET_DCDC_ENABLE, 0x8D
.EQU  SSD1306_SET_COLUMN_ADDRESS, 0x21
.EQU  SSD1306_SET_PAGE_ADDRESS, 0x22



