llvm-mos-sdk
Macros | Enumerations
hardware.h File Reference
#include <stdint.h>
Include dependency graph for hardware.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MMU_WRITE   0x00
 
#define MMU_READ   0x80
 
#define MMU_ENABLE   0x00
 
#define MMU_DISABLE   0x80
 
#define MMU_REDBUS_ID   0x00
 
#define MMU_REDBUS_WINDOW_OFFSET   0x01
 
#define MMU_REDBUS_ACTIVE   0x02
 
#define MMU_ADDRESS_BRK   0x05
 
#define MMU_ADDRESS_POR   0x06
 
#define MMU_DEBUG   0xFF
 
#define IO_DISPLAY_ROW_Y   ((volatile uint8_t *)0x0300)
 
#define IO_DISPLAY_CURSOR_X   ((volatile uint8_t *)0x0301)
 
#define IO_DISPLAY_CURSOR_Y   ((volatile uint8_t *)0x0302)
 
#define IO_DISPLAY_CURSOR_MODE   ((volatile uint8_t *)0x0303)
 
#define IO_DISPLAY_KEY_BUFFER_START   ((volatile uint8_t *)0x0304)
 
#define IO_DISPLAY_KEY_BUFFER_POS   ((volatile uint8_t *)0x0305)
 
#define IO_DISPLAY_KEY_BUFFER_VALUE   ((volatile uint8_t *)0x0306)
 
#define IO_DISPLAY_BLIT_MODE   ((volatile uint8_t *)0x0307)
 
#define IO_DISPLAY_BLIT_SRC_X   ((volatile uint8_t *)0x0308)
 
#define IO_DISPLAY_BLIT_SRC_Y   ((volatile uint8_t *)0x0309)
 
#define IO_DISPLAY_BLIT_DEST_X   ((volatile uint8_t *)0x030A)
 
#define IO_DISPLAY_BLIT_DEST_Y   ((volatile uint8_t *)0x030B)
 
#define IO_DISPLAY_BLIT_WIDTH   ((volatile uint8_t *)0x030C)
 
#define IO_DISPLAY_BLIT_HEIGHT   ((volatile uint8_t *)0x030D)
 
#define IO_DISPLAY_BLIT_FILL_VALUE   ((volatile uint8_t *)0x0308)
 
#define IO_DISPLAY_ROW   ((volatile uint8_t *)0x0310)
 
#define IO_DRIVE_BUFFER   ((volatile uint8_t *)0x0300)
 
#define IO_DRIVE_SECTOR   ((volatile uint16_t *)0x0380)
 
#define IO_DRIVE_COMMAND   ((volatile uint8_t *)0x0382)
 
#define DRIVE_STATUS_SUCCESS   0x00
 
#define DRIVE_STATUS_ERROR   0xFF
 
#define IO_DRIVE_STATUS   ((volatile uint8_t *)0x0382)
 
#define COLOR_WHITE   0x0001
 
#define COLOR_ORANGE   0x0002
 
#define COLOR_MAGENTA   0x0004
 
#define COLOR_LIGHT_BLUE   0x0008
 
#define COLOR_YELLOW   0x0010
 
#define COLOR_LIME   0x0020
 
#define COLOR_PINK   0x0040
 
#define COLOR_GRAY   0x0080
 
#define COLOR_LIGHT_GRAY   0x0100
 
#define COLOR_CYAN   0x0200
 
#define COLOR_PURPLE   0x0400
 
#define COLOR_BLUE   0x0800
 
#define COLOR_BROWN   0x1000
 
#define COLOR_GREEN   0x2000
 
#define COLOR_RED   0x4000
 
#define COLOR_BLACK   0x8000
 
#define IO_IOX_INPUT   ((volatile uint16_t *)0x0300)
 
#define IO_IOX_OUTPUT   ((volatile uint16_t *)0x0302)
 
#define IO_SORTRON_COMMAND   ((volatile uint8_t *)0x0300)
 
#define SORTRON_STATUS_SUCCESS   0x00
 
#define SORTRON_STATUS_ERROR   0xFF
 
#define IO_SORTRON_STATUS   ((volatile uint8_t *)0x0300)
 
#define IO_SORTRON_ITEM_COUNT   ((volatile uint8_t *)0x0301)
 
