Microchip® Advanced Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SAU Driver

Modules

 

Data Structures

struct  sau_map_t
 A type definition of channels and HSB memories to be mapped. More...
 

Macros

#define sau_clear_error_flags(error_flag)   (AVR32_SAU.icr = error_flag)
 Clear the error bits flags in SR. More...
 
#define sau_disable()   (Set_bits(AVR32_SAU.cr, AVR32_SAU_CR_DIS_MASK))
 
#define sau_disable_buserr_resp()
 
#define sau_disable_interrupt(int_source)   (AVR32_SAU.idr = int_source)
 Disable the SAU interrupt. More...
 
#define sau_disable_open_mode()
 
#define sau_enable()   (Set_bits(AVR32_SAU.cr, AVR32_SAU_CR_EN_MASK))
 Enable/Disable the SAU module. More...
 
#define sau_enable_buserr_resp()
 SAU Bus Error Exception response management. More...
 
#define sau_enable_interrupt(int_source)   (AVR32_SAU.ier = int_source)
 Enable the SAU interrupt. More...
 
#define sau_enable_open_mode()
 SAU open mode management. More...
 
#define sau_enter_setup()   (Set_bits(AVR32_SAU.cr, AVR32_SAU_CR_SEN_MASK))
 SAU setup mode management. More...
 
#define sau_exit_setup()   (Set_bits(AVR32_SAU.cr, AVR32_SAU_CR_SDIS_MASK))
 
#define sau_status_check()   (AVR32_SAU.sr & (0xff ^ AVR32_SAU_SR_CAS_MASK))
 Check the error bits flags in SR. More...
 

Functions

bool sau_configure_channels (const sau_map_t saumap, uint32_t size)
 Configs specific HSB memories for a set of channels. More...
 
void sau_disable_channel (unsigned char channel_num)
 
void sau_enable_channel (unsigned char channel_num)
 
void sau_lock_channels (U8 unlock_HSB_cycles, U8 unlock_key)
 Lock SAU channels. More...
 
uint32_t sau_read_channel (unsigned char channel_num)
 Read the HSB memory value by the SAU channel. More...
 
bool sau_unlock_channel (U8 Unlock_channel_number, U8 Unlock_key)
 Unlock an SAU channel. More...
 
void sau_write_channel (uint32_t data, unsigned char channel_num)
 Write the HSB memory value by the SAU channel. More...
 

#define sau_clear_error_flags (   error_flag)    (AVR32_SAU.icr = error_flag)

Clear the error bits flags in SR.

Parameters
error_flag,:The error bits to be cleared

Referenced by main(), and sau_int_handler().

#define sau_disable ( )    (Set_bits(AVR32_SAU.cr, AVR32_SAU_CR_DIS_MASK))
#define sau_disable_buserr_resp ( )
Value:
(Set_bits(AVR32_SAU.cr, \
AVR32_SAU_CR_BERRDIS_MASK))
#define Set_bits(lvalue, mask)
Sets the bits of a C lvalue specified by a given bit-mask.
Definition: compiler.h:489

Referenced by main().

#define sau_disable_interrupt (   int_source)    (AVR32_SAU.idr = int_source)

Disable the SAU interrupt.

Parameters
interrupt_source,:The events that will not generate interrupt request

Referenced by main().

#define sau_disable_open_mode ( )
Value:
(Clr_bits(AVR32_SAU.config, \
AVR32_SAU_CONFIG_OPEN_MASK))
#define Clr_bits(lvalue, mask)
Clears the bits of a C lvalue specified by a given bit-mask.
Definition: compiler.h:480
#define sau_enable ( )    (Set_bits(AVR32_SAU.cr, AVR32_SAU_CR_EN_MASK))

Enable/Disable the SAU module.

Referenced by sau_config_to_usart().

#define sau_enable_buserr_resp ( )
Value:
(Set_bits(AVR32_SAU.cr, \
AVR32_SAU_CR_BERREN_MASK))
#define Set_bits(lvalue, mask)
Sets the bits of a C lvalue specified by a given bit-mask.
Definition: compiler.h:489

SAU Bus Error Exception response management.

Referenced by main().

#define sau_enable_interrupt (   int_source)    (AVR32_SAU.ier = int_source)

Enable the SAU interrupt.

Parameters
int_source,:The events that will generate interrupt request

Referenced by main().

#define sau_enable_open_mode ( )
Value:
(Set_bits(AVR32_SAU.config, \
AVR32_SAU_CONFIG_OPEN_MASK))
#define Set_bits(lvalue, mask)
Sets the bits of a C lvalue specified by a given bit-mask.
Definition: compiler.h:489

SAU open mode management.

Referenced by main().

#define sau_enter_setup ( )    (Set_bits(AVR32_SAU.cr, AVR32_SAU_CR_SEN_MASK))

SAU setup mode management.

Referenced by sau_config_to_usart().

#define sau_exit_setup ( )    (Set_bits(AVR32_SAU.cr, AVR32_SAU_CR_SDIS_MASK))

Referenced by sau_configure_channels().

#define sau_status_check ( )    (AVR32_SAU.sr & (0xff ^ AVR32_SAU_SR_CAS_MASK))

Check the error bits flags in SR.

Referenced by main(), and sau_int_handler().

bool sau_configure_channels ( const sau_map_t  sau_map,
uint32_t  size 
)

Configs specific HSB memories for a set of channels.

Parameters
sau_map,:The memory and channel map.
size,:The number of channels in an SAU sau_map.
Returns
Bool TRUE if the config succeeded FALSE if the config failed (the input is not valid).

References sau_map_t::channel_num, sau_map_t::HSB_mem, i, sau_enable_channel(), and sau_exit_setup.

Referenced by sau_config_to_usart().

void sau_disable_channel ( unsigned char  channel_num)

Control of the SAU control register CERH/L: disable CERH/L

void sau_enable_channel ( unsigned char  channel_num)

Control of the SAU control register CERH/L: enable CERH/L

Referenced by sau_configure_channels().

void sau_lock_channels ( U8  unlock_HSB_cycles,
U8  unlock_key 
)

Lock SAU channels.

Parameters
unlock_HSB_cycles,:The number of HSB cycles the channel keeps unlocked
unlock_key,:The key to lock channels

References data.

Referenced by main().

uint32_t sau_read_channel ( unsigned char  channel_num)

Read the HSB memory value by the SAU channel.

Parameters
channel_num,:The number of the channel to read
Returns
: the read value.

References data.

Referenced by sau_usart_tx_ready().

bool sau_unlock_channel ( U8  unlock_channel_number,
U8  unlock_key 
)

Unlock an SAU channel.

Parameters
unlock_channel_number,:The number of the channel to unlock
unlock_key,:The key to unlock a channel
Returns
Bool true if the config succeeded false if the config failed (the input is not valid).

References data.

Referenced by main().

void sau_write_channel ( uint32_t  data,
unsigned char  channel_num 
)

Write the HSB memory value by the SAU channel.

Parameters
channel_num,:The number of the channel to write.
data,:The data to write

References data.

Referenced by main().