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

Hardware Abstraction Layer for codec TLV320AIC33 running on AVR32
UC3A3 architecture. More...

`#include "tlv320aic33_HAL_AVR32_UC3A3_HW_interface.h"`

## Macros
#define | TLV320AIC33_TWI_TIMEOUT (250*(TLV320AIC33_TWI_CLK_SOURCE/TLV320AIC33_TWI_BAUDRATE))
| Define when timeout occurs. More...

## Functions
TLV320AIC33_status_t | tlv320aic33_HAL_init (void)
| Initialize TWI module on chip. More...
TLV320AIC33_status_t | tlv320aic33_HAL_write_data (uint8_t i_register_number, uint8_t i_data)
| Write data on TWI (I2C) bus. More...
TLV320AIC33_status_t | tlv320aic33_HAL_read_data (uint8_t i_register_number, uint8_t *p_data)
| Read data on TWI (I2C) bus. More...

## Detailed Description

Hardware Abstraction Layer for codec TLV320AIC33 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: 02.04.2014
Modified: 23.04.2014

Version
  0.1

Author
  Martin Stejskal

## Macro Definition Documentation

#define TLV320AIC33_TWI_TIMEOUT (250*(TLV320AIC33_TWI_CLK_SOURCE/TLV320AIC33_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

TLV320AIC33_status_t tlv320aic33_HAL_init | ( | void | ) |  |

Initialize TWI module on chip.

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

Returns
  TLV320AIC33_OK (0) if all OK

TLV320AIC33_status_t tlv320aic33_HAL_read_data | ( | uint8_t | i_register_number,
|  | uint8_t * | p_data
| ) |  |

Read data on TWI (I2C) bus.

MCU is in master mode. Send TLV320AIC33 address, register value, repeated
start condition, TLV320AIC33 address and then receive data.

Parameters

  i_register_number | Register number
  p_data | Data are saved thru this pointer

Returns
  TLV320AIC33_OK (0) if all OK

TLV320AIC33_status_t tlv320aic33_HAL_write_data | ( | uint8_t | i_register_number,
|  | uint8_t | i_data
| ) |  |

Write data on TWI (I2C) bus.

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

Parameters

  i_register_number | Register number
  i_data | Data which will be send to codec

Returns
  TLV320AIC33_OK (0) if all OK