#define IO_SORTRON_ITEM_SLOT   ((volatile uint16_t *)0x0302)
 
#define IO_SORTRON_ITEM_HASH   ((volatile uint32_t *)0x0304)
 
#define IO_SORTRON_ITEM_DAMAGE   ((volatile uint16_t *)0x0308)
 
#define IO_SORTRON_ITEM_MAX_DAMAGE   ((volatile uint16_t *)0x030A)
 
#define IO_SORTRON_ITEM_IN_COLOR_TAG   ((volatile uint8_t *)0x030C)
 
#define IO_SORTRON_ITEM_OUT_COLOR_TAG   ((volatile uint8_t *)0x030D)
 

Enumerations

enum  cursor_mode_t { CURSOR_MODE_HIDDEN = 0, CURSOR_MODE_SOLID = 1, CURSOR_MODE_BLINK = 2 }
 
enum  display_blit_mode_t { DISPLAY_BLIT_MODE_NONE = 0, DISPLAY_BLIT_MODE_FILL = 1, DISPLAY_BLIT_MODE_INVERT = 2, DISPLAY_BLIT_MODE_SHIFT = 3 }
 
enum  drive_command_t {
  DRIVE_COMMAND_IDLE = 0x00, DRIVE_COMMAND_READ_NAME = 0x01, DRIVE_COMMAND_WRITE_NAME = 0x02, DRIVE_COMMAND_READ_SERIAL = 0x03,
  DRIVE_COMMAND_READ_SECTOR = 0x04, DRIVE_COMMAND_WRITE_SECTOR = 0x05
}
 
enum  sortron_command_t { SORTRON_COMMAND_READ_SLOT_COUNT = 1, SORTRON_COMMAND_READ_SLOT = 2, SORTRON_COMMAND_EXTRACT_SLOT = 3, SORTRON_COMMAND_MATCH_INPUT = 4 }
 
enum  color_tag_t {
  COLOR_TAG_NONE = 0, COLOR_TAG_WHITE = 1, COLOR_TAG_ORANGE = 2, COLOR_TAG_MAGNETA = 3,
  COLOR_TAG_LIGHT_BLUE = 4, COLOR_TAG_YELLOW = 5, COLOR_TAG_LIME = 6, COLOR_TAG_PINK = 7,
  COLOR_TAG_GRAY = 8, COLOR_TAG_LIGHT_GRAY = 9, COLOR_TAG_CYAN = 10, COLOR_TAG_PURPLE = 11,
  COLOR_TAG_BLUE = 12, COLOR_TAG_BROWN = 13, COLOR_TAG_GREEN = 14, COLOR_TAG_RED = 15,
  COLOR_TAG_BLACK = 16
}
 

Detailed Description

Hardware defines.

Macro Definition Documentation

◆ COLOR_BLACK

#define COLOR_BLACK   0x8000

◆ COLOR_BLUE

#define COLOR_BLUE   0x0800

◆ COLOR_BROWN

#define COLOR_BROWN   0x1000

◆ COLOR_CYAN

#define COLOR_CYAN   0x0200

◆ COLOR_GRAY

#define COLOR_GRAY   0x0080

◆ COLOR_GREEN

#define COLOR_GREEN   0x2000

◆ COLOR_LIGHT_BLUE

#define COLOR_LIGHT_BLUE   0x0008

◆ COLOR_LIGHT_GRAY

#define COLOR_LIGHT_GRAY   0x0100

◆ COLOR_LIME

#define COLOR_LIME   0x0020

◆ COLOR_MAGENTA

#define COLOR_MAGENTA   0x0004

◆ COLOR_ORANGE

#define COLOR_ORANGE   0x0002

◆ COLOR_PINK

#define COLOR_PINK   0x0040

◆ COLOR_PURPLE

#define COLOR_PURPLE   0x0400

◆ COLOR_RED

#define COLOR_RED   0x4000

◆ COLOR_WHITE

#define COLOR_WHITE   0x0001

◆ COLOR_YELLOW

#define COLOR_YELLOW   0x0010

◆ DRIVE_STATUS_ERROR

#define DRIVE_STATUS_ERROR   0xFF

◆ DRIVE_STATUS_SUCCESS

#define DRIVE_STATUS_SUCCESS   0x00

◆ IO_DISPLAY_BLIT_DEST_X

