blink65 1.0
Write Arduino-style sketches for VIC-20 and Commodore 64.
Loading...
Searching...
No Matches
Macros | Functions
blink65.h File Reference
#include <stdint.h>
Include dependency graph for blink65.h:

Go to the source code of this file.

Macros

#define INPUT   0
 Pin mode input, high Z.
 
#define OUTPUT   1
 Pin mode output.
 
#define LOW   0
 Output state low.
 
#define HIGH   1
 Output state high.
 
#define DBG(...)
 Print a formatted message to the console in DEBUG mode.
 
#define interrupts()   __asm__("cli")
 Enables maskable interrupts.
 
#define noInterrupts()   __asm__("sei")
 Disables maskable interrupts.
 

Functions

void delay (uint32_t milliseconds)
 Stops execution for the given amount of milliseconds.
 
void analogWrite (uint8_t pin, uint8_t level)
 Sets the output level for an analog pin using Pulse Width Modulation (PWM).
 
uint8_t digitalRead (uint8_t pin)
 Reads state of an input pin.
 
void digitalWrite (uint8_t pin, uint8_t state)
 Sets state of an output pin.
 
void noTone (uint8_t pin)
 Stops tone output.
 
void pinMode (uint8_t pin, uint8_t mode)
 Sets mode of a pin.
 
void tone (uint8_t pin, uint16_t frequency)
 Outputs a square wave with the given frequency in the range 10Hz..65kHz.
 
void setup (void)
 Called once before loop().
 
void loop (void)
 Called repeatedly after setup().
 

Macro Definition Documentation

◆ DBG

#define DBG (   ...)

Print a formatted message to the console in DEBUG mode.

◆ HIGH

#define HIGH   1

Output state high.

◆ INPUT

#define INPUT   0

Pin mode input, high Z.

◆ interrupts

#define interrupts ( )    __asm__("cli")

Enables maskable interrupts.

◆ LOW

#define LOW   0

Output state low.

◆ noInterrupts

#define noInterrupts ( )    __asm__("sei")

Disables maskable interrupts.

◆ OUTPUT

#define OUTPUT   1

Pin mode output.

Function Documentation

◆ analogWrite()

void analogWrite ( uint8_t  pin,
uint8_t  level 
)

Sets the output level for an analog pin using Pulse Width Modulation (PWM).

PWM frequency and resolution may vary depending on the hardware variant and the specific pin used.

Parameters
pinpin number
leveloutput level between 0 and 255 (Vcc)

◆ delay()

void delay ( uint32_t  milliseconds)

Stops execution for the given amount of milliseconds.

Parameters
millisecondsdelay in milliseconds

◆ digitalRead()

uint8_t digitalRead ( uint8_t  pin)

Reads state of an input pin.

Parameters
pinpin number

◆ digitalWrite()

void digitalWrite ( uint8_t  pin,
uint8_t  state 
)

Sets state of an output pin.

Parameters
pinpin number
statenew state, either LOW or HIGH

◆ loop()

void loop ( void  )

Called repeatedly after setup().

◆ noTone()

void noTone ( uint8_t  pin)

Stops tone output.

Parameters
pinpin number

◆ pinMode()

void pinMode ( uint8_t  pin,
uint8_t  mode 
)

Sets mode of a pin.

Parameters
pinpin number
modenew mode, either INPUT or OUTPUT

◆ setup()

void setup ( void  )

Called once before loop().

◆ tone()

void tone ( uint8_t  pin,
uint16_t  frequency 
)

Outputs a square wave with the given frequency in the range 10Hz..65kHz.

Parameters
pinpin number
frequencyfrequency im hertz