ZDev Library

User Manual

Zilogic Systems

Revision History
Revision 1.2.0September 2011ZS

Table of Contents

1. Introduction
2. Board
board_init — initializes the board
board_stdout — sets the output device
3. Event
event_poll — check and invoke callbacks
4. IRQ
irq_setcb — sets the IRQ handler
irq_enable — enables the specified IRQ line
irq_disable — disables the speicifed IRQ line
5. Timer
timer_init — initializes the timer module.
timer_setup — initializes a new timer.
timer_setcb — Sets callback to be invoked
timer_expired — checks if timer has expired
6. Delay
delay_init — initializes the delay module.
mdelay — generates millisecond delays
7. Error
error_setcb — sets the error callback.
error_str — gets the error message.
8. LCD
lcd_init — initializes the LCD
lcd_putc — displays a character on the LCD
lcd_puts — displays a string on the LCD
lcd_goto — moves the LCD cursor
lcd_clear — clears the LCD
9. Graphics
gfx_init — initializes the graphics hardware and buffer.
gfx_clear — clears the display screen.
gfx_update — flushes the in-RAM graphics buffer.
gfx_set_pixel — sets the color of the specified pixel.
gfx_blit_bmp — copies a bitmap to the specified location.
gfx_set_font — sets the font as current font
gfx_draw_string — displays a string in the glcd
10. Button
button_init — initializes the button module
button_tstc — checks if button has been pressed
button_getc — gets the button pressed
button_setcb — sets the button callback
11. I˛C
i2c_init — initializes I2C hardware.
i2c_start — generates START condition
i2c_stop — generates STOP condition
i2c_write — transmits a byte
i2c_read — receives a byte
i2c_get_config — gets current config.
i2c_set_config — sets the specified config.
i2c_tx — writes data to a slave device
i2c_rx — reads from a slave device
12. SPI
spi_init — initializes SPI controller
spi_tx_rx — transmit and receive a byte
spi_get_config — gets current config.
spi_set_config — sets the specified config.
13. Serial
serial_init — initializes serial port
serial_init_with_fifo — initializes serial port
serial_putc — sends a character
serial_puts — sends a string
serial_getc — gets the character received
serial_tstc — checks if character has been received
serial_rx_setcb — set the serial callback
14. GPIO
gpio_init — initializes the GPIO module
gpio_enable_pin — enables GPIO functionality
gpio_direction_input — switches pin direction to input
gpio_direction_output — switches pin direction to output
gpio_set_pin — sets the output pin state
gpio_get_pin — gets the input pin state
15. PWM
pwm_init — initializes the PWM interface
pwm_set_period — sets the PWM signal period.
pwm_set_frequency — sets the PWM signal frequency.
pwm_set_duty — sets the PWM signal duty cycle
pwm_start — starts PWM signal generation
pwm_stop — stops PWM signal generation
16. ADC
adc_init — initializes the ADC interface
adc_enable — enables a channel
adc_read8 — reads a byte from the ADC
adc_read16 — reads a 16-bit word from ADC
17. DAC
dac_init — initializes the DAC interface
dac_write8 — writes a byte to the DAC
dac_write16 — writes a 16-bit word to the DAC
18. EEPROM
eeprom_init — initializes the EEPROM
eeprom_write_protect — enables/disables EEPROM write protect
eeprom_write — writes to the EEPROM
eeprom_read — reads from the EEPROM
19. Using ZDev
1. Windows XP/2000/Vista
2. GNU/Linux