#define IO_DISPLAY_BLIT_DEST_X   ((volatile uint8_t *)0x030A)

◆ IO_DISPLAY_BLIT_DEST_Y

#define IO_DISPLAY_BLIT_DEST_Y   ((volatile uint8_t *)0x030B)

◆ IO_DISPLAY_BLIT_FILL_VALUE

#define IO_DISPLAY_BLIT_FILL_VALUE   ((volatile uint8_t *)0x0308)

◆ IO_DISPLAY_BLIT_HEIGHT

#define IO_DISPLAY_BLIT_HEIGHT   ((volatile uint8_t *)0x030D)

◆ IO_DISPLAY_BLIT_MODE

#define IO_DISPLAY_BLIT_MODE   ((volatile uint8_t *)0x0307)

◆ IO_DISPLAY_BLIT_SRC_X

#define IO_DISPLAY_BLIT_SRC_X   ((volatile uint8_t *)0x0308)

◆ IO_DISPLAY_BLIT_SRC_Y

#define IO_DISPLAY_BLIT_SRC_Y   ((volatile uint8_t *)0x0309)

◆ IO_DISPLAY_BLIT_WIDTH

#define IO_DISPLAY_BLIT_WIDTH   ((volatile uint8_t *)0x030C)

◆ IO_DISPLAY_CURSOR_MODE

#define IO_DISPLAY_CURSOR_MODE   ((volatile uint8_t *)0x0303)

◆ IO_DISPLAY_CURSOR_X

#define IO_DISPLAY_CURSOR_X   ((volatile uint8_t *)0x0301)

◆ IO_DISPLAY_CURSOR_Y

#define IO_DISPLAY_CURSOR_Y   ((volatile uint8_t *)0x0302)

◆ IO_DISPLAY_KEY_BUFFER_POS

#define IO_DISPLAY_KEY_BUFFER_POS   ((volatile uint8_t *)0x0305)

◆ IO_DISPLAY_KEY_BUFFER_START

#define IO_DISPLAY_KEY_BUFFER_START   ((volatile uint8_t *)0x0304)

◆ IO_DISPLAY_KEY_BUFFER_VALUE

#define IO_DISPLAY_KEY_BUFFER_VALUE   ((volatile uint8_t *)0x0306)

◆ IO_DISPLAY_ROW

#define IO_DISPLAY_ROW   ((volatile uint8_t *)0x0310)

◆ IO_DISPLAY_ROW_Y

#define IO_DISPLAY_ROW_Y   ((volatile uint8_t *)0x0300)

◆ IO_DRIVE_BUFFER

#define IO_DRIVE_BUFFER   ((volatile uint8_t *)0x0300)

◆ IO_DRIVE_COMMAND

#define IO_DRIVE_COMMAND   ((volatile uint8_t *)0x0382)

◆ IO_DRIVE_SECTOR

#define IO_DRIVE_SECTOR   ((volatile uint16_t *)0x0380)

◆ IO_DRIVE_STATUS

#define IO_DRIVE_STATUS   ((volatile uint8_t *)0x0382)

◆ IO_IOX_INPUT

#define IO_IOX_INPUT   ((volatile uint16_t *)0x0300)

◆ IO_IOX_OUTPUT

#define IO_IOX_OUTPUT   ((volatile uint16_t *)0x0302)

◆ IO_SORTRON_COMMAND

#define IO_SORTRON_COMMAND   ((volatile uint8_t *)0x0300)

◆ IO_SORTRON_ITEM_COUNT

#define IO_SORTRON_ITEM_COUNT   ((volatile uint8_t *)0x0301)

◆ IO_SORTRON_ITEM_DAMAGE

#define IO_SORTRON_ITEM_DAMAGE   ((volatile uint16_t *)0x0308)

◆ IO_SORTRON_ITEM_HASH

#define IO_SORTRON_ITEM_HASH   ((volatile uint32_t *)0x0304)

◆ IO_SORTRON_ITEM_IN_COLOR_TAG

#define IO_SORTRON_ITEM_IN_COLOR_TAG   ((volatile uint8_t *)0x030C)

◆ IO_SORTRON_ITEM_MAX_DAMAGE

#define IO_SORTRON_ITEM_MAX_DAMAGE   ((volatile uint16_t *)0x030A)

