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
cs2200_HAL_AVR32_UC3A3_HW_interface.c File Reference

Hardware Abstraction Layer for PLL CS2200 running on AVR32 UC3A3
architecture. More...

`#include "cs2200_HAL_AVR32_UC3A3_HW_interface.h"`

## Macros
#define | CS2200_TWI_TIMEOUT (250*(CS2200_TWI_CLK_SOURCE/CS2200_TWI_BAUDRATE))
| Define when timeout occurs. More...

## Functions
cs2200_status_t | cs2200_HAL_init (void)
| Initialize TWI module on chip. More...
cs2200_status_t | cs2200_HAL_write_data (uint8_t *p_data, uint8_t i_number_of_bytes)
| Write data on TWI (I2C) bus. More...
cs2200_status_t | cs2200_HAL_read_data (uint8_t *p_data, uint8_t i_number_of_bytes)
| Read data on TWI (I2C) bus. More...

## Detailed Description

Hardware Abstraction Layer for PLL CS2200 running on AVR32 UC3A3
architecture.

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: 10.03.2014
Modified: 12.03.2014

Version
  0.1

Author
  Martin Stejskal

## Macro Definition Documentation

#define CS2200_TWI_TIMEOUT (250*(CS2200_TWI_CLK_SOURCE/CS2200_TWI_BAUDRATE))

Define when timeout occurs.

When waiting for send rest of TX data this constant define how long should
function should wait. Value should be calculated for most applications.
However user can set it explicitly here, but it is not recommended.

## Function Documentation

cs2200_status_t cs2200_HAL_init | ( | void | ) |  |

Initialize TWI module on chip.

Set TWI module as master. Set I/O, enable clock to module and so on

Returns
  CS2200_OK (0) if all OK

cs2200_status_t cs2200_HAL_read_data | ( | uint8_t * | p_data,
|  | uint8_t | i_number_of_bytes
| ) |  |

Read data on TWI (I2C) bus.

MCU is in master mode. Send CS2200 address and then receive data.

Parameters

  p_data | Data are saved thru this pointer
  i_number_of_bytes | Number of data bytes, which will be received

Returns
  CS2200_OK (0) if all OK

cs2200_status_t cs2200_HAL_write_data | ( | uint8_t * | p_data,
|  | uint8_t | i_number_of_bytes
| ) |  |

Write data on TWI (I2C) bus.

MCU is in master mode. Send CS2200 address and then data (argument).

Parameters

  p_data | Pointer to data array which will be send to PLL thru TWI (I2C)
  i_number_of_bytes | Number of data bytes, which will be send

Returns
  CS2200_OK (0) if all OK