IBNOS
Macros | Typedefs | Functions
pic.h File Reference
#include <stdbool.h>
#include <stdint.h>
Include dependency graph for pic.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PIC1_PORT   0x20
 
#define PIC2_PORT   0xA0
 
#define PIC1_COMMAND_PORT   PIC1_PORT
 
#define PIC1_DATA_PORT   (PIC1_PORT+1)
 
#define PIC2_COMMAND_PORT   PIC2_PORT
 
#define PIC2_DATA_PORT   (PIC2_PORT+1)
 
#define ICW1_ICW4   0x01
 
#define ICW1_SINGLE   0x02
 
#define ICW1_INTERVAL4   0x04
 
#define ICW1_LEVEL   0x08
 
#define ICW1_INIT   0x10
 
#define ICW4_8086   0x01
 
#define ICW4_AUTO   0x02
 
#define ICW4_BUF_SLAVE   0x08
 
#define ICW4_BUF_MASTER   0x0C
 
#define ICW4_SFNM   0x10
 
#define PIC_EOI   0x20
 
#define IRQ_COUNT   16
 
IRQ Ports
#define IRQ_PIT   0
 
#define IRQ_KEYBOARD   1
 
#define IRQ_SLAVE   2
 
#define IRQ_COM2   3
 
#define IRQ_COM1   4
 
#define IRQ_LPT2   5
 
#define IRQ_FLOPPY   6
 
#define IRQ_LPT1   7
 
#define IRQ_CMOS_CLOCK   8
 
#define IRQ_PS2_MOUSE   12
 
#define IRQ_FPU   13
 
#define IRQ_ATA1   14
 
#define IRQ_ATA2   15
 

Typedefs

typedef uint32_t(* irq_callback) (uint32_t irq)
 

Functions

void picInit (uint32_t interruptOffset)
 Initializes the programmable interrupt controller. More...
 
bool picReserveIRQ (uint32_t irq, irq_callback callback)
 Assign a callback function to an IRQ. More...
 
void picFreeIRQ (uint32_t irq)
 Release an IRQ. More...
 

Macro Definition Documentation

◆ ICW1_ICW4

#define ICW1_ICW4   0x01

Definition at line 43 of file pic.h.

◆ ICW1_INIT

#define ICW1_INIT   0x10

Definition at line 47 of file pic.h.

◆ ICW1_INTERVAL4

#define ICW1_INTERVAL4   0x04

Definition at line 45 of file pic.h.

◆ ICW1_LEVEL

#define ICW1_LEVEL   0x08

Definition at line 46 of file pic.h.

◆ ICW1_SINGLE

#define ICW1_SINGLE   0x02

Definition at line 44 of file pic.h.

◆ ICW4_8086

#define ICW4_8086   0x01

Definition at line 49 of file pic.h.

◆ ICW4_AUTO

#define ICW4_AUTO   0x02

Definition at line 50 of file pic.h.

◆ ICW4_BUF_MASTER

#define ICW4_BUF_MASTER   0x0C

Definition at line 52 of file pic.h.

◆ ICW4_BUF_SLAVE

#define ICW4_BUF_SLAVE   0x08

Definition at line 51 of file pic.h.

◆ ICW4_SFNM

#define ICW4_SFNM   0x10

Definition at line 53 of file pic.h.

◆ IRQ_COUNT

#define IRQ_COUNT   16

Definition at line 57 of file pic.h.

◆ PIC1_COMMAND_PORT

#define PIC1_COMMAND_PORT   PIC1_PORT

Definition at line 38 of file pic.h.

◆ PIC1_DATA_PORT

#define PIC1_DATA_PORT   (PIC1_PORT+1)

Definition at line 39 of file pic.h.

◆ PIC1_PORT

#define PIC1_PORT   0x20

Definition at line 36 of file pic.h.

◆ PIC2_COMMAND_PORT

#define PIC2_COMMAND_PORT   PIC2_PORT

Definition at line 40 of file pic.h.

◆ PIC2_DATA_PORT

#define PIC2_DATA_PORT   (PIC2_PORT+1)

Definition at line 41 of file pic.h.

◆ PIC2_PORT

#define PIC2_PORT   0xA0

Definition at line 37 of file pic.h.

◆ PIC_EOI

#define PIC_EOI   0x20

Definition at line 55 of file pic.h.

Typedef Documentation

◆ irq_callback

typedef uint32_t(* irq_callback) (uint32_t irq)

Definition at line 82 of file pic.h.