Microchip® Advanced Software Framework

ast.c File Reference

SAM Asynchronous Timer (AST) driver.

Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.

#include "ast.h"
#include "sysclk.h"
#include "sleepmgr.h"
#include "conf_ast.h"

Functions

void AST_ALARM_Handler (void)
 Interrupt handler for AST alarm. More...
 
void ast_clear_interrupt_flag (Ast *ast, ast_interrupt_source_t source)
 Clear an AST interrupt status flag. More...
 
void ast_clear_prescalar (Ast *ast)
 Clear the AST periodic prescaler counter to zero. More...
 
void AST_CLKREADY_Handler (void)
 Interrupt handler for AST periodic. More...
 
uint32_t ast_configure_digital_tuner (Ast *ast, uint32_t input_freq, uint32_t tuned_freq)
 Tune the AST prescaler frequency to the desired frequency. More...
 
void ast_disable (Ast *ast)
 Disable the AST counter and module. More...
 
void ast_disable_digital_tuner (Ast *ast)
 Disable the AST digital tuner. More...
 
void ast_disable_event (Ast *ast, ast_event_source_t source)
 Disable an AST event. More...
 
void ast_disable_interrupt (Ast *ast, ast_interrupt_source_t source)
 Disable an AST interrupt. More...
 
void ast_disable_wakeup (Ast *ast, ast_wakeup_source_t source)
 Disable an AST asynchronous wake-up source. More...
 
void ast_enable (Ast *ast)
 Enable the AST module. More...
 
void ast_enable_counter_clear_on_alarm (Ast *ast, uint8_t alarm_channel)
 Enable the option to clear the counter on an AST alarm. More...
 
void ast_enable_event (Ast *ast, ast_event_source_t source)
 Enable an AST event. More...
 
void ast_enable_interrupt (Ast *ast, ast_interrupt_source_t source)
 Enable an AST interrupt. More...
 
void ast_enable_wakeup (Ast *ast, ast_wakeup_source_t source)
 Enable an AST asynchronous wake-up source. More...
 
void ast_init_digital_tuner (Ast *ast, bool add, uint8_t value, uint8_t exp)
 Initialize the AST digital tuner. More...
 
bool ast_is_enabled (Ast *ast)
 Check the status of the AST module. More...
 
void AST_OVF_Handler (void)
 Interrupt handler for AST periodic. More...
 
void AST_PER_Handler (void)
 Interrupt handler for AST periodic. More...
 
struct ast_calendar ast_read_calendar_value (Ast *ast)
 Get the AST current calendar value. More...
 
void AST_READY_Handler (void)
 Interrupt handler for AST alarm. More...
 
void ast_set_callback (Ast *ast, ast_interrupt_source_t source, ast_callback_t callback, uint8_t irq_line, uint8_t irq_level)
 Set callback for AST interrupts. More...
 
uint32_t ast_set_config (Ast *ast, struct ast_config *ast_conf)
 Initialize and enable the AST module in Calendar Mode or Counter Mode. More...
 
void ast_write_alarm0_value (Ast *ast, uint32_t alarm_value)
 Set the AST alarm0 value. More...
 
void ast_write_calendar_value (Ast *ast, struct ast_calendar calendar)
 Set the AST current calendar value. More...
 
void ast_write_counter_value (Ast *ast, uint32_t ast_counter)
 Set the AST current counter value. More...
 
void ast_write_periodic0_value (Ast *ast, uint32_t pir)
 Set the AST periodic0 value. More...
 

Variables

ast_callback_t ast_callback_pointer [AST_INTERRUPT_SOURCE_NUM]
 

void AST_ALARM_Handler ( void  )

Interrupt handler for AST alarm.

References ast_callback_pointer, and AST_INTERRUPT_ALARM.

void AST_CLKREADY_Handler ( void  )

Interrupt handler for AST periodic.

References ast_callback_pointer, and AST_INTERRUPT_CLKREADY.

void AST_OVF_Handler ( void  )

Interrupt handler for AST periodic.

References ast_callback_pointer, and AST_INTERRUPT_OVF.

void AST_PER_Handler ( void  )

Interrupt handler for AST periodic.

References ast_callback_pointer, and AST_INTERRUPT_PER.

void AST_READY_Handler ( void  )

Interrupt handler for AST alarm.

References ast_callback_pointer, and AST_INTERRUPT_READY.

ast_callback_t ast_callback_pointer[AST_INTERRUPT_SOURCE_NUM]