Sonochan II 0.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
LCD_5110_HAL_AVR32_UC3A3_HW_interface.c File Reference

Hardware Abstraction Layer for AVR32 and LCD used in nokia 5110
Use hardware SPI module on AVR. More...

`#include "LCD_5110_HAL_AVR32_UC3A3_HW_interface.h"`

## Macros
#define | LCD_5110_SPI_BITS_PER_TRANSFER 8
| Number of bits witch will be send by SPI at transmit. More...

## Functions
e_lcd_5110_status | LCD_5110_HAL_init_SPI (void)
| Initialize SPI HW, set GPIO and set (enable) clock source. More...
e_lcd_5110_status | LCD_5110_HAL_wait_for_SPI_tx (void)
| Stay in loop until sending data from SPI. More...
e_lcd_5110_status | LCD_5110_HAL_init (void)
| Initialize necessary HW and do initialize routine for LCD. More...
e_lcd_5110_status | LCD_5110_HAL_send_data_byte (uint8_t i_data)
| Send one data Byte to LCD module. More...
e_lcd_5110_status | LCD_5110_HAL_send_command_byte (uint8_t i_cmd)
| Send one command Byte to LCD module. More...
e_lcd_5110_status | LCD_5110_HAL_backlight_on (void)
| Turn on backlight on LCD module (set pin to high) More...
e_lcd_5110_status | LCD_5110_HAL_backlight_off (void)
| Turn off backlight on LCD module (set pin to low) More...

## Detailed Description

Hardware Abstraction Layer for AVR32 and LCD used in nokia 5110
Use hardware SPI module on AVR.

Contains basic low level functions which depend on user architecture and
hardware. Thanks to this layer is possible use common higher level driver
and apply it thru many architectures and devices. Also this allow easy
updates independent to higher layer (new features and so on).

Created: 05.05.2014
Modified: 05.05.2014

Version
  0.1

Author
  Martin Stejskal

## Macro Definition Documentation

#define LCD_5110_SPI_BITS_PER_TRANSFER 8

Number of bits witch will be send by SPI at transmit.

This variable user should not change

## Function Documentation

e_lcd_5110_status LCD_5110_HAL_backlight_off | ( | void | ) |  |
| inline

Turn off backlight on LCD module (set pin to low)

LED should be controlled thru transistor, so that is reason why logic is
opposite to hardware design of LCD module.

Returns
  LCD_5110_OK (0) if support for backlight is enabled

e_lcd_5110_status LCD_5110_HAL_backlight_on | ( | void | ) |  |
| inline

Turn on backlight on LCD module (set pin to high)

LED should be controlled thru transistor, so that is reason why logic is
opposite to hardware design of LCD module.

Returns
  LCD_5110_OK (0) if support for backlight is enabled

e_lcd_5110_status LCD_5110_HAL_init | ( | void | ) |  |

Initialize necessary HW and do initialize routine for LCD.

Initialize SPI, GPIO and send initialization commands to LCD. This
function must be called first.

Returns
  LCD_5110_OK (0) if all OK

e_lcd_5110_status LCD_5110_HAL_init_SPI | ( | void | ) |  |
| inline

Initialize SPI HW, set GPIO and set (enable) clock source.

e_lcd_5110_status LCD_5110_HAL_send_command_byte | ( | uint8_t | i_cmd) |  |

Send one command Byte to LCD module.

Parameters

  i_cmd | Command which will be send to LCD module

Returns
  LCD_5110_OK (0) if all OK

e_lcd_5110_status LCD_5110_HAL_send_data_byte | ( | uint8_t | i_data) |  |

Send one data Byte to LCD module.

Parameters

  i_Byte | Data byte which will be send to LCD module

Returns
  LCD_5110_OK (0) if all OK

e_lcd_5110_status LCD_5110_HAL_wait_for_SPI_tx | ( | void | ) |  |
| inline

Stay in loop until sending data from SPI.

This is blocking function.