◆ IO_SORTRON_ITEM_OUT_COLOR_TAG

#define IO_SORTRON_ITEM_OUT_COLOR_TAG   ((volatile uint8_t *)0x030D)

◆ IO_SORTRON_ITEM_SLOT

#define IO_SORTRON_ITEM_SLOT   ((volatile uint16_t *)0x0302)

◆ IO_SORTRON_STATUS

#define IO_SORTRON_STATUS   ((volatile uint8_t *)0x0300)

◆ MMU_ADDRESS_BRK

#define MMU_ADDRESS_BRK   0x05

◆ MMU_ADDRESS_POR

#define MMU_ADDRESS_POR   0x06

◆ MMU_DEBUG

#define MMU_DEBUG   0xFF

◆ MMU_DISABLE

#define MMU_DISABLE   0x80

◆ MMU_ENABLE

#define MMU_ENABLE   0x00

◆ MMU_READ

#define MMU_READ   0x80

◆ MMU_REDBUS_ACTIVE

#define MMU_REDBUS_ACTIVE   0x02

◆ MMU_REDBUS_ID

#define MMU_REDBUS_ID   0x00

◆ MMU_REDBUS_WINDOW_OFFSET

#define MMU_REDBUS_WINDOW_OFFSET   0x01

◆ MMU_WRITE

#define MMU_WRITE   0x00

◆ SORTRON_STATUS_ERROR

#define SORTRON_STATUS_ERROR   0xFF

◆ SORTRON_STATUS_SUCCESS

#define SORTRON_STATUS_SUCCESS   0x00

Enumeration Type Documentation

◆ color_tag_t

Enumerator
COLOR_TAG_NONE 
COLOR_TAG_WHITE 
COLOR_TAG_ORANGE 
COLOR_TAG_MAGNETA 
COLOR_TAG_LIGHT_BLUE 
COLOR_TAG_YELLOW 
COLOR_TAG_LIME 
COLOR_TAG_PINK 
COLOR_TAG_GRAY 
COLOR_TAG_LIGHT_GRAY 
COLOR_TAG_CYAN 
COLOR_TAG_PURPLE 
COLOR_TAG_BLUE 
COLOR_TAG_BROWN 
COLOR_TAG_GREEN 
COLOR_TAG_RED 
COLOR_TAG_BLACK 

◆ cursor_mode_t

Enumerator
CURSOR_MODE_HIDDEN 
CURSOR_MODE_SOLID 
CURSOR_MODE_BLINK 

◆ display_blit_mode_t

Enumerator
DISPLAY_BLIT_MODE_NONE 
DISPLAY_BLIT_MODE_FILL 
DISPLAY_BLIT_MODE_INVERT 
DISPLAY_BLIT_MODE_SHIFT 

◆ drive_command_t

Enumerator
DRIVE_COMMAND_IDLE 
DRIVE_COMMAND_READ_NAME 

Read the disk name to the drive's buffer.

DRIVE_COMMAND_WRITE_NAME 

Write the disk name from the drive's buffer.

DRIVE_COMMAND_READ_SERIAL 

Read the disk serial number to the drive's buffer.

DRIVE_COMMAND_READ_SECTOR 

Read the disk's SECTOR-th sector to the drive's buffer.

DRIVE_COMMAND_WRITE_SECTOR 

Write the disk's SECTOR-th sector from the drive's buffer.

◆ sortron_command_t

Enumerator
SORTRON_COMMAND_READ_SLOT_COUNT 

Read the total slot count of the attached inventory to ITEM_SLOT.

SORTRON_COMMAND_READ_SLOT 

Read the ITEM_SLOT-th slot of the attached inventory. Writes to ITEM_COUNT, ITEM_SLOT, ITEM_HASH, ITEM_DAMAGE, ITEM_MAX_DAMAGE.

SORTRON_COMMAND_EXTRACT_SLOT 

Extract ITEM_COUNT items from ITEM_SLOT-th slot of the attached inventory to an attached pipe, optionally coloring with with the specified ITEM_OUT_COLOR_TAG.

SORTRON_COMMAND_MATCH_INPUT 

Match for a given ITEM_COUNT, ITEM_HASH and ITEM_IN_COLOR_TAG on an attached pipe. Returns success when a match is found.