init commit of examples
This commit is contained in:
parent
a74d1a099d
commit
5b57fb9584
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "Arduino-FOC"]
|
||||||
|
path = Arduino-FOC
|
||||||
|
url = https://github.com/simplefoc/Arduino-FOC.git
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit a4f99990d7a120a2b0d3dfaaca9576b4f0d5656b
|
|
@ -375,8 +375,7 @@
|
||||||
<armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
|
<armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
|
||||||
<armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
|
<armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
|
||||||
<armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
|
<armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
|
||||||
<armgcc.compiler.warnings.Pedantic>True</armgcc.compiler.warnings.Pedantic>
|
<armgcc.compiler.miscellaneous.OtherFlags>-std=gnu99 -fsingle-precision-constant -Wdouble-promotion -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mfp16-format=ieee</armgcc.compiler.miscellaneous.OtherFlags>
|
||||||
<armgcc.compiler.miscellaneous.OtherFlags>-std=gnu99 -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mfp16-format=ieee</armgcc.compiler.miscellaneous.OtherFlags>
|
|
||||||
<armgcc.linker.libraries.Libraries>
|
<armgcc.linker.libraries.Libraries>
|
||||||
<ListValues>
|
<ListValues>
|
||||||
<Value>libm</Value>
|
<Value>libm</Value>
|
||||||
|
|
|
@ -192,15 +192,15 @@ void BLDC_runPosCntl(BLDCMotor_t *motor, int16_t posfbk, int16_t posRef);
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// Functions used with function pointers
|
// Functions used with function pointers
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
inline uint8_t readM1Hall(void);
|
uint8_t readM1Hall(void);
|
||||||
inline uint8_t readM2Hall(void);
|
uint8_t readM2Hall(void);
|
||||||
inline uint8_t readM3Hall(void);
|
uint8_t readM3Hall(void);
|
||||||
void DisableM1GateDrivers(BLDCMotor_t *motor);
|
void DisableM1GateDrivers(BLDCMotor_t *motor);
|
||||||
void DisableM2GateDrivers(BLDCMotor_t *motor);
|
void DisableM2GateDrivers(BLDCMotor_t *motor);
|
||||||
void DisableM3GateDrivers(BLDCMotor_t *motor);
|
void DisableM3GateDrivers(BLDCMotor_t *motor);
|
||||||
inline void SetM1DutyCycle(const uint16_t duty);
|
void SetM1DutyCycle(const uint16_t duty);
|
||||||
inline void SetM2DutyCycle(const uint16_t duty);
|
void SetM2DutyCycle(const uint16_t duty);
|
||||||
inline void SetM3DutyCycle(const uint16_t duty);
|
void SetM3DutyCycle(const uint16_t duty);
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// all controller objects, variables and helpers:
|
// all controller objects, variables and helpers:
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
//while(1);
|
//while(1);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
inline void configure_tcc_pwm(void)
|
inline static void configure_tcc_pwm(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* TCC0 */
|
/* TCC0 */
|
||||||
|
@ -115,7 +115,7 @@ inline void configure_TC_CCL_SPEED(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void adc_init_dma(void)
|
inline static void adc_init_dma(void)
|
||||||
{
|
{
|
||||||
adc_sram_dmac_init();
|
adc_sram_dmac_init();
|
||||||
adc_dmac_sequence_init();
|
adc_dmac_sequence_init();
|
||||||
|
|
|
@ -24,7 +24,7 @@ void update_telemetry(void)
|
||||||
{
|
{
|
||||||
inline int16_t convert_to_mA(volatile float32_t current_PU)
|
inline int16_t convert_to_mA(volatile float32_t current_PU)
|
||||||
{
|
{
|
||||||
return (int16_t)(current_PU*1000);
|
return (int16_t)(current_PU*1000.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
*state = applicationStatus.currentstate;
|
*state = applicationStatus.currentstate;
|
||||||
|
@ -48,7 +48,7 @@ void update_setpoints(void)
|
||||||
{
|
{
|
||||||
inline float32_t convert_int_to_PU(volatile int16_t input)
|
inline float32_t convert_int_to_PU(volatile int16_t input)
|
||||||
{
|
{
|
||||||
return ((float32_t)input/1000.0f);
|
return ((float32_t)(input/1000.0f));
|
||||||
}
|
}
|
||||||
//Motor1.des_mode = 0;
|
//Motor1.des_mode = 0;
|
||||||
//Motor1.set = 0;
|
//Motor1.set = 0;
|
||||||
|
|
|
@ -31,49 +31,49 @@ enum dma_transfer_descriptor_type {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// Register Addresses
|
// Register Addresses
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
#define read_var_num 32 //to change to 16bits need to change ecat spi lenght.
|
#define read_var_num 32U //to change to 16bits need to change ecat spi lenght.
|
||||||
#define write_var_num 32 //max 20
|
#define write_var_num 32U //max 20
|
||||||
// #define read_var_num 2 //to change to 16bits need to change ecat spi lenght.
|
// #define read_var_num 2 //to change to 16bits need to change ecat spi lenght.
|
||||||
// #define write_var_num 2 //max 20
|
// #define write_var_num 2 //max 20
|
||||||
|
|
||||||
#define ram_wr_start 0
|
#define ram_wr_start 0U
|
||||||
#define ram_rd_start write_var_num //write_var_num
|
#define ram_rd_start write_var_num //write_var_num
|
||||||
#define ram_real_wr_start ram_rd_start + read_var_num
|
#define ram_real_wr_start ram_rd_start + read_var_num
|
||||||
|
|
||||||
#define SPI_READ 0x03
|
#define SPI_READ 0x03U
|
||||||
#define SPI_WRITE 0x02
|
#define SPI_WRITE 0x02U
|
||||||
#define SPI_INC 0x40
|
#define SPI_INC 0x40U
|
||||||
#define SPI_DEC 0x80
|
#define SPI_DEC 0x80U
|
||||||
#define TEST_VAL 0x87654321
|
#define TEST_VAL 0x87654321U
|
||||||
#define CSR_BUSY 0x80000000
|
#define CSR_BUSY 0x80000000U
|
||||||
#define ADDR_BYTES 2
|
#define ADDR_BYTES 2
|
||||||
#define CSR_READ 1<<30
|
#define CSR_READ 1<<30
|
||||||
#define CSR_WRITE 0<<30
|
#define CSR_WRITE 0<<30
|
||||||
#define CSR_SIZE 4<<16
|
#define CSR_SIZE 4<<16
|
||||||
#define CSR_HW_RD 1<<27
|
#define CSR_HW_RD 1<<27
|
||||||
|
|
||||||
#define ECAT_PRAM_RD_DATA 0x0000
|
#define ECAT_PRAM_RD_DATA 0x0000U
|
||||||
#define ECAT_PRAM_WR_DATA 0x2000
|
#define ECAT_PRAM_WR_DATA 0x2000U
|
||||||
#define ID_REV 0x5000
|
#define ID_REV 0x5000U
|
||||||
#define IRQ_CFG 0x5400
|
#define IRQ_CFG 0x5400U
|
||||||
#define INT_STS 0x5800
|
#define INT_STS 0x5800U
|
||||||
#define INT_EN 0x5C00
|
#define INT_EN 0x5C00U
|
||||||
#define BYTE_TEST 0x6400
|
#define BYTE_TEST 0x6400U
|
||||||
#define HW_CFG 0x7400
|
#define HW_CFG 0x7400U
|
||||||
#define PMT_CTRL 0x8400
|
#define PMT_CTRL 0x8400U
|
||||||
#define GPT_CFG 0x8C00
|
#define GPT_CFG 0x8C00U
|
||||||
#define GPT_CNT 0x9000
|
#define GPT_CNT 0x9000U
|
||||||
#define FREE_RUN 0x9C00
|
#define FREE_RUN 0x9C00U
|
||||||
#define RESET_CTL 0xF801
|
#define RESET_CTL 0xF801U
|
||||||
#define ECAT_CSR_DATA 0x0003
|
#define ECAT_CSR_DATA 0x0003U
|
||||||
#define ECAT_CSR_CMD 0x0403
|
#define ECAT_CSR_CMD 0x0403U
|
||||||
#define ECAT_PRAM_RD_ADDR_LEN 0x0803
|
#define ECAT_PRAM_RD_ADDR_LEN 0x0803U
|
||||||
#define ECAT_PRAM_RD_CMD 0x0C03
|
#define ECAT_PRAM_RD_CMD 0x0C03U
|
||||||
#define ECAT_PRAM_WR_ADDR_LEN 0x1003
|
#define ECAT_PRAM_WR_ADDR_LEN 0x1003U
|
||||||
#define ECAT_PRAM_WR_CMD 0x1403
|
#define ECAT_PRAM_WR_CMD 0x1403U
|
||||||
|
|
||||||
#define PDRAM_RD_ADDRESS 0x1100
|
#define PDRAM_RD_ADDRESS 0x1100U
|
||||||
#define PDRAM_WR_ADDRESS 0x1800
|
#define PDRAM_WR_ADDRESS 0x1800U
|
||||||
|
|
||||||
#define PDRAM_RD_LENGTH 2*read_var_num
|
#define PDRAM_RD_LENGTH 2*read_var_num
|
||||||
#define PDRAM_WR_LENGTH 2*write_var_num
|
#define PDRAM_WR_LENGTH 2*write_var_num
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
37,0,2,1,0,9,12,150,0,12,180,0,5,0,1,0,176,4,82,3,0,0,64,65,1,1,1,1,2,2,2,3,3,1,1,63,231
|
|
@ -0,0 +1 @@
|
||||||
|
37,0,3,1,0,9,12,150,0,16,60,0,1,0,1,0,176,4,82,3,0,0,64,65,1,1,1,1,2,2,2,3,3,1,1,180,115
|
|
@ -0,0 +1 @@
|
||||||
|
14,0,1,1,3,9,12,136,19,16,1,1,129,46
|
|
@ -0,0 +1 @@
|
||||||
|
14,0,1,1,3,9,12,136,19,16,1,1,129,46
|
|
@ -0,0 +1 @@
|
||||||
|
39,0,2,1,20,5,20,5,196,9,6,9,112,23,0,0,128,61,205,204,76,63,0,0,224,64,1,1,1,1,1,1,1,1,1,1,1,134,84
|
|
@ -0,0 +1 @@
|
||||||
|
116,6,1,1,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,51,179,62,205,204,12,63,205,204,12,63,51,51,51,63,51,51,51,63,205,204,76,63,1,0,9,4,2,23,183,209,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,183,209,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,183,209,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,189,55,134,53,189,55,134,53,189,55,134,53,0,0,0,0,0,0,16,66,232,3,5,0,45,0,132,3,176,4,150,0,8,150,0,13,1,1,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,51,179,62,205,204,12,63,205,204,12,63,51,51,51,63,51,51,51,63,205,204,76,62,1,6,4,1,0,5,0,65,1,64,1,36,0,120,0,4,1,20,20,2,2,0,4,0,0,128,63,205,204,204,61,154,153,153,63,205,204,204,62,205,204,204,61,1,0,20,0,16,4,120,0,8,0,0,5,154,153,25,63,154,153,25,63,80,0,9,0,30,0,232,3,80,0,65,0,4,0,4,0,0,128,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,181,254,22,55,181,254,22,55,181,254,22,55,139,222,169,56,0,0,224,64,13,1,1,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,205,204,204,61,1,9,9,3,19,50,163,4,205,12,100,40,4,13,0,1,154,153,153,62,154,153,153,62,205,204,204,62,154,153,25,63,154,153,153,62,0,0,128,62,154,153,153,62,236,81,184,62,205,204,76,63,205,204,76,63,205,204,76,63,205,204,76,63,205,204,76,62,205,204,76,62,205,204,76,62,205,204,76,62,0,194,184,178,62,53,250,142,60,10,0,10,0,0,2,0,10,0,80,119,86,61,13,0,0,128,62,143,194,245,60,10,215,163,60,100,128,52,45,70,1,10,0,80,0,0,0,192,63,0,0,0,64,9,2,0,0,200,65,0,0,128,66,0,0,128,65,0,0,192,63,205,204,76,61,194,184,178,61,50,37,59,24,71,0,0,160,64,154,153,25,63,80,119,86,61,0,1,205,204,76,63,0,0,96,64,0,0,32,64,205,204,204,61,4,143,194,245,60,2,1,2,3,4,1,10,176,4,88,2,10,215,35,60,10,0,10,0,0,0,250,67,0,0,122,68,0,0,160,63,0,0,72,66,0,0,128,63,0,0,128,62,205,204,204,61,0,0,32,66,0,0,128,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,62,0,36,116,73,0,0,0,0,0,0,0,0,0,0,0,0,0,36,116,73,0,0,0,0,0,0,0,0,0,0,0,0,0,36,116,73,0,0,192,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,0,0,128,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,10,215,35,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,215,35,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,215,35,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,183,209,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,183,209,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,183,209,56,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,197,39,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,197,39,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,197,39,55,0,36,116,73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,116,73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,116,73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,4,3,0,0,0,0,0,0,10,3,4,25,64,18,24,0,64,114,8,0,13,226,109
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,152 @@
|
||||||
|
#ifndef __BSXLIBRARYCALIBCONSTANTS_H__
|
||||||
|
#define __BSXLIBRARYCALIBCONSTANTS_H__
|
||||||
|
/*!
|
||||||
|
* @section LICENCE
|
||||||
|
* $license$
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* (C) Copyright 2011 - 2015 Bosch Sensortec GmbH All Rights Reserved
|
||||||
|
*------------------------------------------------------------------------------
|
||||||
|
* Disclaimer
|
||||||
|
*
|
||||||
|
* Common: Bosch Sensortec products are developed for the consumer goods
|
||||||
|
* industry. They may only be used within the parameters of the respective valid
|
||||||
|
* product data sheet. Bosch Sensortec products are provided with the express
|
||||||
|
* understanding that there is no warranty of fitness for a particular purpose.
|
||||||
|
* They are not fit for use in life-sustaining, safety or security sensitive
|
||||||
|
* systems or any system or device that may lead to bodily harm or property
|
||||||
|
* damage if the system or device malfunctions. In addition, Bosch Sensortec
|
||||||
|
* products are not fit for use in products which interact with motor vehicle
|
||||||
|
* systems. The resale and/or use of products are at the purchaser's own risk
|
||||||
|
* and his own responsibility. The examination of fitness for the intended use
|
||||||
|
* is the sole responsibility of the Purchaser.
|
||||||
|
*
|
||||||
|
* The purchaser shall indemnify Bosch Sensortec from all third party claims,
|
||||||
|
* including any claims for incidental, or consequential damages, arising from
|
||||||
|
* any product use not covered by the parameters of the respective valid product
|
||||||
|
* data sheet or not approved by Bosch Sensortec and reimburse Bosch Sensortec
|
||||||
|
* for all costs in connection with such claims.
|
||||||
|
*
|
||||||
|
* The purchaser must monitor the market for the purchased products,
|
||||||
|
* particularly with regard to product safety and inform Bosch Sensortec without
|
||||||
|
* delay of all security relevant incidents.
|
||||||
|
*
|
||||||
|
* Engineering Samples are marked with an asterisk (*) or (e). Samples may vary
|
||||||
|
* from the valid technical specifications of the product series. They are
|
||||||
|
* therefore not intended or fit for resale to third parties or for use in end
|
||||||
|
* products. Their sole purpose is internal client testing. The testing of an
|
||||||
|
* engineering sample may in no way replace the testing of a product series.
|
||||||
|
* Bosch Sensortec assumes no liability for the use of engineering samples. By
|
||||||
|
* accepting the engineering samples, the Purchaser agrees to indemnify Bosch
|
||||||
|
* Sensortec from all claims arising from the use of engineering samples.
|
||||||
|
*
|
||||||
|
* Special: This software module (hereinafter called "Software") and any
|
||||||
|
* information on application-sheets (hereinafter called "Information") is
|
||||||
|
* provided free of charge for the sole purpose to support your application
|
||||||
|
* work. The Software and Information is subject to the following terms and
|
||||||
|
* conditions:
|
||||||
|
*
|
||||||
|
* The Software is specifically designed for the exclusive use for Bosch
|
||||||
|
* Sensortec products by personnel who have special experience and training. Do
|
||||||
|
* not use this Software if you do not have the proper experience or training.
|
||||||
|
*
|
||||||
|
* This Software package is provided `` as is `` and without any expressed or
|
||||||
|
* implied warranties, including without limitation, the implied warranties of
|
||||||
|
* merchantability and fitness for a particular purpose.
|
||||||
|
*
|
||||||
|
* Bosch Sensortec and their representatives and agents deny any liability for
|
||||||
|
* the functional impairment of this Software in terms of fitness, performance
|
||||||
|
* and safety. Bosch Sensortec and their representatives and agents shall not be
|
||||||
|
* liable for any direct or indirect damages or injury, except as otherwise
|
||||||
|
* stipulated in mandatory applicable law.
|
||||||
|
*
|
||||||
|
* The Information provided is believed to be accurate and reliable. Bosch
|
||||||
|
* Sensortec assumes no responsibility for the consequences of use of such
|
||||||
|
* Information nor for any infringement of patents or other rights of third
|
||||||
|
* parties which may result from its use.
|
||||||
|
*
|
||||||
|
|
||||||
|
* @file bsxlibrarycalibconstants.h
|
||||||
|
* @date 2013/02/12 created
|
||||||
|
*
|
||||||
|
* @brief
|
||||||
|
* This file provides constants definition for calibration modules
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/************************************************************************************************************/
|
||||||
|
/* INCLUDES */
|
||||||
|
/************************************************************************************************************/
|
||||||
|
|
||||||
|
#include "BsxLibraryDataTypes.h"
|
||||||
|
|
||||||
|
/************************************************************************************************************/
|
||||||
|
/* CONSTANT DEFINITIONS */
|
||||||
|
/************************************************************************************************************/
|
||||||
|
|
||||||
|
/**\name Calibration modes */
|
||||||
|
|
||||||
|
#define BSX_CALIB_SLEEP (0U) /**< sleep mode for calibration */
|
||||||
|
#define BSX_CALIB_MONITORING (1U) /**< Calibration monitoring is active*/
|
||||||
|
#define BSX_CALIB_MODEOFFSETACTIVE (2U) /**< Calibration offsets estimation is active */
|
||||||
|
|
||||||
|
/**\name Data correction modes */
|
||||||
|
|
||||||
|
#define BSX_DATACORRECTION_SLEEP (0U) /**< 0 => No Data correction */
|
||||||
|
#define BSX_DATACORRECTION_OFFSET (1U) /**< 1 = Only offset correction is included */
|
||||||
|
#define BSX_DATACORRECTION_SENSDOFFSET (2U) /**< 2 = offset + diagonal sensitivity correction are included*/
|
||||||
|
#define BSX_DATACORRECTION_SENSFOFFSET (3U) /**< 3 = offset + full sensitivity correction are used for data correction */
|
||||||
|
|
||||||
|
/**\name Calibration Source types */
|
||||||
|
|
||||||
|
#define BSX_CALIBSOURCE_NONE (0U) /**< no Calibration source*/
|
||||||
|
#define BSX_CALIBSOURCE_CLASSIC (1U) /**< Calibration source is classical*/
|
||||||
|
#define BSX_CALIBSOURCE_FAST (2U) /**< Calibration source is FMC*/
|
||||||
|
|
||||||
|
/**\name Gyro calibration modes */
|
||||||
|
|
||||||
|
#define BSX_GYROCALIB_SLEEP (0U) /**< 0= Gyroscope Calibration is not Active */
|
||||||
|
#define BSX_GYROCALIB_GYRODATA (1U) /**< 1= Gyroscope Calibration based on (Gyroscope) data only */
|
||||||
|
#define BSX_GYROCALIB_GYROACC (2U) /**< 2= Gyroscope Calibration based on (Gyroscope+Accelerometer) Data */
|
||||||
|
#define BSX_GYROCALIB_GYROACCMAG (3U) /**< 3= Gyroscope Calibration based on (Gyroscope+Accelerometer+Magnetometer) Data */
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,311 @@
|
||||||
|
#ifndef __BSXLIBRARYCONSTANTS_H__
|
||||||
|
#define __BSXLIBRARYCONSTANTS_H__
|
||||||
|
/*!
|
||||||
|
* @section LICENCE
|
||||||
|
* $license$
|
||||||
|
*
|
||||||
|
* (C) Copyright 2011 - 2015 Bosch Sensortec GmbH All Rights Reserved
|
||||||
|
*------------------------------------------------------------------------------
|
||||||
|
* Disclaimer
|
||||||
|
*
|
||||||
|
* Common: Bosch Sensortec products are developed for the consumer goods
|
||||||
|
* industry. They may only be used within the parameters of the respective valid
|
||||||
|
* product data sheet. Bosch Sensortec products are provided with the express
|
||||||
|
* understanding that there is no warranty of fitness for a particular purpose.
|
||||||
|
* They are not fit for use in life-sustaining, safety or security sensitive
|
||||||
|
* systems or any system or device that may lead to bodily harm or property
|
||||||
|
* damage if the system or device malfunctions. In addition, Bosch Sensortec
|
||||||
|
* products are not fit for use in products which interact with motor vehicle
|
||||||
|
* systems. The resale and/or use of products are at the purchaser's own risk
|
||||||
|
* and his own responsibility. The examination of fitness for the intended use
|
||||||
|
* is the sole responsibility of the Purchaser.
|
||||||
|
*
|
||||||
|
* The purchaser shall indemnify Bosch Sensortec from all third party claims,
|
||||||
|
* including any claims for incidental, or consequential damages, arising from
|
||||||
|
* any product use not covered by the parameters of the respective valid product
|
||||||
|
* data sheet or not approved by Bosch Sensortec and reimburse Bosch Sensortec
|
||||||
|
* for all costs in connection with such claims.
|
||||||
|
*
|
||||||
|
* The purchaser must monitor the market for the purchased products,
|
||||||
|
* particularly with regard to product safety and inform Bosch Sensortec without
|
||||||
|
* delay of all security relevant incidents.
|
||||||
|
*
|
||||||
|
* Engineering Samples are marked with an asterisk (*) or (e). Samples may vary
|
||||||
|
* from the valid technical specifications of the product series. They are
|
||||||
|
* therefore not intended or fit for resale to third parties or for use in end
|
||||||
|
* products. Their sole purpose is internal client testing. The testing of an
|
||||||
|
* engineering sample may in no way replace the testing of a product series.
|
||||||
|
* Bosch Sensortec assumes no liability for the use of engineering samples. By
|
||||||
|
* accepting the engineering samples, the Purchaser agrees to indemnify Bosch
|
||||||
|
* Sensortec from all claims arising from the use of engineering samples.
|
||||||
|
*
|
||||||
|
* Special: This software module (hereinafter called "Software") and any
|
||||||
|
* information on application-sheets (hereinafter called "Information") is
|
||||||
|
* provided free of charge for the sole purpose to support your application
|
||||||
|
* work. The Software and Information is subject to the following terms and
|
||||||
|
* conditions:
|
||||||
|
*
|
||||||
|
* The Software is specifically designed for the exclusive use for Bosch
|
||||||
|
* Sensortec products by personnel who have special experience and training. Do
|
||||||
|
* not use this Software if you do not have the proper experience or training.
|
||||||
|
*
|
||||||
|
* This Software package is provided `` as is `` and without any expressed or
|
||||||
|
* implied warranties, including without limitation, the implied warranties of
|
||||||
|
* merchantability and fitness for a particular purpose.
|
||||||
|
*
|
||||||
|
* Bosch Sensortec and their representatives and agents deny any liability for
|
||||||
|
* the functional impairment of this Software in terms of fitness, performance
|
||||||
|
* and safety. Bosch Sensortec and their representatives and agents shall not be
|
||||||
|
* liable for any direct or indirect damages or injury, except as otherwise
|
||||||
|
* stipulated in mandatory applicable law.
|
||||||
|
*
|
||||||
|
* The Information provided is believed to be accurate and reliable. Bosch
|
||||||
|
* Sensortec assumes no responsibility for the consequences of use of such
|
||||||
|
* Information nor for any infringement of patents or other rights of third
|
||||||
|
* parties which may result from its use.
|
||||||
|
*
|
||||||
|
|
||||||
|
* @file bsxlibraryconstants.h
|
||||||
|
* @date 2013/02/12 created
|
||||||
|
*
|
||||||
|
* @brief
|
||||||
|
* This file provides constants definition used by library
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/************************************************************************************************************/
|
||||||
|
/* INCLUDES */
|
||||||
|
/************************************************************************************************************/
|
||||||
|
|
||||||
|
#include "BsxLibraryDataTypes.h"
|
||||||
|
|
||||||
|
/************************************************************************************************************/
|
||||||
|
/* CONSTANT DEFINITIONS */
|
||||||
|
/************************************************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
/* gravity on earth = 9.80665 m/s2 */
|
||||||
|
#define BSX_GRAVITY (9.80665f) /**< gravity equivalent in ms^2*/
|
||||||
|
|
||||||
|
/**\name Conversion factors */
|
||||||
|
#define BSX_CONVFACTOR_RES16BIT_UNITS2LSB (32767.0f) /**< conversion factor res16bit units to lsb */
|
||||||
|
#define BSX_CONVFACTOR_RES16BIT_LSB2UNITS (3.0519e-005f) /**< 1/32767 */
|
||||||
|
#define BSX_CONVFACTOR_RES15BIT_UNITS2LSB (16384.0f) /**<conversion factor res15bit units to lsb */
|
||||||
|
#define BSX_CONVFACTOR_INV_RES15BIT_UNITS2LSB (6.10351563e-005f) /**< 1/16384*/
|
||||||
|
#define BSX_CONVFACTOR_RES15BIT_LSB2UNITS (6.1035e-005f) /**< calculated as 1/16384 */
|
||||||
|
#define PI_OVER_TWO (1.570796326794897f) /**< pi/2*/
|
||||||
|
#define PI_TIMES_TWO (6.283185307179586f) /**< 2*pi*/
|
||||||
|
#define SQRT_TWO_OVER_TWO (0.7071067811865476f) /**< 0.5*sqrt(2)*/
|
||||||
|
|
||||||
|
#define UNIT_SCALING_ACC_INTERNAL2MPS2 (0.00980665f) /**< milli gravity -> metre per second squared */
|
||||||
|
#define UNIT_SCALING_ACC_MPS22INTERNAL (1.019835806435164e+02f) /**< calculated as 1/0.00980665f */
|
||||||
|
#define UNIT_SCALING_ACC_INTERNAL2G (1e-3f) /**< internal unit [mg] to [g]*/
|
||||||
|
#define UNIT_SCALING_ACC_G2INTERNAL (1000U) /**< [g] to internal unit [mg]*/
|
||||||
|
#define UNIT_SCALING_GYRO_INTERNAL2DEGPS (6.1e-2f) /**< internal unit [0.061 deg/s] to [deg/s]; note: 2000/2^15 = 0.061 ;1/BSX_CONVFACTOR_DPS2LSB */
|
||||||
|
#define UNIT_SCALING_GYRO_DEGPS2INTERNAL (16.384f) /**< [deg/s] to internal unit [0.061 deg/s]; note: 2^15/2000 = 16.384*/
|
||||||
|
#define UNIT_SCALING_GYRO_INTERNAL2RADPS (0.001065264436031695f) /**< internal unit [0.0011 rad/s] to [deg/s]; note: 2000/2^15*pi/180 = 0.0011*/
|
||||||
|
#define UNIT_SCALING_GYRO_RADPS2INTERNAL (938.7341f) /**< calculated as BSX_CONVFACTOR_DPS2LSB*180/pi */
|
||||||
|
#define UNIT_SCALING_MAG_INTERNAL2UTESLA (0.1f) /**< internal unit [0.1 uT] to [uT]*/
|
||||||
|
#define UNIT_SCALING_MAG_UTESLA2INTERNAL (10U) /**< [uT] to internal unit [0.1 uT]*/
|
||||||
|
/**\name Supported Data Rate */
|
||||||
|
#define BSX_DATARATE_1HZ (0U) /**< Library constant for 1hz datarate*/
|
||||||
|
#define BSX_DATARATE_5HZ (1U) /**< Library constant for 5Hz datarate*/
|
||||||
|
#define BSX_DATARATE_6_25HZ (2U) /**< Library constant for 6_25Hz datarate*/
|
||||||
|
#define BSX_DATARATE_10HZ (3U) /**< Library constant for 10Hz datarate*/
|
||||||
|
#define BSX_DATARATE_12_50HZ (4U) /**< Library constant for 12_50hz datarate*/
|
||||||
|
#define BSX_DATARATE_20HZ (5U) /**< Library constant for 20hz datarate*/
|
||||||
|
#define BSX_DATARATE_25HZ (6U) /**< Library constant for 25hz datarate*/
|
||||||
|
#define BSX_DATARATE_40HZ (7U) /**< Library constant for 40hz datarate*/
|
||||||
|
#define BSX_DATARATE_50HZ (8U) /**< Library constant for 50hz datarate*/
|
||||||
|
#define BSX_DATARATE_100HZ (9U) /**< Library constant for 100hz datarate*/
|
||||||
|
#define BSX_DATARATE_125HZ (10U) /**< Library constant for 125hz datarate*/
|
||||||
|
#define BSX_DATARATE_200HZ (11U) /**< Library constant for 200hz datarate*/
|
||||||
|
#define BSX_DATARATE_400HZ (12U) /**< Library constant for 400hz datarate*/
|
||||||
|
#define DATARATE_INVALIDUPPER (13U) /**< Upper boundary on allowed values*/
|
||||||
|
|
||||||
|
/**\name Operational modes */
|
||||||
|
#define BSX_OPMODE_SLEEP (0U) /**< Operation mode -> sleep(0)*/
|
||||||
|
#define BSX_OPMODE_REGULAR (1U) /**< Operation mode -> Regular(1)*/
|
||||||
|
#define BSX_OPMODE_FIFO (2U) /**< Operation mode -> fifo(2)*/
|
||||||
|
|
||||||
|
/**\name Geomagnetic rotation modes */
|
||||||
|
#define BSX_NDOFGRV_SLEEP (0U) /**< Geomagnetic rotation mode sleep*/
|
||||||
|
#define BSX_NDOFGRV_ACTIVE (1U) /**< Geomagnetic rotation mode active*/
|
||||||
|
|
||||||
|
/**\name Filter modes (0 = bypass; 1 = forward; 2 = backward;) */
|
||||||
|
#define BSX_FILTERMODE_BYPASS (0U) /**< Filter mode -> BYPASS */
|
||||||
|
#define BSX_FILTERMODE_FORWARD (1U) /**< Filter Mode -> FORWARD */
|
||||||
|
#define BSX_FILTERMODE_BACKWARD (2U) /**< Filter mode -> BACKWARD */
|
||||||
|
|
||||||
|
|
||||||
|
/**\name Measurement range of the accelerometer */
|
||||||
|
#define BSX_ACCRANGE_2G (0U) /**< Accel range -> 2g*/
|
||||||
|
#define BSX_ACCRANGE_4G (1U) /**< Accel range -> 4g*/
|
||||||
|
#define BSX_ACCRANGE_8G (2U) /**< Accel range -> 8g*/
|
||||||
|
#define BSX_ACCRANGE_16G (3U) /**< Accel range -> 16g*/
|
||||||
|
|
||||||
|
/**\name Measurement range of the Gyroscope */
|
||||||
|
#define BSX_GYRORANGE_2048DPS (0U) /**< Measurement Range -> 2048 Degrees/sec */
|
||||||
|
#define BSX_GYRORANGE_2000DPS (1U) /**< Measurement Range -> 2000 Degrees/sec */
|
||||||
|
#define BSX_GYRORANGE_1000DPS (2U) /**< Measurement Range -> 1000 Degrees/sec */
|
||||||
|
#define BSX_GYRORANGE_500DPS (3U) /**< Measurement Range -> 500 Degrees/sec */
|
||||||
|
#define BSX_GYRORANGE_250DPS (4U) /**< Measurement Range -> 250 Degrees/sec */
|
||||||
|
#define BSX_GYRORANGE_MAX (4U) /**< Maximum gyro measurement range */
|
||||||
|
|
||||||
|
/** \name Sensor Accuracy Information */
|
||||||
|
#define BSX_SENSOR_STATUS_UNRELIABLE (0U) /**< Sensor accuracy : unreliable */
|
||||||
|
#define BSX_SENSOR_STATUS_ACCURACY_LOW (1U) /**< Sensor accuracy status:low*/
|
||||||
|
#define BSX_SENSOR_STATUS_ACCURACY_MEDIUM (2U) /**< Sensor accuracy status: medium*/
|
||||||
|
#define BSX_SENSOR_STATUS_ACCURACY_HIGH (3U) /**< Sensor accuracy status: high*/
|
||||||
|
|
||||||
|
/**\name Constants representing a sensor */
|
||||||
|
#define BSX_TYPE_ACCELEROMETER (1) /**< Represents Accelerometer sensor */
|
||||||
|
#define BSX_TYPE_AMBIENT_TEMPERATURE (13)/**< Represents Ambient Temperature sensor */
|
||||||
|
#define BSX_TYPE_GRAVITY (9)/**< Represents Gravity sensor */
|
||||||
|
#define BSX_TYPE_GYROSCOPE (4)/**< Represents Gyro sensor */
|
||||||
|
#define BSX_TYPE_LIGHT (5)/**< Represents Light sensor */
|
||||||
|
#define BSX_TYPE_LINEAR_ACCELERATION (10)/**< Represents Linear Acceleration sensor */
|
||||||
|
#define BSX_TYPE_MAGNETIC_FIELD (2)/**< Represents Magnetic Field sensor */
|
||||||
|
#define BSX_TYPE_ORIENTATION (3)/**< Represents Orientaion sensor */
|
||||||
|
#define BSX_TYPE_PRESSURE (6)/**< Represents Pressure sensor */
|
||||||
|
#define BSX_TYPE_PROXIMITY (8)/**< Represents Proximity sensor */
|
||||||
|
#define BSX_TYPE_RELATIVE_HUMIDITY (12)/**< Represents Relative Humidity sensor */
|
||||||
|
#define BSX_TYPE_ROTATION_VECTOR (11)/**< Represents RotationVector sensor */
|
||||||
|
#define BSX_TYPE_TEMPERATURE (7)/**< Represents Temperature sensor */
|
||||||
|
|
||||||
|
/**\name Datarate Array in Hz */
|
||||||
|
#define BSX_ARRAY_DATARATE {(1.0f), (5.0f), (6.25f), (10.0f), (12.5f), (20.0f), (25.0f), (40.0f), (50.0f), (100.0f), (125.0f), (200.0f), (400.0f)} /**< Datarate array*/
|
||||||
|
#define BSX_ARRAY_ACCMEASRANGE {(2U), (4U), (8U), (16U)} /**< Accelerometer Measurment Range Array in G */
|
||||||
|
#define BSX_ARRAY_GYROMEASRANGE {(2048), (2000), (1000), (500), (250)} /**< Gyroscope measurement range in dps */
|
||||||
|
#define BSX_ARRAY_FILTERIIRCOEFF {(0.0f), (0.0f), (0.0f), (0.0f), (0.0f), (0.0f), (0.0f), (0.0f), (0.35f), (0.55f), (0.55f), (0.7f), (0.7f)} /**< filtering coefficient : 0 => no filtering*/
|
||||||
|
#define BSX_REF_ARRAY {(1000.0f), (200.0f),(160.0f),(100.0f),(80.0f), (50.0f), (40.0f), (25.0f), (20.0f), (10.0f), (8.0f), (5.0f), (2.5f)} /**< Reference time array in ms */
|
||||||
|
|
||||||
|
/**\name Opmode Shift Defines*/
|
||||||
|
#define BSX_BITSHIFT_ACCOPMODE (0U) /**< Constant used for bitshifting opmode (accel)*/
|
||||||
|
#define BSX_BITSHIFT_MAGOPMODE (2U)/**< Constant used for bitshifting opmode (Mag)*/
|
||||||
|
#define BSX_BITSHIFT_GYROOPMODE (4U)/**< Constant used for bitshifting opmode (Gyro)*/
|
||||||
|
#define BSX_BITSHIFT_COMPASSOPMODE (6U)/**< Constant used for bitshifting opmode (Compass)*/
|
||||||
|
#define BSX_BITSHIFT_M4GOPMODE (8U)/**< Constant used for bitshifting opmode (M4g)*/
|
||||||
|
#define BSX_BITSHIFT_NDOFOPMODE (10U)/**< Constant used for bitshifting opmode (Ndof)*/
|
||||||
|
#define BSX_BITSHIFT_FASTMAGCALIBOPMODE (12U)/**< Constant used for bitshifting opmode (FastMagcalib)*/
|
||||||
|
#define BSX_BITSHIFT_CLASSICALMAGCALIBOPMODE (14U)/**< Constant used for bitshifting opmode (Classical Mag calib)*/
|
||||||
|
#define BSX_BITSHIFT_MAGCALIBSOURCE (16U)/**< Constant used for bitshifting opmode (Mag calib source)*/
|
||||||
|
#define BSX_BITSHIFT_GYROCALIBOPMODE (18U)/**< Constant used for bitshifting opmode (gyro calib)*/
|
||||||
|
#define BSX_BITSHIFT_NDOFGEORVOPMODE (20U)/**< Constant used for bitshifting opmode (Ndof Geo Rv)*/
|
||||||
|
|
||||||
|
|
||||||
|
#define BSX_BITMASKING (0x03U) /**< Hex Constant used for Bit Masking */
|
||||||
|
|
||||||
|
/**\name Working Modes */
|
||||||
|
#define BSX_WORKINGMODE_SLEEP (BSX_U32)((BSX_NDOFGRV_SLEEP<<BSX_BITSHIFT_NDOFGEORVOPMODE)|(BSX_GYROCALIB_SLEEP << BSX_BITSHIFT_GYROCALIBOPMODE)|(BSX_CALIB_SLEEP << BSX_BITSHIFT_MAGCALIBSOURCE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_CLASSICALMAGCALIBOPMODE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_FASTMAGCALIBOPMODE)|(BSX_OPMODE_NDOF_SLEEP<<BSX_BITSHIFT_NDOFOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_M4GOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_COMPASSOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_GYROOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_MAGOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_ACCOPMODE)) /**< working mode => sleep (no sensor is active)*/
|
||||||
|
#define BSX_WORKINGMODE_ACCONLY (BSX_U32)((BSX_NDOFGRV_SLEEP<<BSX_BITSHIFT_NDOFGEORVOPMODE)|(BSX_GYROCALIB_SLEEP << BSX_BITSHIFT_GYROCALIBOPMODE)|(BSX_CALIB_SLEEP << BSX_BITSHIFT_MAGCALIBSOURCE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_CLASSICALMAGCALIBOPMODE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_FASTMAGCALIBOPMODE)|(BSX_OPMODE_NDOF_SLEEP<<BSX_BITSHIFT_NDOFOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_M4GOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_COMPASSOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_GYROOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_MAGOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_ACCOPMODE))/**< Only accelerometer sensor is active and related modules will be processed*/
|
||||||
|
#define BSX_WORKINGMODE_MAGONLY (BSX_U32)((BSX_NDOFGRV_SLEEP<<BSX_BITSHIFT_NDOFGEORVOPMODE)|(BSX_GYROCALIB_SLEEP << BSX_BITSHIFT_GYROCALIBOPMODE)|(BSX_CALIBSOURCE_CLASSIC << BSX_BITSHIFT_MAGCALIBSOURCE)|(BSX_CALIB_MODEOFFSETACTIVE<<BSX_BITSHIFT_CLASSICALMAGCALIBOPMODE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_FASTMAGCALIBOPMODE)|(BSX_OPMODE_NDOF_SLEEP<<BSX_BITSHIFT_NDOFOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_M4GOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_COMPASSOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_GYROOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_MAGOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_ACCOPMODE))/**< Only Magnetometer sensor is active and related modules will be processed*/
|
||||||
|
#define BSX_WORKINGMODE_ACCMAG (BSX_U32)((BSX_NDOFGRV_SLEEP<<BSX_BITSHIFT_NDOFGEORVOPMODE)|(BSX_GYROCALIB_SLEEP << BSX_BITSHIFT_GYROCALIBOPMODE)|(BSX_CALIBSOURCE_CLASSIC << BSX_BITSHIFT_MAGCALIBSOURCE)|(BSX_CALIB_MODEOFFSETACTIVE<<BSX_BITSHIFT_CLASSICALMAGCALIBOPMODE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_FASTMAGCALIBOPMODE)|(BSX_OPMODE_NDOF_SLEEP<<BSX_BITSHIFT_NDOFOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_M4GOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_COMPASSOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_GYROOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_MAGOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_ACCOPMODE))/**< Only Accelerometer and Magnetometer sensors are active and related modules will be processed*/
|
||||||
|
#define BSX_WORKINGMODE_ACCGYRO (BSX_U32)((BSX_NDOFGRV_SLEEP<<BSX_BITSHIFT_NDOFGEORVOPMODE)|(BSX_GYROCALIB_GYROACC << BSX_BITSHIFT_GYROCALIBOPMODE)|(BSX_CALIB_SLEEP << BSX_BITSHIFT_MAGCALIBSOURCE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_CLASSICALMAGCALIBOPMODE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_FASTMAGCALIBOPMODE)|(BSX_OPMODE_NDOF_SLEEP<<BSX_BITSHIFT_NDOFOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_M4GOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_COMPASSOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_GYROOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_MAGOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_ACCOPMODE))/**<Accelerometer and Gyroscope sensors will be active and related modules will be processed*/
|
||||||
|
#define BSX_WORKINGMODE_IMUPLUS (BSX_U32)((BSX_NDOFGRV_SLEEP<<BSX_BITSHIFT_NDOFGEORVOPMODE)|(BSX_GYROCALIB_GYROACC << BSX_BITSHIFT_GYROCALIBOPMODE)|(BSX_CALIB_SLEEP << BSX_BITSHIFT_MAGCALIBSOURCE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_CLASSICALMAGCALIBOPMODE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_FASTMAGCALIBOPMODE)|(BSX_OPMODE_NDOFIMU<<BSX_BITSHIFT_NDOFOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_M4GOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_COMPASSOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_GYROOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_MAGOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_ACCOPMODE))/**< IMU mode (Accelerometer + Gyroscope) are active and related modules will be processed*/
|
||||||
|
#define BSX_WORKINGMODE_GYROONLY (BSX_U32)((BSX_NDOFGRV_SLEEP<<BSX_BITSHIFT_NDOFGEORVOPMODE)|(BSX_GYROCALIB_GYRODATA << BSX_BITSHIFT_GYROCALIBOPMODE)|(BSX_CALIB_SLEEP << BSX_BITSHIFT_MAGCALIBSOURCE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_CLASSICALMAGCALIBOPMODE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_FASTMAGCALIBOPMODE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_NDOFOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_M4GOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_COMPASSOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_GYROOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_MAGOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_ACCOPMODE))/**< Only Gyroscope sensor is active and related modules will be processed*/
|
||||||
|
#define BSX_WORKINGMODE_MAGGYRO (BSX_U32)((BSX_NDOFGRV_SLEEP<<BSX_BITSHIFT_NDOFGEORVOPMODE)|(BSX_GYROCALIB_GYRODATA << BSX_BITSHIFT_GYROCALIBOPMODE)|(BSX_CALIBSOURCE_FAST << BSX_BITSHIFT_MAGCALIBSOURCE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_CLASSICALMAGCALIBOPMODE)|(BSX_CALIB_MODEOFFSETACTIVE<<BSX_BITSHIFT_FASTMAGCALIBOPMODE)|(BSX_OPMODE_NDOF_SLEEP<<BSX_BITSHIFT_NDOFOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_M4GOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_COMPASSOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_GYROOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_MAGOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_ACCOPMODE))/**< Mag and Gyro are active and related modules will be processed*/
|
||||||
|
#define BSX_WORKINGMODE_AMG (BSX_U32)((BSX_NDOFGRV_SLEEP<<BSX_BITSHIFT_NDOFGEORVOPMODE)|(BSX_GYROCALIB_GYROACCMAG << BSX_BITSHIFT_GYROCALIBOPMODE)|(BSX_CALIBSOURCE_FAST << BSX_BITSHIFT_MAGCALIBSOURCE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_CLASSICALMAGCALIBOPMODE)|(BSX_CALIB_MODEOFFSETACTIVE<<BSX_BITSHIFT_FASTMAGCALIBOPMODE)|(BSX_OPMODE_NDOF_SLEEP<<BSX_BITSHIFT_NDOFOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_M4GOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_COMPASSOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_GYROOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_MAGOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_ACCOPMODE))/**< Accel, Mag and gyro will be active and related modules will be processed*/
|
||||||
|
#define BSX_WORKINGMODE_COMPASS (BSX_U32)((BSX_NDOFGRV_SLEEP<<BSX_BITSHIFT_NDOFGEORVOPMODE)|(BSX_GYROCALIB_SLEEP << BSX_BITSHIFT_GYROCALIBOPMODE)|(BSX_CALIBSOURCE_CLASSIC << BSX_BITSHIFT_MAGCALIBSOURCE)|(BSX_CALIB_MODEOFFSETACTIVE<<BSX_BITSHIFT_CLASSICALMAGCALIBOPMODE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_FASTMAGCALIBOPMODE)|(BSX_OPMODE_NDOF_SLEEP<<BSX_BITSHIFT_NDOFOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_M4GOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_COMPASSOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_GYROOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_MAGOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_ACCOPMODE)) /**< COMPASS mode - Accel + Mag and related modules will be processed*/
|
||||||
|
#define BSX_WORKINGMODE_M4G (BSX_U32)((BSX_NDOFGRV_SLEEP<<BSX_BITSHIFT_NDOFGEORVOPMODE)|(BSX_GYROCALIB_SLEEP << BSX_BITSHIFT_GYROCALIBOPMODE)|(BSX_CALIBSOURCE_CLASSIC << BSX_BITSHIFT_MAGCALIBSOURCE)|(BSX_CALIB_MODEOFFSETACTIVE<<BSX_BITSHIFT_CLASSICALMAGCALIBOPMODE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_FASTMAGCALIBOPMODE)|(BSX_OPMODE_NDOF_SLEEP<<BSX_BITSHIFT_NDOFOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_M4GOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_COMPASSOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_GYROOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_MAGOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_ACCOPMODE)) /**< M4G mode - Accel +Mag and related modules will be processed*/
|
||||||
|
|
||||||
|
#define BSX_WORKINGMODE_NDOF_FMC_OFF (BSX_U32)((BSX_NDOFGRV_SLEEP<<BSX_BITSHIFT_NDOFGEORVOPMODE)|(BSX_GYROCALIB_GYROACCMAG << BSX_BITSHIFT_GYROCALIBOPMODE)|(BSX_CALIBSOURCE_CLASSIC << BSX_BITSHIFT_MAGCALIBSOURCE)|(BSX_CALIB_MODEOFFSETACTIVE<<BSX_BITSHIFT_CLASSICALMAGCALIBOPMODE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_FASTMAGCALIBOPMODE)|(BSX_OPMODE_NDOF_REGULAR<<BSX_BITSHIFT_NDOFOPMODE)|(BSX_OPMODE_NDOF_SLEEP<<BSX_BITSHIFT_M4GOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_COMPASSOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_GYROOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_MAGOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_ACCOPMODE)) /**<NDOF - FMC off mode (NDOF with classical calibration) and related modules will be processed*/
|
||||||
|
#define BSX_WORKINGMODE_NDOF (BSX_U32)((BSX_NDOFGRV_SLEEP<<BSX_BITSHIFT_NDOFGEORVOPMODE)|(BSX_GYROCALIB_GYROACCMAG << BSX_BITSHIFT_GYROCALIBOPMODE)|(BSX_CALIBSOURCE_FAST << BSX_BITSHIFT_MAGCALIBSOURCE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_CLASSICALMAGCALIBOPMODE)|(BSX_CALIB_MODEOFFSETACTIVE<<BSX_BITSHIFT_FASTMAGCALIBOPMODE)|(BSX_OPMODE_NDOF_REGULAR<<BSX_BITSHIFT_NDOFOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_M4GOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_COMPASSOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_GYROOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_MAGOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_ACCOPMODE)) /**<NDOF regular mode (with FMC calibration) and related modules will be processed */
|
||||||
|
|
||||||
|
#define BSX_WORKINGMODE_NDOF_GEORV (BSX_U32)((BSX_NDOFGRV_ACTIVE<<BSX_BITSHIFT_NDOFGEORVOPMODE)|(BSX_GYROCALIB_GYROACCMAG << BSX_BITSHIFT_GYROCALIBOPMODE)|(BSX_CALIBSOURCE_FAST << BSX_BITSHIFT_MAGCALIBSOURCE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_CLASSICALMAGCALIBOPMODE)|(BSX_CALIB_MODEOFFSETACTIVE<<BSX_BITSHIFT_FASTMAGCALIBOPMODE)|(BSX_OPMODE_NDOF_REGULAR<<BSX_BITSHIFT_NDOFOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_M4GOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_COMPASSOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_GYROOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_MAGOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_ACCOPMODE)) /**<NDOF mode with Geomagnetic Rotation Vector output(FMC enabled) and related modules will be processed*/
|
||||||
|
#define BSX_WORKINGMODE_NDOF_GEORV_FMC_OFF (BSX_U32)((BSX_NDOFGRV_ACTIVE<<BSX_BITSHIFT_NDOFGEORVOPMODE)|(BSX_GYROCALIB_GYROACCMAG << BSX_BITSHIFT_GYROCALIBOPMODE)|(BSX_CALIBSOURCE_CLASSIC << BSX_BITSHIFT_MAGCALIBSOURCE)|(BSX_CALIB_MODEOFFSETACTIVE<<BSX_BITSHIFT_CLASSICALMAGCALIBOPMODE)|(BSX_CALIB_SLEEP<<BSX_BITSHIFT_FASTMAGCALIBOPMODE)|(BSX_OPMODE_NDOF_REGULAR<<BSX_BITSHIFT_NDOFOPMODE)|(BSX_OPMODE_NDOF_SLEEP<<BSX_BITSHIFT_M4GOPMODE)|(BSX_OPMODE_SLEEP<<BSX_BITSHIFT_COMPASSOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_GYROOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_MAGOPMODE)|(BSX_OPMODE_REGULAR<<BSX_BITSHIFT_ACCOPMODE)) /**<NDOF mode with Geomagnetic Rotation Vector output(FMC disabled) and related modules will be processed */
|
||||||
|
|
||||||
|
#define BSX_WORKINGMODE_DEFAULT BSX_WORKINGMODE_SLEEP /**< Default working mode - "BSX_WORKINGMODE_SLEEP"*/
|
||||||
|
|
||||||
|
/**\name Orientation Sensor Modes */
|
||||||
|
/**\name Ndof*/
|
||||||
|
#define BSX_OPMODE_NDOF_SLEEP (0U) /**< Ndof Operation mode is in sleep state */
|
||||||
|
#define BSX_OPMODE_NDOFIMU (1U) /**< Ndof Operation mode => 1 indicates IMU mode*/
|
||||||
|
#define BSX_OPMODE_NDOF_REGULAR (2U) /**< Regular Ndof mode*/
|
||||||
|
|
||||||
|
/**\name Time related */
|
||||||
|
#define BSX_SAMPLETIMETOLERANCE (0.95f) /**< Decreasing of RefTime by this factor => 10ms * 0.95 = 9.5ms --> 105.2Hz */
|
||||||
|
|
||||||
|
/**\name Orientation sensor model */
|
||||||
|
#define BSX_OPMODE_ORIENT_SLEEP (0U) /**< Orient Opmode:sleep */
|
||||||
|
#define BSX_OPMODE_ORIENT_COMPASS (1U) /**< Orient Opmode:Compass */
|
||||||
|
#define BSX_OPMODE_ORIENT_M4G (2U) /**< Orient Opmode:M4G */
|
||||||
|
#define BSX_OPMODE_ORIENT_IMU (3U) /**< Orient Opmode:IMU */
|
||||||
|
#define BSX_OPMODE_ORIENT_NDOF (4U) /**< Orient Opmode:NDOF */
|
||||||
|
|
||||||
|
/**\name Flip gesture Operation mode */
|
||||||
|
#define BSX_FLIP_GESTURE_MODE_SLEEP (0U) /**< Flig Gesture mode :sleep */
|
||||||
|
#define BSX_FLIP_GESTURE_MODE_REGULAR (1U) /**< Flip Gesture mode : regular */
|
||||||
|
|
||||||
|
/**\name Significant Motion Operation mode */
|
||||||
|
#define BSX_SIGNIFICANT_MOTION_SLEEP (0U) /**< Significant Motion opmode :Sleep */
|
||||||
|
#define BSX_SIGNIFICANT_MOTION_REGULAR (1U) /**< Significant Motion opmode :Regular */
|
||||||
|
|
||||||
|
/**\name Pedometer Support Operation Mode */
|
||||||
|
#define BSX_PEDO_SUPPORT_SLEEP (0U) /**< Pedometer operation mode: sleep*/
|
||||||
|
#define BSX_PEDO_SUPPORT_REGULAR (1U) /**< Pedometer operation mode:regular*/
|
||||||
|
|
||||||
|
/**\name Orient coordinate system*/
|
||||||
|
#define BSX_ORIENTCOORDINATESYSTEM_ANDROID (1U) /**< Coordinate system: Android */
|
||||||
|
#define BSX_ORIENTCOORDINATESYSTEM_WIN8 (2U) /**< Coordinate system: Win8 */
|
||||||
|
|
||||||
|
/**\name Compass Orient Filter modes*/
|
||||||
|
#define BSX_COMPASSORIENTFILTER_MODE_BYPASS (0U) /**< Orient filter mode : Bypass(0)*/
|
||||||
|
#define BSX_COMPASSORIENTFILTER_MODE_LOW (1U) /**< Orient filter mode : low(1)*/
|
||||||
|
#define BSX_COMPASSORIENTFILTER_MODE_MEDIUM (2U) /**< Orient filter mode : medium(2)*/
|
||||||
|
#define BSX_COMPASSORIENTFILTER_MODE_HIGH (3U) /**< Orient filter mode : high(3)*/
|
||||||
|
|
||||||
|
#define BSX_COMPASSORIENTFILTERCOEFFCALC_MODE_BYPASS (0U) /**< Coeff Calc mode : bypass(0)*/
|
||||||
|
#define BSX_COMPASSORIENTFILTERCOEFFCALC_MODE_FORWARD (1U) /**< Coeff Calc mode : forward(1)*/
|
||||||
|
#define BSX_COMPASSORIENTFILTERCOEFFCALC_MODE_BACKWARD (2U) /**< Coeff Calc mode : Backward(2)*/
|
||||||
|
|
||||||
|
/**\name Predefined levels*/
|
||||||
|
#define BSX_PREDEFINED_LEVEL_ZERO (0U) /**< Predefined level: zero*/
|
||||||
|
#define BSX_PREDEFINED_LEVEL_ONE (1U) /**< Predefined level: one*/
|
||||||
|
#define BSX_PREDEFINED_LEVEL_TWO (2U) /**< Predefined level: two*/
|
||||||
|
#define BSX_PREDEFINED_LEVEL_THREE (3U) /**< Predefined level: three*/
|
||||||
|
#define BSX_PREDEFINED_LEVEL_FOUR (4U) /**< Predefined level: four*/
|
||||||
|
#define BSX_PREDEFINED_LEVEL_FIVE (5U) /**< Predefined level: five*/
|
||||||
|
|
||||||
|
#define BSX_PREDEFINED_LEVEL_MIN BSX_PREDEFINED_LEVEL_ZERO /**< predefined level minimum: level zero*/
|
||||||
|
#define BSX_PREDEFINED_LEVEL_DEFAULT BSX_PREDEFINED_LEVEL_ONE /**< predefined level default : level one*/
|
||||||
|
#define BSX_PREDEFINED_LEVEL_MAX BSX_PREDEFINED_LEVEL_FIVE /**< predefined level maximum :level five*/
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,483 @@
|
||||||
|
#ifndef __BSXLIBRARYDATATYPES_H__
|
||||||
|
#define __BSXLIBRARYDATATYPES_H__
|
||||||
|
/*!
|
||||||
|
* @section LICENCE
|
||||||
|
* $license$
|
||||||
|
*
|
||||||
|
* (C) Copyright 2011 - 2015 Bosch Sensortec GmbH All Rights Reserved
|
||||||
|
*------------------------------------------------------------------------------
|
||||||
|
* Disclaimer
|
||||||
|
*
|
||||||
|
* Common: Bosch Sensortec products are developed for the consumer goods
|
||||||
|
* industry. They may only be used within the parameters of the respective valid
|
||||||
|
* product data sheet. Bosch Sensortec products are provided with the express
|
||||||
|
* understanding that there is no warranty of fitness for a particular purpose.
|
||||||
|
* They are not fit for use in life-sustaining, safety or security sensitive
|
||||||
|
* systems or any system or device that may lead to bodily harm or property
|
||||||
|
* damage if the system or device malfunctions. In addition, Bosch Sensortec
|
||||||
|
* products are not fit for use in products which interact with motor vehicle
|
||||||
|
* systems. The resale and/or use of products are at the purchaser's own risk
|
||||||
|
* and his own responsibility. The examination of fitness for the intended use
|
||||||
|
* is the sole responsibility of the Purchaser.
|
||||||
|
*
|
||||||
|
* The purchaser shall indemnify Bosch Sensortec from all third party claims,
|
||||||
|
* including any claims for incidental, or consequential damages, arising from
|
||||||
|
* any product use not covered by the parameters of the respective valid product
|
||||||
|
* data sheet or not approved by Bosch Sensortec and reimburse Bosch Sensortec
|
||||||
|
* for all costs in connection with such claims.
|
||||||
|
*
|
||||||
|
* The purchaser must monitor the market for the purchased products,
|
||||||
|
* particularly with regard to product safety and inform Bosch Sensortec without
|
||||||
|
* delay of all security relevant incidents.
|
||||||
|
*
|
||||||
|
* Engineering Samples are marked with an asterisk (*) or (e). Samples may vary
|
||||||
|
* from the valid technical specifications of the product series. They are
|
||||||
|
* therefore not intended or fit for resale to third parties or for use in end
|
||||||
|
* products. Their sole purpose is internal client testing. The testing of an
|
||||||
|
* engineering sample may in no way replace the testing of a product series.
|
||||||
|
* Bosch Sensortec assumes no liability for the use of engineering samples. By
|
||||||
|
* accepting the engineering samples, the Purchaser agrees to indemnify Bosch
|
||||||
|
* Sensortec from all claims arising from the use of engineering samples.
|
||||||
|
*
|
||||||
|
* Special: This software module (hereinafter called "Software") and any
|
||||||
|
* information on application-sheets (hereinafter called "Information") is
|
||||||
|
* provided free of charge for the sole purpose to support your application
|
||||||
|
* work. The Software and Information is subject to the following terms and
|
||||||
|
* conditions:
|
||||||
|
*
|
||||||
|
* The Software is specifically designed for the exclusive use for Bosch
|
||||||
|
* Sensortec products by personnel who have special experience and training. Do
|
||||||
|
* not use this Software if you do not have the proper experience or training.
|
||||||
|
*
|
||||||
|
* This Software package is provided `` as is `` and without any expressed or
|
||||||
|
* implied warranties, including without limitation, the implied warranties of
|
||||||
|
* merchantability and fitness for a particular purpose.
|
||||||
|
*
|
||||||
|
* Bosch Sensortec and their representatives and agents deny any liability for
|
||||||
|
* the functional impairment of this Software in terms of fitness, performance
|
||||||
|
* and safety. Bosch Sensortec and their representatives and agents shall not be
|
||||||
|
* liable for any direct or indirect damages or injury, except as otherwise
|
||||||
|
* stipulated in mandatory applicable law.
|
||||||
|
*
|
||||||
|
* The Information provided is believed to be accurate and reliable. Bosch
|
||||||
|
* Sensortec assumes no responsibility for the consequences of use of such
|
||||||
|
* Information nor for any infringement of patents or other rights of third
|
||||||
|
* parties which may result from its use.
|
||||||
|
*
|
||||||
|
|
||||||
|
* @file bsxlibrarydatatypes.h
|
||||||
|
* @date 2013/02/12 created
|
||||||
|
*
|
||||||
|
* @brief
|
||||||
|
* This file provides datatypes used by library
|
||||||
|
*/
|
||||||
|
|
||||||
|
/************************************************************************************************************/
|
||||||
|
/* INCLUDES */
|
||||||
|
/************************************************************************************************************/
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
|
#include "BsxLibraryConstants.h"
|
||||||
|
#include "BsxLibraryCalibConstants.h"
|
||||||
|
#include "BsxLibraryErrorConstants.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
/************************************************************************************************************/
|
||||||
|
/* TYPE DEFINITIONS */
|
||||||
|
/************************************************************************************************************/
|
||||||
|
|
||||||
|
/** \def Basic Datatypes */
|
||||||
|
#if __STDC_VERSION__ >= 199901L
|
||||||
|
/** C99 standard */
|
||||||
|
typedef int16_t BSX_S16; /**< signed short */
|
||||||
|
typedef uint16_t BSX_U16; /**<unsigned short */
|
||||||
|
typedef int32_t BSX_S32; /**<signed int */
|
||||||
|
typedef uint32_t BSX_U32; /**<unsigned int */
|
||||||
|
|
||||||
|
typedef int8_t BSX_S8; /**< signed char */
|
||||||
|
typedef uint8_t BSX_U8; /**< unsigned char */
|
||||||
|
typedef int64_t BSX_S64; /**< signed long long */
|
||||||
|
typedef uint64_t BSX_U64; /**< unsigned long long*/
|
||||||
|
typedef uint8_t BSX_BIT; /**< unsigned char */
|
||||||
|
typedef uint32_t BSX_BOOL;/**<unsigned int */
|
||||||
|
#else
|
||||||
|
/* C89 standard */
|
||||||
|
/* find correct data type for signed 16 bit variables */
|
||||||
|
#if USHRT_MAX == 0xFFFF
|
||||||
|
typedef unsigned short BSX_U16; /**< 16 bit achieved with short */
|
||||||
|
typedef signed short BSX_S16;
|
||||||
|
#elif UINT_MAX == 0xFFFF
|
||||||
|
typedef unsigned int BSX_U16; /**< 16 bit achieved with int */
|
||||||
|
typedef signed int BSX_S16;
|
||||||
|
#else
|
||||||
|
#error U16 and S16 could not be defined automatically, please do so manually
|
||||||
|
#endif
|
||||||
|
/* find correct data type for signed 32 bit variables */
|
||||||
|
#if INT_MAX == 0x7FFFFFFF
|
||||||
|
typedef signed int BSX_S32; /**< 32 bit achieved with int */
|
||||||
|
typedef unsigned int BSX_U32;
|
||||||
|
#elif LONG_MAX == 0x7FFFFFFF
|
||||||
|
typedef signed long int BSX_S32; /**< 32 bit achieved with long int */
|
||||||
|
typedef unsigned long int BSX_U32; /**< 32 bit achieved with long int */
|
||||||
|
#else
|
||||||
|
#error S32 could not be defined automatically, please do so manually
|
||||||
|
#endif
|
||||||
|
typedef signed char BSX_S8; /**< signed char */
|
||||||
|
typedef unsigned char BSX_U8; /**< unsigned char*/
|
||||||
|
typedef signed long long BSX_S64; /**< signed long long */
|
||||||
|
typedef unsigned long long BSX_U64; /**< unsigned long long*/
|
||||||
|
typedef unsigned char BSX_BIT; /**< unsigned char */
|
||||||
|
typedef unsigned int BSX_BOOL; /**<unsigned int */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** \def Basic Datatypes */
|
||||||
|
|
||||||
|
typedef float BSX_F32; /**< float*/
|
||||||
|
typedef double BSX_F64; /**< double*/
|
||||||
|
|
||||||
|
|
||||||
|
/**\name Basic numbers in use */
|
||||||
|
#define BSX_NULL (BSX_U8)0 /**< zero*/
|
||||||
|
#define BSX_ZERO (0U) /**< zero in unsigned*/
|
||||||
|
#define BSX_ONE (1U) /**< one in unsigned*/
|
||||||
|
#define BSX_TWO (2U) /**< two in unsigned*/
|
||||||
|
#define BSX_THREE (3U) /**< three in unsigned*/
|
||||||
|
#define BSX_FOUR (4U) /**< four in unsigned*/
|
||||||
|
#define BSX_FIVE (5U) /**< five in unsigned*/
|
||||||
|
#define BSX_SIX (6U) /**< six in unsigned*/
|
||||||
|
#define BSX_SEVEN (7U) /**< seven in unsigned*/
|
||||||
|
#define BSX_EIGHT (8U) /**< eight in unsigned*/
|
||||||
|
#define BSX_NINE (9U) /**< nine in unsigned*/
|
||||||
|
#define BSX_TEN (10U) /**< ten in unsigned*/
|
||||||
|
#define BSX_ELEVEN (11U) /**< eleven in unsigned*/
|
||||||
|
#define BSX_TWELVE (12U) /**< twelve in unsigned*/
|
||||||
|
#define BSX_THIRTEEN (13U) /**< thirteen in unsigned*/
|
||||||
|
#define BSX_SIXTEEN (16U) /**< sixteen in unsigned*/
|
||||||
|
#define BSX_TWENTYFOUR (24U) /**< twentyfour in unsigned*/
|
||||||
|
#define BSX_THIRTYTWO (32U) /**< thirtytwo in unsigned*/
|
||||||
|
#define BSX_SIXTYFOUR (64U) /**< sixtyfour in unsigned*/
|
||||||
|
#define BSX_HUNDRED (100) /**< hundred in unsigned*/
|
||||||
|
#define BSX_ONETWENTYSEVEN (127) /**< one twenty seven in unsigned*/
|
||||||
|
#define BSX_TWOFIFTYFIVE (255) /**< two fifty five in unsigned*/
|
||||||
|
#define BSX_TWOFIFTYSIX (256) /**< two fifty six in unsigned*/
|
||||||
|
|
||||||
|
#define BSX_ZERO_S (0) /**< zero in signed*/
|
||||||
|
#define BSX_ONE_S (1) /**< one in signed*/
|
||||||
|
#define BSX_TWO_S (2) /**< two in signed*/
|
||||||
|
#define BSX_THREE_S (3) /**< three in signed*/
|
||||||
|
#define BSX_FOUR_S (4) /**< four in signed*/
|
||||||
|
#define BSX_FIVE_S (5) /**< five in signed*/
|
||||||
|
#define BSX_SIX_S (6) /**< six in signed*/
|
||||||
|
#define BSX_SEVEN_S (7) /**< seven in signed*/
|
||||||
|
#define BSX_EIGHT_S (8) /**< eight in signed*/
|
||||||
|
#define BSX_NINE_S (9) /**< nine in signed*/
|
||||||
|
#define BSX_TEN_S (10) /**< ten in signed*/
|
||||||
|
#define BSX_ELEVEN_S (11) /**< eleven in signed*/
|
||||||
|
#define BSX_TWELVE_S (12) /**< twelve in signed*/
|
||||||
|
#define BSX_SIXTEEN_S (16) /**< sixteen in signed*/
|
||||||
|
#define BSX_TWENTYFOUR_S (24) /**< twentyfour in signed*/
|
||||||
|
#define BSX_THIRTYTWO_S (32) /**< thirtytwo in signed*/
|
||||||
|
#define BSX_SIXTYFOUR_S (64) /**< sixtyfour in signed*/
|
||||||
|
#define BSX_HUNDRED_S (100) /**< hundred in signed*/
|
||||||
|
#define BSX_ONETWENTYSEVEN_S (127) /**< one twenty seven in signed*/
|
||||||
|
#define BSX_TWOFIFTYFIVE_S (255) /**< two fifty five in signed*/
|
||||||
|
#define BSX_TWOFIFTYSIX_S (256) /**< two fifty six in signed*/
|
||||||
|
|
||||||
|
|
||||||
|
#define BSX_ZERO_F (0.0f) /**< zero in float*/
|
||||||
|
#define BSX_ONE_F (1.0f) /**< one in float*/
|
||||||
|
#define BSX_TWO_F (2.0f) /**< two in float*/
|
||||||
|
#define BSX_THREE_F (3.0f) /**< three in float*/
|
||||||
|
#define BSX_FOUR_F (4.0f) /**< four in float*/
|
||||||
|
#define BSX_FIVE_F (5.0f) /**< five in float*/
|
||||||
|
#define BSX_SIX_F (6.0f) /**< six in float*/
|
||||||
|
#define BSX_SEVEN_F (7.0f) /**< seven in float*/
|
||||||
|
#define BSX_EIGHT_F (8.0f) /**< eight in float*/
|
||||||
|
#define BSX_NINE_F (9.0f) /**< nine in float*/
|
||||||
|
#define BSX_TEN_F (10.0f) /**< ten in float*/
|
||||||
|
#define BSX_ELEVEN_F (11.0f) /**< eleven in float*/
|
||||||
|
#define BSX_TWELVE_F (12.0f) /**< twelve in float*/
|
||||||
|
#define BSX_SIXTEEN_F (16.0f) /**< sixteen in float*/
|
||||||
|
#define BSX_TWENTYFOUR_F (24.0f) /**< twentyfour in float*/
|
||||||
|
#define BSX_THIRTYTWO_F (32.0f) /**< thirtytwo in float*/
|
||||||
|
#define BSX_SIXTYFOUR_F (64.0f) /**< sixtyfour in float*/
|
||||||
|
#define BSX_HUNDRED_F (100.0f) /**< hundred in float*/
|
||||||
|
#define BSX_ONETWENTYSEVEN_F (127.0f) /**< one twenty seven in float*/
|
||||||
|
#define BSX_TWOFIFTYFIVE_F (255.0f) /**< two fifty five in float*/
|
||||||
|
#define BSX_TWOFIFTYSIX_F (256.0f) /**< two fifty six in float*/
|
||||||
|
|
||||||
|
/**\name Standard Conversion Factors */
|
||||||
|
#define BSX_CONVFACTOR_UNIT2MILLI (1e3f) /**< unit to milli */
|
||||||
|
#define BSX_CONVFACTOR_UNIT2MICRO (1e6f) /**< unit to micro */
|
||||||
|
#define BSX_CONVFACTOR_UNIT2NANO (1e9f) /**< unit to nano */
|
||||||
|
#define BSX_CONVFACTOR_RAD2DEG (57.295647f) /**< radiant to degree conversion factor (180/3.1416)*/
|
||||||
|
#define BSX_CONVFACTOR_DEG2RAD (0.0175f) /**< degree to radiant conversion factor (3.1416/180)*/
|
||||||
|
#define BSX_NORMFACTOR (0.008726646259722f) /**< pi/(180*2)*/
|
||||||
|
#define BSX_CONVERSIONFACTOR (0.008726666666667f) /**<(BSX_PI/(180*2))*/
|
||||||
|
|
||||||
|
/**\name Standard Values */
|
||||||
|
#define BSX_PI (3.1416f) /**< Ratio of circle's circumference to its diameter */
|
||||||
|
#define C_LSB2uT_F32X (0.25f) /**< conversion factor - lsb to ut */
|
||||||
|
#define C_uT2LSB_F32X (4.0f) /**< conversion factor - uT to lsb (1/0.25f)*/
|
||||||
|
/**\name Basic Status/Controls */
|
||||||
|
#define BSX_DEACTIVATE (0U) /**< to deactivate any mode*/
|
||||||
|
#define BSX_ACTIVATE (1U) /**< to activate any mode*/
|
||||||
|
|
||||||
|
#define BSX_FAILURE (0U) /**< denotes failure case */
|
||||||
|
#define BSX_SUCCESS (1U) /**< denotes success case */
|
||||||
|
|
||||||
|
#define BSX_DISABLE (0U) /**< to disable any mode */
|
||||||
|
#define BSX_ENABLE (1U) /**< to enable any mode */
|
||||||
|
|
||||||
|
#define BSX_FALSE (0U) /**< denotes false scenario*/
|
||||||
|
#define BSX_TRUE (1U) /**< denotes true */
|
||||||
|
|
||||||
|
#define BSX_RESET (0U) /**< denotes reset*/
|
||||||
|
#define BSX_SET (1U) /**< denotes set */
|
||||||
|
|
||||||
|
/************************************************************************************************************/
|
||||||
|
/* STRUCTURES DEFINITION */
|
||||||
|
/************************************************************************************************************/
|
||||||
|
/** \struct ts_version
|
||||||
|
\brief Version format
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
BSX_S16 major; /**< major version */
|
||||||
|
BSX_S16 minor; /**< minor version */
|
||||||
|
BSX_S16 majorbugFix; /**< major bux fix version */
|
||||||
|
BSX_S16 minorbugFix; /**< minor bux fix version */
|
||||||
|
}ts_version;
|
||||||
|
|
||||||
|
/** \struct ts_dataxyz
|
||||||
|
\brief 3-axis data as S16
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
BSX_S16 x; /**< x-axis data of type S16 */
|
||||||
|
BSX_S16 y; /**< y-axis data of type S16*/
|
||||||
|
BSX_S16 z; /**< z-axis data of type S16*/
|
||||||
|
}ts_dataxyz;
|
||||||
|
|
||||||
|
/** \struct ts_dataxyzs32
|
||||||
|
\brief 3-axis data as S32
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
BSX_S32 x; /**< x-axis data of type S32 */
|
||||||
|
BSX_S32 y; /**< y-axis data of type S32 */
|
||||||
|
BSX_S32 z; /**< z-axis data of type S32 */
|
||||||
|
}ts_dataxyzs32;
|
||||||
|
|
||||||
|
/** \struct ts_dataxyzu8
|
||||||
|
\brief 3-axis data as U8
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
BSX_U8 x; /**< x-axis data of type U8 */
|
||||||
|
BSX_U8 y; /**< y-axis data of type U8 */
|
||||||
|
BSX_U8 z; /**< z-axis data of type U8 */
|
||||||
|
}ts_dataxyzu8;
|
||||||
|
|
||||||
|
/** \struct ts_dataxyzf32
|
||||||
|
\brief 3-axis data as F32
|
||||||
|
*/
|
||||||
|
typedef struct{
|
||||||
|
BSX_F32 x; /**< x-axis data of type F32 */
|
||||||
|
BSX_F32 y; /**< y-axis data of type F32 */
|
||||||
|
BSX_F32 z; /**< z-axis data of type F32 */
|
||||||
|
}ts_dataxyzf32;
|
||||||
|
|
||||||
|
/** \struct ts_dataeuler
|
||||||
|
\brief Euler angles data as S16
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
BSX_S16 h; /**< heading data */
|
||||||
|
BSX_S16 p; /**< pitch data */
|
||||||
|
BSX_S16 r; /**< roll data */
|
||||||
|
BSX_S16 y; /**< 3D Yaw data */
|
||||||
|
}ts_dataeuler;
|
||||||
|
|
||||||
|
/** \struct ts_dataquat
|
||||||
|
\brief Quaternion angles data
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
BSX_S16 w; /**< q[0] data of vector q */
|
||||||
|
BSX_S16 x; /**< q[1] data of vector q */
|
||||||
|
BSX_S16 y; /**< q[2] data of vector q */
|
||||||
|
BSX_S16 z; /**< q[3] data of vector q */
|
||||||
|
}ts_dataquat;
|
||||||
|
|
||||||
|
/** \struct ts_dataeulerf32
|
||||||
|
\brief Euler angles data as F32
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
BSX_F32 h; /**< heading data */
|
||||||
|
BSX_F32 p; /**< pitch data */
|
||||||
|
BSX_F32 r; /**< roll data */
|
||||||
|
BSX_F32 y; /**< 3D Yaw data */
|
||||||
|
}ts_dataeulerf32;
|
||||||
|
|
||||||
|
/** \struct ts_dataquatf32
|
||||||
|
\brief Quaternion data in F32
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
BSX_F32 w; /**< q[0] data of vector q */
|
||||||
|
BSX_F32 x; /**< q[1] data of vector q */
|
||||||
|
BSX_F32 y; /**< q[2] data of vector q */
|
||||||
|
BSX_F32 z; /**< q[3] data of vector q */
|
||||||
|
}ts_dataquatf32;
|
||||||
|
|
||||||
|
/** \struct ts_sensmatrix
|
||||||
|
\brief 3x3 sensitivity matrix
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
ts_dataxyzf32 x; /**< x-axis sensitivity with respect to 3-axis */
|
||||||
|
ts_dataxyzf32 y; /**< y-axis sensitivity with respect to 3-axis */
|
||||||
|
ts_dataxyzf32 z; /**< z-axis sensitivity with respect to 3-axis */
|
||||||
|
}ts_sensmatrix;
|
||||||
|
|
||||||
|
/** \struct ts_axisconfig
|
||||||
|
\brief Axis Configuration
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
BSX_S32 update_remaparray[3*3] ;/**< array of 3*3 size to update after remapping*/
|
||||||
|
BSX_U8 axisConfig;/**< Axis Configuration parameter */
|
||||||
|
BSX_U8 axisSign;/**< AxisSign parameter */
|
||||||
|
|
||||||
|
}ts_axisconfig;
|
||||||
|
|
||||||
|
|
||||||
|
/** \struct ts_calibparam
|
||||||
|
\brief Calibration parameters
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
ts_dataxyz offset; /**< 3-axis offset */
|
||||||
|
BSX_S16 radius; /**< radius */
|
||||||
|
}ts_calibparam;
|
||||||
|
|
||||||
|
|
||||||
|
/** \struct ts_tick
|
||||||
|
\brief Ticks to enable calibration and usecase modules
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
BSX_U8 calib; /**< enabled when calibration module is to be used */
|
||||||
|
BSX_U8 usecase; /**< enable when usecase module is to be used */
|
||||||
|
}ts_tick;
|
||||||
|
|
||||||
|
/** \struct ts_callflag
|
||||||
|
\brief Selection for Magnetometer or usecase mode
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
BSX_U8 acccalib; /**< select for Accelerometer calibration module */
|
||||||
|
BSX_U8 magcalib; /**< select for Magnetometer calibration module */
|
||||||
|
BSX_U8 gyrocalib; /**< select for Gyroscope calibration module */
|
||||||
|
BSX_U8 usecase; /**< select for usecase module */
|
||||||
|
}ts_callflag;
|
||||||
|
|
||||||
|
/** \struct ts_calibparamf32
|
||||||
|
\brief Calibration parameters and radius in float
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
ts_dataxyzf32 offset; /**< 3-axis offset */
|
||||||
|
BSX_F32 radius; /**< radius */
|
||||||
|
}ts_calibparamf32;
|
||||||
|
|
||||||
|
/** \struct ts_calibprofile
|
||||||
|
\brief Calibration parameters and accuracy of calibration structure - calibprofile
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
ts_calibparam calibParam; /**< calibration parameters - offset and radius */
|
||||||
|
BSX_U8 accuracy; /**< calibration accuracy */
|
||||||
|
}ts_calibprofile;
|
||||||
|
|
||||||
|
/** \struct ts_bsxfusionlibrary
|
||||||
|
\brief General Library Structure
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
BSX_U32 workingModes; /**< working operation modes */
|
||||||
|
BSX_U32 prev_workingMode; /**< previous working mode */
|
||||||
|
BSX_U8 opMode; /**< bsx library operation mode of the library: bit[0] = accelerometer mode; bit[1] = magnetometer mode; bit[2] = gyroscope mode;*/
|
||||||
|
BSX_U8 flipgestureOpmode; /**< Operation mode for flip gesture */
|
||||||
|
BSX_U8 orientcoordinatesystem; /**< to select win 8 or ANDROID co ordinate sys */
|
||||||
|
|
||||||
|
|
||||||
|
}ts_bsxfusionlibrary;
|
||||||
|
|
||||||
|
/** \struct ts_workingModes
|
||||||
|
\brief Working Modes
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
BSX_U32 opMode; /**< working operation modes set*/
|
||||||
|
/*Reserved*/
|
||||||
|
}ts_workingModes;
|
||||||
|
|
||||||
|
/** \struct ts_HWsensorSwitchList
|
||||||
|
\brief HW sensor Switch List
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
BSX_U8 acc; /**< selecting hardware sensor Accelerometer */
|
||||||
|
BSX_U8 mag; /**< selecting hardware sensor Magnetometer */
|
||||||
|
BSX_U8 gyro; /**< selecting hardware sensor Gyroscope */
|
||||||
|
}ts_HWsensorSwitchList;
|
||||||
|
|
||||||
|
/** \struct sensordata_t
|
||||||
|
\brief sensor Data
|
||||||
|
*/
|
||||||
|
typedef struct {
|
||||||
|
ts_dataxyzs32 data; /**< data in s32*/
|
||||||
|
BSX_U32 time_stamp; /**< time stamp in U32 */
|
||||||
|
}sensordata_t;
|
||||||
|
|
||||||
|
/** \struct libraryinput_t
|
||||||
|
\brief Library input
|
||||||
|
*/
|
||||||
|
typedef struct {
|
||||||
|
sensordata_t acc; /**< Accelerometer data and Accelerometer timestamp*/
|
||||||
|
sensordata_t mag; /**< Magnetometer data and Magnetometer timestamp*/
|
||||||
|
sensordata_t gyro; /**< Gyroscope data and Gyroscope timestamp*/
|
||||||
|
} libraryinput_t;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief struct flip_t
|
||||||
|
* Vector of face up and face down
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
BSX_F32 faceup; /**< holds the faceup angle */
|
||||||
|
BSX_F32 facedown; /**< holds the facedown angle */
|
||||||
|
}flip_t;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief struct initParam_t
|
||||||
|
* Includes pointers to spec, usecase array and CRC check status for each spec and usecase config.
|
||||||
|
*/
|
||||||
|
typedef struct {
|
||||||
|
BSX_U8 *accelspec; /**< Pointer to Accelerometer spec char array data*/
|
||||||
|
BSX_U8 *magspec; /**< Pointer to Magnetometer spec char array data*/
|
||||||
|
BSX_U8 *gyrospec; /**< Pointer to Gyroscope spec char array data*/
|
||||||
|
BSX_U8 *usecase; /**< Pointer to usecase char array data*/
|
||||||
|
BSX_U8 accelspec_status; /**< Status of initialization on Accelerometer spec data*/
|
||||||
|
BSX_U8 magspec_status; /**< Status of initialization on Magnetometer spec data*/
|
||||||
|
BSX_U8 gyrospec_status; /**< Status of initialization on Gyroscope spec data*/
|
||||||
|
BSX_U8 usecase_status; /**< Status of initialization on use case data*/
|
||||||
|
}initParam_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,130 @@
|
||||||
|
#ifndef __BSXLIBRARYERRORCONSTANTS_H__
|
||||||
|
#define __BSXLIBRARYERRORCONSTANTS_H__
|
||||||
|
/*!
|
||||||
|
* @section LICENCE
|
||||||
|
* $license$
|
||||||
|
*
|
||||||
|
* (C) Copyright 2011 - 2015 Bosch Sensortec GmbH All Rights Reserved
|
||||||
|
*------------------------------------------------------------------------------
|
||||||
|
* Disclaimer
|
||||||
|
*
|
||||||
|
* Common: Bosch Sensortec products are developed for the consumer goods
|
||||||
|
* industry. They may only be used within the parameters of the respective valid
|
||||||
|
* product data sheet. Bosch Sensortec products are provided with the express
|
||||||
|
* understanding that there is no warranty of fitness for a particular purpose.
|
||||||
|
* They are not fit for use in life-sustaining, safety or security sensitive
|
||||||
|
* systems or any system or device that may lead to bodily harm or property
|
||||||
|
* damage if the system or device malfunctions. In addition, Bosch Sensortec
|
||||||
|
* products are not fit for use in products which interact with motor vehicle
|
||||||
|
* systems. The resale and/or use of products are at the purchaser's own risk
|
||||||
|
* and his own responsibility. The examination of fitness for the intended use
|
||||||
|
* is the sole responsibility of the Purchaser.
|
||||||
|
*
|
||||||
|
* The purchaser shall indemnify Bosch Sensortec from all third party claims,
|
||||||
|
* including any claims for incidental, or consequential damages, arising from
|
||||||
|
* any product use not covered by the parameters of the respective valid product
|
||||||
|
* data sheet or not approved by Bosch Sensortec and reimburse Bosch Sensortec
|
||||||
|
* for all costs in connection with such claims.
|
||||||
|
*
|
||||||
|
* The purchaser must monitor the market for the purchased products,
|
||||||
|
* particularly with regard to product safety and inform Bosch Sensortec without
|
||||||
|
* delay of all security relevant incidents.
|
||||||
|
*
|
||||||
|
* Engineering Samples are marked with an asterisk (*) or (e). Samples may vary
|
||||||
|
* from the valid technical specifications of the product series. They are
|
||||||
|
* therefore not intended or fit for resale to third parties or for use in end
|
||||||
|
* products. Their sole purpose is internal client testing. The testing of an
|
||||||
|
* engineering sample may in no way replace the testing of a product series.
|
||||||
|
* Bosch Sensortec assumes no liability for the use of engineering samples. By
|
||||||
|
* accepting the engineering samples, the Purchaser agrees to indemnify Bosch
|
||||||
|
* Sensortec from all claims arising from the use of engineering samples.
|
||||||
|
*
|
||||||
|
* Special: This software module (hereinafter called "Software") and any
|
||||||
|
* information on application-sheets (hereinafter called "Information") is
|
||||||
|
* provided free of charge for the sole purpose to support your application
|
||||||
|
* work. The Software and Information is subject to the following terms and
|
||||||
|
* conditions:
|
||||||
|
*
|
||||||
|
* The Software is specifically designed for the exclusive use for Bosch
|
||||||
|
* Sensortec products by personnel who have special experience and training. Do
|
||||||
|
* not use this Software if you do not have the proper experience or training.
|
||||||
|
*
|
||||||
|
* This Software package is provided `` as is `` and without any expressed or
|
||||||
|
* implied warranties, including without limitation, the implied warranties of
|
||||||
|
* merchantability and fitness for a particular purpose.
|
||||||
|
*
|
||||||
|
* Bosch Sensortec and their representatives and agents deny any liability for
|
||||||
|
* the functional impairment of this Software in terms of fitness, performance
|
||||||
|
* and safety. Bosch Sensortec and their representatives and agents shall not be
|
||||||
|
* liable for any direct or indirect damages or injury, except as otherwise
|
||||||
|
* stipulated in mandatory applicable law.
|
||||||
|
*
|
||||||
|
* The Information provided is believed to be accurate and reliable. Bosch
|
||||||
|
* Sensortec assumes no responsibility for the consequences of use of such
|
||||||
|
* Information nor for any infringement of patents or other rights of third
|
||||||
|
* parties which may result from its use.
|
||||||
|
*
|
||||||
|
|
||||||
|
* @file bsxlibraryerrorconstants.h
|
||||||
|
* @date 2013/02/12 created
|
||||||
|
*
|
||||||
|
* @brief
|
||||||
|
* This file provides errors constants definition used for parsing errors returned by library
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/************************************************************************************************************/
|
||||||
|
/* INCLUDES */
|
||||||
|
/************************************************************************************************************/
|
||||||
|
|
||||||
|
#include "BsxLibraryDataTypes.h"
|
||||||
|
|
||||||
|
/************************************************************************************************************/
|
||||||
|
/* CONSTANT DEFINITIONS */
|
||||||
|
/************************************************************************************************************/
|
||||||
|
|
||||||
|
/**\name Internal States Defintion */
|
||||||
|
|
||||||
|
#define BSX_STATE_ERROR (1) /**< state denoting error */
|
||||||
|
#define BSX_STATE_OK (0) /**< state denoting ok */
|
||||||
|
#define BSX_STATE_PARAMETEROUTOFRANGE (-1) /**< state denoting parameter out of range */
|
||||||
|
#define BSX_STATE_DIVIDEBYZERO (-2) /**< divide by zero state */
|
||||||
|
#define BSX_STATE_NOTSUPPORTED (-3) /**< state not supported */
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 6f7cd5d1b3a17ee532e9e14912d1c69d22aff0b5
|
|
@ -0,0 +1,22 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Atmel Studio Solution File, Format Version 11.00
|
||||||
|
VisualStudioVersion = 14.0.23107.0
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "AS5048A_test", "AS5048A_test\AS5048A_test.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|ARM = Debug|ARM
|
||||||
|
Release|ARM = Release|ARM
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||||
|
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
|
||||||
|
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
|
||||||
|
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
|
@ -0,0 +1,6 @@
|
||||||
|
<environment>
|
||||||
|
<configurations/>
|
||||||
|
<device-packs>
|
||||||
|
<device-pack device="ATSAME54P20A" name="SAME54_DFP" vendor="Atmel" version="1.1.134"/>
|
||||||
|
</device-packs>
|
||||||
|
</environment>
|
|
@ -0,0 +1,220 @@
|
||||||
|
<package xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="1.0" xs:noNamespaceSchemaLocation="PACK.xsd">
|
||||||
|
<vendor>Atmel</vendor>
|
||||||
|
<name>My Project</name>
|
||||||
|
<description>Project generated by Atmel Start</description>
|
||||||
|
<url>http://start.atmel.com/</url>
|
||||||
|
<releases>
|
||||||
|
<release version="1.0.1">Initial version</release>
|
||||||
|
</releases>
|
||||||
|
<taxonomy>
|
||||||
|
<description Cclass="AtmelStart" generator="AtmelStart">Configuration Files generated by Atmel Start</description>
|
||||||
|
</taxonomy>
|
||||||
|
<generators>
|
||||||
|
<generator id="AtmelStart">
|
||||||
|
<description>Atmel Start</description>
|
||||||
|
<select Dname="ATSAME54P20A" Dvendor="Atmel:3"/>
|
||||||
|
<command>http://start.atmel.com/</command>
|
||||||
|
<files>
|
||||||
|
<file category="generator" name="atmel_start_config.atstart"/>
|
||||||
|
<file attr="template" category="other" name="AtmelStart.env_conf" select="Environment configuration"/>
|
||||||
|
</files>
|
||||||
|
</generator>
|
||||||
|
</generators>
|
||||||
|
<conditions>
|
||||||
|
<condition id="CMSIS Device Startup">
|
||||||
|
<description>Dependency on CMSIS core and Device Startup components</description>
|
||||||
|
<require Cclass="CMSIS" Cgroup="CORE" Cversion="5.1.2"/>
|
||||||
|
<require Cclass="Device" Cgroup="Startup" Cversion="1.1.0"/>
|
||||||
|
</condition>
|
||||||
|
<condition id="ARMCC, GCC, IAR">
|
||||||
|
<require Dname="ATSAME54P20A"/>
|
||||||
|
<accept Tcompiler="ARMCC"/>
|
||||||
|
<accept Tcompiler="GCC"/>
|
||||||
|
<accept Tcompiler="IAR"/>
|
||||||
|
</condition>
|
||||||
|
<condition id="GCC">
|
||||||
|
<require Dname="ATSAME54P20A"/>
|
||||||
|
<accept Tcompiler="GCC"/>
|
||||||
|
</condition>
|
||||||
|
<condition id="IAR">
|
||||||
|
<require Dname="ATSAME54P20A"/>
|
||||||
|
<accept Tcompiler="IAR"/>
|
||||||
|
</condition>
|
||||||
|
<condition id="ARMCC">
|
||||||
|
<require Dname="ATSAME54P20A"/>
|
||||||
|
<accept Tcompiler="ARMCC"/>
|
||||||
|
</condition>
|
||||||
|
</conditions>
|
||||||
|
<components generator="AtmelStart">
|
||||||
|
<component Cclass="AtmelStart" Cgroup="Framework" Cversion="1.0.0" condition="CMSIS Device Startup">
|
||||||
|
<description>Atmel Start Framework</description>
|
||||||
|
<RTE_Components_h>#define ATMEL_START</RTE_Components_h>
|
||||||
|
<files>
|
||||||
|
<file category="doc" condition="ARMCC, GCC, IAR" name="hal/documentation/spi_master_sync.rst"/>
|
||||||
|
<file category="doc" condition="ARMCC, GCC, IAR" name="hal/documentation/usart_sync.rst"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hal_atomic.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hal_cache.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hal_delay.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hal_gpio.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hal_init.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hal_io.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hal_sleep.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hal_spi_m_sync.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_cmcc.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_core.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_delay.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_dma.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_gpio.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_i2c_m_async.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_i2c_m_sync.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_i2c_s_async.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_i2c_s_sync.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_init.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_irq.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_ramecc.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_sleep.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_spi.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_spi_async.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_spi_dma.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_spi_sync.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_usart.h"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hal/src/hal_atomic.c"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hal/src/hal_cache.c"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hal/src/hal_delay.c"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hal/src/hal_gpio.c"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hal/src/hal_init.c"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hal/src/hal_io.c"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hal/src/hal_sleep.c"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/compiler.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/err_codes.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/events.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/utils.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/utils_assert.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/utils_event.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/utils_increment_macro.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/utils_list.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/utils_repeat_macro.h"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hal/utils/src/utils_assert.c"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hal/utils/src/utils_event.c"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hal/utils/src/utils_list.c"/>
|
||||||
|
<file category="source" condition="GCC" name="hal/utils/src/utils_syscalls.c"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_ac_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_adc_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_aes_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_can_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_ccl_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_cmcc_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_dac_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_dmac_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_dsu_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_eic_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_evsys_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_freqm_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_gclk_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_gmac_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_hmatrixb_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_i2s_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_icm_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_mclk_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_nvmctrl_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_osc32kctrl_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_oscctrl_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_pac_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_pcc_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_pdec_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_pm_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_port_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_qspi_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_ramecc_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_rstc_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_rtc_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_sdhc_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_sercom_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_supc_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_tc_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_tcc_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_trng_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_usb_e54.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_wdt_e54.h"/>
|
||||||
|
<file category="doc" condition="ARMCC, GCC, IAR" name="documentation/stdio.rst"/>
|
||||||
|
<file category="source" condition="GCC" name="stdio_redirect/gcc/read.c"/>
|
||||||
|
<file category="source" condition="GCC" name="stdio_redirect/gcc/write.c"/>
|
||||||
|
<file category="source" condition="IAR" name="stdio_redirect/iar/read.c"/>
|
||||||
|
<file category="source" condition="IAR" name="stdio_redirect/iar/write.c"/>
|
||||||
|
<file category="source" condition="ARMCC" name="stdio_redirect/keil/Retarget.c"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="stdio_redirect/stdio_io.c"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="stdio_redirect/stdio_io.h"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="main.c"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="driver_init.c"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="driver_init.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="atmel_start_pins.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="examples/driver_examples.h"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="examples/driver_examples.c"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hal_usart_sync.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_missing_features.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_reset.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_spi_m_async.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_spi_m_dma.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_spi_m_sync.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_spi_s_async.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_spi_s_sync.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_usart_async.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_usart_sync.h"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hal/src/hal_spi_m_sync.c"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hal/src/hal_usart_sync.c"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/parts.h"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hpl/cmcc/hpl_cmcc.c"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hpl/core/hpl_core_m4.c"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hpl/core/hpl_core_port.h"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hpl/core/hpl_init.c"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hpl/dmac/hpl_dmac.c"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hpl/gclk/hpl_gclk.c"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hpl/gclk/hpl_gclk_base.h"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hpl/mclk/hpl_mclk.c"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hpl/osc32kctrl/hpl_osc32kctrl.c"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hpl/oscctrl/hpl_oscctrl.c"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hpl/pm/hpl_pm.c"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hpl/pm/hpl_pm_base.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="hpl/port/hpl_gpio_base.h"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hpl/ramecc/hpl_ramecc.c"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="hpl/sercom/hpl_sercom.c"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="stdio_start.c"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="stdio_start.h"/>
|
||||||
|
<file category="header" condition="ARMCC, GCC, IAR" name="atmel_start.h"/>
|
||||||
|
<file category="source" condition="ARMCC, GCC, IAR" name="atmel_start.c"/>
|
||||||
|
<file attr="config" category="header" condition="ARMCC, GCC, IAR" name="config/hpl_cmcc_config.h"/>
|
||||||
|
<file attr="config" category="header" condition="ARMCC, GCC, IAR" name="config/hpl_dmac_config.h"/>
|
||||||
|
<file attr="config" category="header" condition="ARMCC, GCC, IAR" name="config/hpl_gclk_config.h"/>
|
||||||
|
<file attr="config" category="header" condition="ARMCC, GCC, IAR" name="config/hpl_mclk_config.h"/>
|
||||||
|
<file attr="config" category="header" condition="ARMCC, GCC, IAR" name="config/hpl_osc32kctrl_config.h"/>
|
||||||
|
<file attr="config" category="header" condition="ARMCC, GCC, IAR" name="config/hpl_oscctrl_config.h"/>
|
||||||
|
<file attr="config" category="header" condition="ARMCC, GCC, IAR" name="config/hpl_port_config.h"/>
|
||||||
|
<file attr="config" category="header" condition="ARMCC, GCC, IAR" name="config/hpl_sercom_config.h"/>
|
||||||
|
<file attr="config" category="header" condition="ARMCC, GCC, IAR" name="config/peripheral_clk_config.h"/>
|
||||||
|
<file attr="config" category="header" condition="ARMCC, GCC, IAR" name="config/stdio_redirect_config.h"/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name=""/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name="config"/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name="examples"/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name="hal/include"/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name="hal/utils/include"/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name="hpl/cmcc"/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name="hpl/core"/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name="hpl/dmac"/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name="hpl/gclk"/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name="hpl/mclk"/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name="hpl/osc32kctrl"/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name="hpl/oscctrl"/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name="hpl/pm"/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name="hpl/port"/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name="hpl/ramecc"/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name="hpl/sercom"/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name="hri"/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name=""/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name="config"/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name="stdio_redirect"/>
|
||||||
|
<file category="include" condition="ARMCC, GCC, IAR" name=""/>
|
||||||
|
</files>
|
||||||
|
</component>
|
||||||
|
</components>
|
||||||
|
</package>
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,270 @@
|
||||||
|
/*
|
||||||
|
* AS5048A.c
|
||||||
|
*
|
||||||
|
* Created: 10/07/2021 15:40:53
|
||||||
|
* Author: Nick-XMG
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read a register from the sensor
|
||||||
|
* Takes the address of the register as a 16 bit word
|
||||||
|
* Returns the value of the register
|
||||||
|
|
||||||
|
**
|
||||||
|
* Utility function used to calculate even parity of word
|
||||||
|
*/
|
||||||
|
|
||||||
|
static const float AS5048A_MAX_VALUE = 8191.0;
|
||||||
|
|
||||||
|
#include "AS5048A.h"
|
||||||
|
|
||||||
|
uint8_t errorFlag = 0;
|
||||||
|
|
||||||
|
bool AS5048A_init(void){
|
||||||
|
if(spi_m_sync_get_io_descriptor(&SPI_0, &io)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
spi_m_sync_set_mode(&SPI_0,SPI_MODE_1);
|
||||||
|
spi_m_sync_enable(&SPI_0);
|
||||||
|
|
||||||
|
as5048a.errorFlag = 0;
|
||||||
|
as5048a.position = 0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t spiCalcEvenParity(uint16_t value){
|
||||||
|
uint8_t cnt = 0;
|
||||||
|
uint8_t i;
|
||||||
|
for (i = 0; i < 16; i++)
|
||||||
|
{
|
||||||
|
if (value & 0x1)
|
||||||
|
{
|
||||||
|
cnt++;
|
||||||
|
}
|
||||||
|
value >>= 1;
|
||||||
|
}
|
||||||
|
return cnt & 0x1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
uint16_t read(uint16_t registerAddress)
|
||||||
|
{
|
||||||
|
uint8_t dummy_packet[2] = {0xC0,0x00};
|
||||||
|
union { uint16_t val; struct { uint8_t lsb; uint8_t msb; }; } t;
|
||||||
|
uint8_t in_buf[2], out_buf[2];
|
||||||
|
|
||||||
|
volatile uint16_t command = 0b0100000000000000; // PAR=0 R/W=R
|
||||||
|
command = command | registerAddress;
|
||||||
|
|
||||||
|
//Add a parity bit on the the MSB
|
||||||
|
command |= ((uint16_t)spiCalcEvenParity(command)<<15);
|
||||||
|
|
||||||
|
//Split the command into two bytes
|
||||||
|
out_buf[1] = command & 0xFF;
|
||||||
|
out_buf[0] = ( command >> 8 ) & 0xFF;
|
||||||
|
|
||||||
|
struct spi_xfer xfer;
|
||||||
|
xfer.rxbuf = in_buf;
|
||||||
|
xfer.txbuf = out_buf;
|
||||||
|
xfer.size = 2;
|
||||||
|
|
||||||
|
|
||||||
|
/* Send Command */
|
||||||
|
gpio_set_pin_level(AS5048A_CS, false);
|
||||||
|
//io_write(io, &out_buf, 2);
|
||||||
|
spi_m_sync_transfer(&SPI_0, &xfer);
|
||||||
|
gpio_set_pin_level(AS5048A_CS, true);
|
||||||
|
// spi_m_sync_transfer(&SPI_0, &xfer);
|
||||||
|
//HAL_SPI_Transmit(_spi, (uint8_t *)&data, 2, 0xFFFF);
|
||||||
|
////while (HAL_SPI_GetState(_spi) != HAL_SPI_STATE_READY) {}
|
||||||
|
//gpio_set_pin_level(AS5048A_CS, true);
|
||||||
|
//delay_us(1);
|
||||||
|
//gpio_set_pin_level(AS5048A_CS, false);
|
||||||
|
////xfer.txbuf = dummy_packet;
|
||||||
|
//spi_m_sync_transfer(&SPI_0, &xfer);
|
||||||
|
/////* Send dummy data to get reply */
|
||||||
|
//gpio_set_pin_level(AS5048A_CS, true);
|
||||||
|
//////xfer.txbuf[0] = 0x00;
|
||||||
|
//////xfer.txbuf[1] = 0x00;
|
||||||
|
//////spi_m_sync_transfer(&SPI_0, &xfer);
|
||||||
|
//////HAL_SPI_Receive(_spi, (uint8_t *)&data, 2, 0xFFFF);
|
||||||
|
//////while (HAL_SPI_GetState(_spi) != HAL_SPI_STATE_READY) {}
|
||||||
|
////gpio_set_pin_level(AS5048A_CS, true);
|
||||||
|
|
||||||
|
if (in_buf[1] & 0x40) {
|
||||||
|
as5048a.errorFlag = 1;
|
||||||
|
} else {
|
||||||
|
as5048a.errorFlag = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Return the data, stripping the parity and error bits
|
||||||
|
|
||||||
|
//return (in_buf[1]<<8u)|in_buf[0];
|
||||||
|
//return (( ( data[1] & 0xFF ) << 8 ) | ( data[0] & 0xFF )) & ~0xC000;
|
||||||
|
return (( ( in_buf[1] & 0xFF ) << 8 ) | ( in_buf[0] & 0xFF )) & ~0xC000;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Write to a register
|
||||||
|
* Takes the 16-bit address of the target register and the 16 bit word of data
|
||||||
|
* to be written to that register
|
||||||
|
* Returns the value of the register after the write has been performed. This
|
||||||
|
* is read back from the sensor to ensure a sucessful write.
|
||||||
|
*/
|
||||||
|
//uint16_t write(uint16_t registerAddress, uint16_t data) {
|
||||||
|
//
|
||||||
|
//uint8_t dat[2];
|
||||||
|
//
|
||||||
|
//uint16_t command = 0b0000000000000000; // PAR=0 R/W=W
|
||||||
|
//command |= registerAddress;
|
||||||
|
//
|
||||||
|
////Add a parity bit on the the MSB
|
||||||
|
//command |= ((uint16_t)spiCalcEvenParity(command)<<15);
|
||||||
|
//
|
||||||
|
////Split the command into two bytes
|
||||||
|
//dat[1] = command & 0xFF;
|
||||||
|
//dat[0] = ( command >> 8 ) & 0xFF;
|
||||||
|
//
|
||||||
|
////Start the write command with the target address
|
||||||
|
//EN_SPI;
|
||||||
|
//HAL_SPI_Transmit(_spi, (uint8_t *)&dat, 2, 0xFFFF);
|
||||||
|
//while (HAL_SPI_GetState(_spi) != HAL_SPI_STATE_READY) {}
|
||||||
|
//DIS_SPI;
|
||||||
|
//
|
||||||
|
//uint16_t dataToSend = 0b0000000000000000;
|
||||||
|
//dataToSend |= data;
|
||||||
|
//
|
||||||
|
////Craft another packet including the data and parity
|
||||||
|
//dataToSend |= ((uint16_t)spiCalcEvenParity(dataToSend)<<15);
|
||||||
|
//dat[1] = command & 0xFF;
|
||||||
|
//dat[0] = ( command >> 8 ) & 0xFF;
|
||||||
|
//
|
||||||
|
////Now send the data packet
|
||||||
|
//EN_SPI;
|
||||||
|
//HAL_SPI_Transmit(_spi, (uint8_t *)&dat, 2, 0xFFFF);
|
||||||
|
//while (HAL_SPI_GetState(_spi) != HAL_SPI_STATE_READY) {}
|
||||||
|
//DIS_SPI;
|
||||||
|
//
|
||||||
|
////Send a NOP to get the new data in the register
|
||||||
|
//dat[1] = 0x00;
|
||||||
|
//dat[0] = 0x00;
|
||||||
|
//EN_SPI;
|
||||||
|
//HAL_SPI_Transmit(_spi, (uint8_t *)&dat, 2, 0xFFFF);
|
||||||
|
//while (HAL_SPI_GetState(_spi) != HAL_SPI_STATE_READY) {}
|
||||||
|
//HAL_SPI_Receive(_spi, (uint8_t *)&dat, 2, 0xFFFF);
|
||||||
|
//while (HAL_SPI_GetState(_spi) != HAL_SPI_STATE_READY) {}
|
||||||
|
//DIS_SPI;
|
||||||
|
//
|
||||||
|
////Return the data, stripping the parity and error bits
|
||||||
|
//return (( ( dat[1] & 0xFF ) << 8 ) | ( dat[0] & 0xFF )) & ~0xC000;
|
||||||
|
//}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the raw angle directly from the sensor
|
||||||
|
*/
|
||||||
|
uint16_t getRawRotation(){
|
||||||
|
return read(AS5048A_ANGLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the rotation of the sensor relative to the zero position.
|
||||||
|
*
|
||||||
|
* @return {int} between -2^13 and 2^13
|
||||||
|
*/
|
||||||
|
int getRotation(){
|
||||||
|
volatile uint16_t data;
|
||||||
|
volatile int rotation;
|
||||||
|
|
||||||
|
data = getRawRotation();
|
||||||
|
rotation = (int)data - (int)as5048a.position;
|
||||||
|
if(rotation > 8191) rotation = -((0x3FFF)-rotation); //more than -180
|
||||||
|
//if(rotation < -0x1FFF) rotation = rotation+0x3FFF;
|
||||||
|
|
||||||
|
return rotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns the value of the state register
|
||||||
|
* @return 16 bit word containing flags
|
||||||
|
*/
|
||||||
|
uint16_t getState(){
|
||||||
|
return read(AS5048A_DIAG_AGC);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check if an error has been encountered.
|
||||||
|
*/
|
||||||
|
uint8_t error(){
|
||||||
|
return errorFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value used for Automatic Gain Control (Part of diagnostic
|
||||||
|
* register)
|
||||||
|
*/
|
||||||
|
uint8_t getGain(){
|
||||||
|
uint16_t data = getState();
|
||||||
|
return (uint8_t) data & 0xFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get and clear the error register by reading it
|
||||||
|
*/
|
||||||
|
uint16_t getErrors(){
|
||||||
|
return read(AS5048A_CLEAR_ERROR_FLAG);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set the zero AS5048A.position
|
||||||
|
*/
|
||||||
|
void setZeroPosition(uint16_t arg_position){
|
||||||
|
as5048a.position = arg_position % 0x3FFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns the current zero AS5048A.position
|
||||||
|
*/
|
||||||
|
uint16_t getZeroPosition(){
|
||||||
|
return as5048a.position;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns normalized angle value
|
||||||
|
*/
|
||||||
|
float normalize(float angle) {
|
||||||
|
// http://stackoverflow.com/a/11498248/3167294
|
||||||
|
#ifdef ANGLE_MODE_1
|
||||||
|
angle += 180;
|
||||||
|
#endif
|
||||||
|
angle = fmod(angle, 360);
|
||||||
|
if (angle < 0) {
|
||||||
|
angle += 360;
|
||||||
|
}
|
||||||
|
#ifdef ANGLE_MODE_1
|
||||||
|
angle -= 180;
|
||||||
|
#endif
|
||||||
|
return angle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns calculated angle value
|
||||||
|
*/
|
||||||
|
float read2angle(uint16_t angle) {
|
||||||
|
/*
|
||||||
|
* 14 bits = 2^(14) - 1 = 16.383
|
||||||
|
*
|
||||||
|
* https://www.arduino.cc/en/Reference/Map
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
return (float)angle * ((float)360 / 16383);
|
||||||
|
};
|
||||||
|
|
||||||
|
float getRotationInDegrees()
|
||||||
|
{
|
||||||
|
int16_t rotation = getRotation();
|
||||||
|
float degrees = 360.0 * (rotation + AS5048A_MAX_VALUE) / (AS5048A_MAX_VALUE * 2.0);
|
||||||
|
printf("%f\r\n", degrees);
|
||||||
|
return degrees;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
|
||||||
|
#ifndef AS5048A_H
|
||||||
|
#define AS5048A_H
|
||||||
|
|
||||||
|
#include <atmel_start.h>
|
||||||
|
|
||||||
|
|
||||||
|
struct io_descriptor *io;
|
||||||
|
|
||||||
|
#define AS5048A_MISO GPIO(GPIO_PORTB, 29)
|
||||||
|
#define AS5048A_MOSI GPIO(GPIO_PORTB, 27)
|
||||||
|
#define AS5048A_SCK GPIO(GPIO_PORTB, 26)
|
||||||
|
#define AS5048A_CS GPIO(GPIO_PORTB, 28)
|
||||||
|
|
||||||
|
#define AS5048A_CMD_NOP 0x0000
|
||||||
|
#define AS5048A_READ 0x4000
|
||||||
|
#define AS5048A_CLEAR_ERROR_FLAG 0x0001
|
||||||
|
#define AS5048A_PROGRAMMING_CONTROL 0x0003
|
||||||
|
#define AS5048A_OTP_REGISTER_ZERO_POS_HIGH 0x0016
|
||||||
|
#define AS5048A_OTP_REGISTER_ZERO_POS_LOW 0x0017
|
||||||
|
#define AS5048A_DIAG_AGC 0x3FFD
|
||||||
|
#define AS5048A_MAGNITUDE 0x3FFE
|
||||||
|
#define AS5048A_ANGLE 0x3FFF
|
||||||
|
|
||||||
|
bool AS5048A_init(void);
|
||||||
|
uint8_t spiCalcEvenParity(uint16_t value);
|
||||||
|
uint16_t read(uint16_t registerAddress);
|
||||||
|
uint16_t getRawRotation();
|
||||||
|
uint8_t getGain();
|
||||||
|
uint16_t getErrors();
|
||||||
|
void setZeroPosition(uint16_t arg_position);
|
||||||
|
uint16_t getZeroPosition();
|
||||||
|
float normalize(float angle);
|
||||||
|
float read2angle(uint16_t angle);
|
||||||
|
uint16_t getState();
|
||||||
|
|
||||||
|
struct AS5048A {
|
||||||
|
uint8_t errorFlag;
|
||||||
|
uint16_t position;
|
||||||
|
} as5048a;
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,169 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
|
||||||
|
<ProjectComponents>
|
||||||
|
<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
|
||||||
|
<CApiVersion></CApiVersion>
|
||||||
|
<CBundle></CBundle>
|
||||||
|
<CClass>CMSIS</CClass>
|
||||||
|
<CGroup>CORE</CGroup>
|
||||||
|
<CSub></CSub>
|
||||||
|
<CVariant></CVariant>
|
||||||
|
<CVendor>ARM</CVendor>
|
||||||
|
<CVersion>5.1.2</CVersion>
|
||||||
|
<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
|
||||||
|
<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
|
||||||
|
<Description></Description>
|
||||||
|
<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
|
||||||
|
<d4p1:anyType i:type="FileInfo">
|
||||||
|
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\CMSIS\5.4.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
|
||||||
|
<Attribute></Attribute>
|
||||||
|
<Category>doc</Category>
|
||||||
|
<Condition></Condition>
|
||||||
|
<FileContentHash i:nil="true" />
|
||||||
|
<FileVersion></FileVersion>
|
||||||
|
<Name>CMSIS/Documentation/Core/html/index.html</Name>
|
||||||
|
<SelectString></SelectString>
|
||||||
|
<SourcePath></SourcePath>
|
||||||
|
</d4p1:anyType>
|
||||||
|
<d4p1:anyType i:type="FileInfo">
|
||||||
|
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\CMSIS\5.4.0\CMSIS\Core\Include\</AbsolutePath>
|
||||||
|
<Attribute></Attribute>
|
||||||
|
<Category>include</Category>
|
||||||
|
<Condition></Condition>
|
||||||
|
<FileContentHash i:nil="true" />
|
||||||
|
<FileVersion></FileVersion>
|
||||||
|
<Name>CMSIS/Core/Include/</Name>
|
||||||
|
<SelectString></SelectString>
|
||||||
|
<SourcePath></SourcePath>
|
||||||
|
</d4p1:anyType>
|
||||||
|
</Files>
|
||||||
|
<PackName>CMSIS</PackName>
|
||||||
|
<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/CMSIS/5.4.0/ARM.CMSIS.pdsc</PackPath>
|
||||||
|
<PackVersion>5.4.0</PackVersion>
|
||||||
|
<PresentInProject>true</PresentInProject>
|
||||||
|
<ReferenceConditionId>ARMv6_7_8-M Device</ReferenceConditionId>
|
||||||
|
<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
|
||||||
|
<d4p1:string></d4p1:string>
|
||||||
|
</RteComponents>
|
||||||
|
<Status>Resolved</Status>
|
||||||
|
<VersionMode>Fixed</VersionMode>
|
||||||
|
<IsComponentInAtProject>true</IsComponentInAtProject>
|
||||||
|
</ProjectComponent>
|
||||||
|
<ProjectComponent z:Id="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
|
||||||
|
<CApiVersion></CApiVersion>
|
||||||
|
<CBundle></CBundle>
|
||||||
|
<CClass>Device</CClass>
|
||||||
|
<CGroup>Startup</CGroup>
|
||||||
|
<CSub></CSub>
|
||||||
|
<CVariant></CVariant>
|
||||||
|
<CVendor>Atmel</CVendor>
|
||||||
|
<CVersion>1.1.0</CVersion>
|
||||||
|
<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
|
||||||
|
<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
|
||||||
|
<d4p1:anyType z:Ref="i1" />
|
||||||
|
</DependentComponents>
|
||||||
|
<Description></Description>
|
||||||
|
<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
|
||||||
|
<d4p1:anyType i:type="FileInfo">
|
||||||
|
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAME54_DFP\1.1.134\include</AbsolutePath>
|
||||||
|
<Attribute></Attribute>
|
||||||
|
<Category>include</Category>
|
||||||
|
<Condition>C</Condition>
|
||||||
|
<FileContentHash i:nil="true" />
|
||||||
|
<FileVersion></FileVersion>
|
||||||
|
<Name>include</Name>
|
||||||
|
<SelectString></SelectString>
|
||||||
|
<SourcePath></SourcePath>
|
||||||
|
</d4p1:anyType>
|
||||||
|
<d4p1:anyType i:type="FileInfo">
|
||||||
|
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAME54_DFP\1.1.134\include\sam.h</AbsolutePath>
|
||||||
|
<Attribute></Attribute>
|
||||||
|
<Category>header</Category>
|
||||||
|
<Condition>C</Condition>
|
||||||
|
<FileContentHash>8A8bci0EePdi0b+8Lluv4A==</FileContentHash>
|
||||||
|
<FileVersion></FileVersion>
|
||||||
|
<Name>include/sam.h</Name>
|
||||||
|
<SelectString></SelectString>
|
||||||
|
<SourcePath></SourcePath>
|
||||||
|
</d4p1:anyType>
|
||||||
|
<d4p1:anyType i:type="FileInfo">
|
||||||
|
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAME54_DFP\1.1.134\templates\main.c</AbsolutePath>
|
||||||
|
<Attribute>template</Attribute>
|
||||||
|
<Category>source</Category>
|
||||||
|
<Condition>C Exe</Condition>
|
||||||
|
<FileContentHash>XM3tW0X9p/jxE2KrHZ3m5g==</FileContentHash>
|
||||||
|
<FileVersion></FileVersion>
|
||||||
|
<Name>templates/main.c</Name>
|
||||||
|
<SelectString>Main file (.c)</SelectString>
|
||||||
|
<SourcePath></SourcePath>
|
||||||
|
</d4p1:anyType>
|
||||||
|
<d4p1:anyType i:type="FileInfo">
|
||||||
|
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAME54_DFP\1.1.134\templates\main.cpp</AbsolutePath>
|
||||||
|
<Attribute>template</Attribute>
|
||||||
|
<Category>source</Category>
|
||||||
|
<Condition>C Exe</Condition>
|
||||||
|
<FileContentHash>Wwcf/gxegRQ10+cCzYcFIw==</FileContentHash>
|
||||||
|
<FileVersion></FileVersion>
|
||||||
|
<Name>templates/main.cpp</Name>
|
||||||
|
<SelectString>Main file (.cpp)</SelectString>
|
||||||
|
<SourcePath></SourcePath>
|
||||||
|
</d4p1:anyType>
|
||||||
|
<d4p1:anyType i:type="FileInfo">
|
||||||
|
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAME54_DFP\1.1.134\gcc\system_same54.c</AbsolutePath>
|
||||||
|
<Attribute>config</Attribute>
|
||||||
|
<Category>source</Category>
|
||||||
|
<Condition>GCC Exe</Condition>
|
||||||
|
<FileContentHash>13EKFJ9ZysfwBWEbJglN5Q==</FileContentHash>
|
||||||
|
<FileVersion></FileVersion>
|
||||||
|
<Name>gcc/system_same54.c</Name>
|
||||||
|
<SelectString></SelectString>
|
||||||
|
<SourcePath></SourcePath>
|
||||||
|
</d4p1:anyType>
|
||||||
|
<d4p1:anyType i:type="FileInfo">
|
||||||
|
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAME54_DFP\1.1.134\gcc\gcc\startup_same54.c</AbsolutePath>
|
||||||
|
<Attribute>config</Attribute>
|
||||||
|
<Category>source</Category>
|
||||||
|
<Condition>GCC Exe</Condition>
|
||||||
|
<FileContentHash>hvyBThCuEBmDbH8Yhxa2Jw==</FileContentHash>
|
||||||
|
<FileVersion></FileVersion>
|
||||||
|
<Name>gcc/gcc/startup_same54.c</Name>
|
||||||
|
<SelectString></SelectString>
|
||||||
|
<SourcePath></SourcePath>
|
||||||
|
</d4p1:anyType>
|
||||||
|
<d4p1:anyType i:type="FileInfo">
|
||||||
|
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAME54_DFP\1.1.134\gcc\gcc\same54p20a_flash.ld</AbsolutePath>
|
||||||
|
<Attribute>config</Attribute>
|
||||||
|
<Category>linkerScript</Category>
|
||||||
|
<Condition>GCC Exe</Condition>
|
||||||
|
<FileContentHash>KxZPrZpayTyit24vDXKm8w==</FileContentHash>
|
||||||
|
<FileVersion></FileVersion>
|
||||||
|
<Name>gcc/gcc/same54p20a_flash.ld</Name>
|
||||||
|
<SelectString></SelectString>
|
||||||
|
<SourcePath></SourcePath>
|
||||||
|
</d4p1:anyType>
|
||||||
|
<d4p1:anyType i:type="FileInfo">
|
||||||
|
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAME54_DFP\1.1.134\gcc\gcc\same54p20a_sram.ld</AbsolutePath>
|
||||||
|
<Attribute>config</Attribute>
|
||||||
|
<Category>other</Category>
|
||||||
|
<Condition>GCC Exe</Condition>
|
||||||
|
<FileContentHash>+7n8kxIwTIMsWzB2gEYtIg==</FileContentHash>
|
||||||
|
<FileVersion></FileVersion>
|
||||||
|
<Name>gcc/gcc/same54p20a_sram.ld</Name>
|
||||||
|
<SelectString></SelectString>
|
||||||
|
<SourcePath></SourcePath>
|
||||||
|
</d4p1:anyType>
|
||||||
|
</Files>
|
||||||
|
<PackName>SAME54_DFP</PackName>
|
||||||
|
<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAME54_DFP/1.1.134/Atmel.SAME54_DFP.pdsc</PackPath>
|
||||||
|
<PackVersion>1.1.134</PackVersion>
|
||||||
|
<PresentInProject>true</PresentInProject>
|
||||||
|
<ReferenceConditionId>ATSAME54P20A</ReferenceConditionId>
|
||||||
|
<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
|
||||||
|
<d4p1:string></d4p1:string>
|
||||||
|
</RteComponents>
|
||||||
|
<Status>Resolved</Status>
|
||||||
|
<VersionMode>Fixed</VersionMode>
|
||||||
|
<IsComponentInAtProject>true</IsComponentInAtProject>
|
||||||
|
</ProjectComponent>
|
||||||
|
</ProjectComponents>
|
||||||
|
</Store>
|
|
@ -0,0 +1,886 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
|
||||||
|
<PropertyGroup>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<ProjectVersion>7.0</ProjectVersion>
|
||||||
|
<ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
|
||||||
|
<ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
|
||||||
|
<avrdevice>ATSAME54P20A</avrdevice>
|
||||||
|
<avrdeviceseries>none</avrdeviceseries>
|
||||||
|
<OutputType>Executable</OutputType>
|
||||||
|
<Language>C</Language>
|
||||||
|
<OutputFileName>$(MSBuildProjectName)</OutputFileName>
|
||||||
|
<OutputFileExtension>.elf</OutputFileExtension>
|
||||||
|
<OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
|
||||||
|
<AssemblyName>AS5048A_test</AssemblyName>
|
||||||
|
<Name>AS5048A_test</Name>
|
||||||
|
<RootNamespace>AS5048A_test</RootNamespace>
|
||||||
|
<ToolchainFlavour>Native</ToolchainFlavour>
|
||||||
|
<KeepTimersRunning>true</KeepTimersRunning>
|
||||||
|
<OverrideVtor>false</OverrideVtor>
|
||||||
|
<CacheFlash>true</CacheFlash>
|
||||||
|
<ProgFlashFromRam>true</ProgFlashFromRam>
|
||||||
|
<RamSnippetAddress>0x20000000</RamSnippetAddress>
|
||||||
|
<UncachedRange />
|
||||||
|
<preserveEEPROM>true</preserveEEPROM>
|
||||||
|
<OverrideVtorValue>exception_table</OverrideVtorValue>
|
||||||
|
<BootSegment>2</BootSegment>
|
||||||
|
<ResetRule>0</ResetRule>
|
||||||
|
<eraseonlaunchrule>0</eraseonlaunchrule>
|
||||||
|
<EraseKey />
|
||||||
|
<AsfFrameworkConfig>
|
||||||
|
<framework-data xmlns="">
|
||||||
|
<options />
|
||||||
|
<configurations />
|
||||||
|
<files />
|
||||||
|
<documentation help="" />
|
||||||
|
<offline-documentation help="" />
|
||||||
|
<dependencies>
|
||||||
|
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.49.1" />
|
||||||
|
</dependencies>
|
||||||
|
</framework-data>
|
||||||
|
</AsfFrameworkConfig>
|
||||||
|
<Compiler>gcc</Compiler>
|
||||||
|
<atStartFilePath>.atmelstart\atmel_start_config.atstart</atStartFilePath>
|
||||||
|
<GpdscFilePath>.atmelstart\AtmelStart.gpdsc</GpdscFilePath>
|
||||||
|
<AcmeProjectConfig>
|
||||||
|
<AcmeProjectConfig>
|
||||||
|
<TopLevelComponents>
|
||||||
|
<AcmeProjectComponent IsAutoGenerated="false" CClass="AtmelStart" Cgroup="Framework" CVersion="1.0.0" />
|
||||||
|
<AcmeProjectComponent IsAutoGenerated="false" CClass="CMSIS" Cgroup="CORE" CVersion="5.1.2" />
|
||||||
|
<AcmeProjectComponent IsAutoGenerated="false" CClass="Device" Cgroup="Startup" CVersion="1.1.0" />
|
||||||
|
</TopLevelComponents>
|
||||||
|
<AcmeActionInfos>
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hal_atomic.h" IsConfig="false" Hash="dAg/XLzGqPqh12ZGWK6HLw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hal_cache.h" IsConfig="false" Hash="QZIIDRbUdkb2aDtNopQSOA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hal_delay.h" IsConfig="false" Hash="snalDV+S1QGquCV38zAdoA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hal_gpio.h" IsConfig="false" Hash="3mBEQ9Ix28YOArddDes83Q" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hal_init.h" IsConfig="false" Hash="OrYSVpF3YA5XrOBImWpdSg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hal_io.h" IsConfig="false" Hash="XZRSabc39WU/0MFBLYGLvQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hal_sleep.h" IsConfig="false" Hash="KuZDwgrLdU+fuMG82ZFTqg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hal_spi_m_sync.h" IsConfig="false" Hash="2oma6hRMCcowUy2wVveqMg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_cmcc.h" IsConfig="false" Hash="mDAHEzTxsniAe2HtqO43oA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_core.h" IsConfig="false" Hash="XeEtUlBSwXUmLA41hFYYWg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_delay.h" IsConfig="false" Hash="3tgjyGPrs0ePCewpMUQPbQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_dma.h" IsConfig="false" Hash="C3XG0wWxKLSRQVHSNMCgIQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_gpio.h" IsConfig="false" Hash="kGeglKjrgbcKZDOsM+XTrw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_i2c_m_async.h" IsConfig="false" Hash="2YKSxDd++st93P4wS0x3sw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_i2c_m_sync.h" IsConfig="false" Hash="9PBv4UnwhtkmG2PaLCX74Q" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_i2c_s_async.h" IsConfig="false" Hash="rC7cV+Zqg8W12ys0twQG1w" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_i2c_s_sync.h" IsConfig="false" Hash="JNLMe72Fd6Uy3vXkh8HGxg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_init.h" IsConfig="false" Hash="QtMCPnjBzySOYli3ce/dyQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_irq.h" IsConfig="false" Hash="n8mGC0gLHfUhVTjLflKVXw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_ramecc.h" IsConfig="false" Hash="jEqIEhx0d2x1jduY0A9CFQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_sleep.h" IsConfig="false" Hash="JOXa2/KqNtt950+B1ZJfSQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_spi.h" IsConfig="false" Hash="wAxvxvj1p/CvWEoawsWIBw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_spi_async.h" IsConfig="false" Hash="sUIART4unR3sm4AlXv5LlQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_spi_dma.h" IsConfig="false" Hash="y9HmqskArpKzCF7kgcY+IQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_spi_sync.h" IsConfig="false" Hash="Qr5slVYsVsngWiAyjLwx8A" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_usart.h" IsConfig="false" Hash="gkIcItnlv0v8NvwxEz9neA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/src/hal_atomic.c" IsConfig="false" Hash="jOsfB5ZnunjCPnUQXuXi9g" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/src/hal_cache.c" IsConfig="false" Hash="edUfxCb3WSV4Uu3oKUakCg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/src/hal_delay.c" IsConfig="false" Hash="vZ+YYOpHjTcAZaAaTE3Izg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/src/hal_gpio.c" IsConfig="false" Hash="wIzN9zQd1b8qd+RDoSkD7Q" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/src/hal_init.c" IsConfig="false" Hash="bJvq8kpNbbOE2nZfChOGTQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/src/hal_io.c" IsConfig="false" Hash="FYpavzYSxhFzVrBQtcH2ZA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/src/hal_sleep.c" IsConfig="false" Hash="3ebghfB3jYLpnqoi3fhq3g" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/utils/include/compiler.h" IsConfig="false" Hash="8BnWsmkWteo58vaF6VHKHA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/utils/include/err_codes.h" IsConfig="false" Hash="csatJsZ0ym9p7PojjaFNeQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/utils/include/events.h" IsConfig="false" Hash="hUr+KA59XIxyEvCEHvqMfQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/utils/include/utils.h" IsConfig="false" Hash="1IxXPPkdgxdipY/hgDJGvg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/utils/include/utils_assert.h" IsConfig="false" Hash="x4pgqiWbWCruSdQ+QA1P0A" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/utils/include/utils_event.h" IsConfig="false" Hash="+TRsXNENvtynhMSI1iJPZA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/utils/include/utils_increment_macro.h" IsConfig="false" Hash="yV2DDykoVCXX+XgiNyG+Sw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/utils/include/utils_list.h" IsConfig="false" Hash="60r34J7DkHyqgr2iqa6aXg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/utils/include/utils_repeat_macro.h" IsConfig="false" Hash="yidXppbw9HriaIIl6gVfEQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/utils/src/utils_assert.c" IsConfig="false" Hash="858+H2i44SFMGhFZ4+PSPw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/utils/src/utils_event.c" IsConfig="false" Hash="sR2eRthblYjlO/jHulP6aw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/utils/src/utils_list.c" IsConfig="false" Hash="rW6uwWgOnnMWzJjuYzxzZw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/utils/src/utils_syscalls.c" IsConfig="false" Hash="NaBnZufa6Sau3+tzlyR7Kw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_ac_e54.h" IsConfig="false" Hash="y6Jvvj/Cob45BC3nHprWHw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_adc_e54.h" IsConfig="false" Hash="NqwOa13FZwkE2Qmc67WaCA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_aes_e54.h" IsConfig="false" Hash="zgIsmxwXwk18UEu/NgDuqg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_can_e54.h" IsConfig="false" Hash="/VLFnz5wT+Rk16Oh3pDRFg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_ccl_e54.h" IsConfig="false" Hash="Tb/xnJy74UP9wE6szds0QA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_cmcc_e54.h" IsConfig="false" Hash="xbngy9Q1DPmApX5l8OBIfA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_dac_e54.h" IsConfig="false" Hash="BC/+OLfyz840mcgsF0AQlw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_dmac_e54.h" IsConfig="false" Hash="vhLN9Xx4g0WPA8ajjgzzZw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_dsu_e54.h" IsConfig="false" Hash="BgRKuo/Em6HXxr6/VOqziQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_e54.h" IsConfig="false" Hash="OwK9iE7HHPGD1iW1ba2nkA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_eic_e54.h" IsConfig="false" Hash="phCYLIuZs7KZ8kSBWzfjig" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_evsys_e54.h" IsConfig="false" Hash="+u7NNeyI6rs/iRrTj5jz6w" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_freqm_e54.h" IsConfig="false" Hash="AhOLLoJhnCWQVAApUA38wg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_gclk_e54.h" IsConfig="false" Hash="F9q2SDNt88kQgQ/oKtm1fQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_gmac_e54.h" IsConfig="false" Hash="wylm7wamnMXua6NQg26V1w" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_hmatrixb_e54.h" IsConfig="false" Hash="Xi+VCHtYc0uEyP4vwuDMTQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_i2s_e54.h" IsConfig="false" Hash="eBWMSsjJuFTsVY9+Px4MDQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_icm_e54.h" IsConfig="false" Hash="/jB+UsWaR9+5hxLiCpfMAw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_mclk_e54.h" IsConfig="false" Hash="QgKFDESLas7AG+W0YUQv0g" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_nvmctrl_e54.h" IsConfig="false" Hash="HECu2JR3HkIvS8X8yiA7YQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_osc32kctrl_e54.h" IsConfig="false" Hash="P+2P+0ROVbbcwmGrk4IAsg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_oscctrl_e54.h" IsConfig="false" Hash="beCrI5T3J734CKG/lzIQ5Q" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_pac_e54.h" IsConfig="false" Hash="zQqLMGI9YME0viRRWSKzvQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_pcc_e54.h" IsConfig="false" Hash="0EBnI8dDokiN54Vu2ICgmA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_pdec_e54.h" IsConfig="false" Hash="Rf8drgs7AJcVKMWrN3ciUw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_pm_e54.h" IsConfig="false" Hash="mQi6Lv1HiADQEwpBZiSYYg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_port_e54.h" IsConfig="false" Hash="G68p7SqFWeKsgWxKOzsjag" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_qspi_e54.h" IsConfig="false" Hash="R/u45b9+gBYU33StsPjneQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_ramecc_e54.h" IsConfig="false" Hash="kWInw/FGxvx4LXeyFKzP6w" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_rstc_e54.h" IsConfig="false" Hash="+rd9opaj/AjYf/UdRTgVJg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_rtc_e54.h" IsConfig="false" Hash="oRK9sHMhu1obvU3rRy1fcA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_sdhc_e54.h" IsConfig="false" Hash="wPVt7ZuDzYgUqP0sjlZ/sQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_sercom_e54.h" IsConfig="false" Hash="Ow3s/urk3meEjxlgeanaYw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_supc_e54.h" IsConfig="false" Hash="e78TEc/bBXnnZv+JLiMnNw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_tc_e54.h" IsConfig="false" Hash="SBogVzcw9xnWaCSMRqRg9Q" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_tcc_e54.h" IsConfig="false" Hash="ZzT/VD/VBFBFT8eyDbsyhg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_trng_e54.h" IsConfig="false" Hash="R3m9qAqgpkl9Ay6TqH3M2A" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_usb_e54.h" IsConfig="false" Hash="I+Mpxa40hh4o1NE68Zi5Gg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hri/hri_wdt_e54.h" IsConfig="false" Hash="CfZas1TGXPKWyHJU+xHJ7A" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="stdio_redirect/gcc/read.c" IsConfig="false" Hash="965gzdOr4sfKJQ4OpEJN/g" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="stdio_redirect/gcc/write.c" IsConfig="false" Hash="gCAVrSOZuCMZ84vNa/WFxA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="stdio_redirect/iar/read.c" IsConfig="false" Hash="IpkgLxXTg/nDat19kCJ3gw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="stdio_redirect/iar/write.c" IsConfig="false" Hash="JTD9ZyU1GAbpub8mamr/ZA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="stdio_redirect/keil/Retarget.c" IsConfig="false" Hash="NzdDPGuEvGimitFm3wVXxw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="stdio_redirect/stdio_io.c" IsConfig="false" Hash="Nx8PfIAymK/f5AjLql/CyQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="stdio_redirect/stdio_io.h" IsConfig="false" Hash="4X02f8UL8cjBHeGJM3BnHw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="main.c" IsConfig="false" Hash="k0AH7j+BrmdFhBPzCCMptA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="driver_init.c" IsConfig="false" Hash="YY6vPpiyDxSIT1+YpzM7Kw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="driver_init.h" IsConfig="false" Hash="HHGaPRA14zpRrZmWNf1CpA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="atmel_start_pins.h" IsConfig="false" Hash="M5pyeMRZyoPpiWeIh6Kfwg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="examples/driver_examples.h" IsConfig="false" Hash="Rmw7b009Kyb5JTTerAW1RA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="examples/driver_examples.c" IsConfig="false" Hash="UJMLSdu355whTkvhArrZiQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hal_usart_sync.h" IsConfig="false" Hash="ZzIGSRyjZuxRzFAtNNt7sw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_missing_features.h" IsConfig="false" Hash="XsAvpgfutzkw0Y5SydYFaw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_reset.h" IsConfig="false" Hash="WwLFRlBtuZ/qnD1JuDKnRQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_spi_m_async.h" IsConfig="false" Hash="JyMw9jeJO0jGqfT03txHXQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_spi_m_dma.h" IsConfig="false" Hash="OoU5yflSLAc5VbWSzixnvg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_spi_m_sync.h" IsConfig="false" Hash="s1GhyLjhjIsfqixooG3LFA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_spi_s_async.h" IsConfig="false" Hash="ptPiaJ1lVqH5794NmOHDFQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_spi_s_sync.h" IsConfig="false" Hash="gEGr6GqKbsOQvxQYz2fotA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_usart_async.h" IsConfig="false" Hash="tBfmk3BN3Q1WbYVoWDbsJw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/include/hpl_usart_sync.h" IsConfig="false" Hash="Yj+PoPxG2CqDOy5XoIWkwg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/src/hal_spi_m_sync.c" IsConfig="false" Hash="Q0IudnTEWeoIkfQIoYIqxA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/src/hal_usart_sync.c" IsConfig="false" Hash="VBVlAmBFEYTTUMHeIRFSxg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hal/utils/include/parts.h" IsConfig="false" Hash="THMC0T2wU10PzPgIVGK93g" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hpl/cmcc/hpl_cmcc.c" IsConfig="false" Hash="xrdKSj3ppVwQWgZ3zrlaRg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hpl/core/hpl_core_m4.c" IsConfig="false" Hash="VG4QALndju794J3HSKhsEQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hpl/core/hpl_core_port.h" IsConfig="false" Hash="RXrDMMracCeflR1F9jWiGg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hpl/core/hpl_init.c" IsConfig="false" Hash="/W7xK3rVKLxPEwN+aiJq8Q" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hpl/dmac/hpl_dmac.c" IsConfig="false" Hash="RW/GgakK2RoVdDBtrCxYaA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hpl/gclk/hpl_gclk.c" IsConfig="false" Hash="5XO/19EedZQ0lq6yB8UTWQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hpl/gclk/hpl_gclk_base.h" IsConfig="false" Hash="VnaHvu/VnbGvOxrehrp2mQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hpl/mclk/hpl_mclk.c" IsConfig="false" Hash="XNSKHdNpSWfkSJUMnJUASA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hpl/osc32kctrl/hpl_osc32kctrl.c" IsConfig="false" Hash="DhXWWfpRGQtwitQ9mkvXcw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hpl/oscctrl/hpl_oscctrl.c" IsConfig="false" Hash="5M03DGDFwRTEFXtPRflGFA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hpl/pm/hpl_pm.c" IsConfig="false" Hash="bcht9HqY6EFL6gVGYXeVfQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hpl/pm/hpl_pm_base.h" IsConfig="false" Hash="KOec1StxUZxY/RKBDbMkpg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hpl/port/hpl_gpio_base.h" IsConfig="false" Hash="tEjgvZ4kvfccSWnEgilG5Q" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hpl/ramecc/hpl_ramecc.c" IsConfig="false" Hash="pMdmwVWBg16VG8HOwA3DPw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="hpl/sercom/hpl_sercom.c" IsConfig="false" Hash="CjIu1Ksl4k1CotxZpVcqMA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="stdio_start.c" IsConfig="false" Hash="WtwT7ld+0j4cPDj52v3y1A" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="stdio_start.h" IsConfig="false" Hash="5j2k69zdoQpbzluEyr/rHQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="atmel_start.h" IsConfig="false" Hash="TNU9VszFRFbDuMJ3vToUzg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="atmel_start.c" IsConfig="false" Hash="lom1/YOY9m/TDACgnyb3yA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="config/hpl_cmcc_config.h" IsConfig="true" Hash="bmtxQ8rLloaRtAo2HeXZRQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="config/hpl_dmac_config.h" IsConfig="true" Hash="mNec32O7w53e4vDmQlvjCA" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="config/hpl_gclk_config.h" IsConfig="true" Hash="qFfXbIiu7Skw/l5fYsEt7Q" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="config/hpl_mclk_config.h" IsConfig="true" Hash="pxBzoQXTG66x4dbzVzxteg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="config/hpl_osc32kctrl_config.h" IsConfig="true" Hash="HgvzEqDUH4jq/syjj/+G+Q" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="config/hpl_oscctrl_config.h" IsConfig="true" Hash="uzEpFoaBTLlpyWknL/fmxg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="config/hpl_port_config.h" IsConfig="true" Hash="5iQ/eeupKkHFkYA/g43bXQ" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="config/hpl_sercom_config.h" IsConfig="true" Hash="4cR+7kwM1FGXaHKzMryPIw" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="config/peripheral_clk_config.h" IsConfig="true" Hash="zg2vMh4Usy8Jbwc/RH3Ljg" />
|
||||||
|
<AcmeProjectActionInfo Action="File" Source="config/stdio_redirect_config.h" IsConfig="true" Hash="CKmkBk12sfr7mb+HRQBuzg" />
|
||||||
|
</AcmeActionInfos>
|
||||||
|
<NonsecureFilesInfo />
|
||||||
|
</AcmeProjectConfig>
|
||||||
|
</AcmeProjectConfig>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||||
|
<ToolchainSettings>
|
||||||
|
<ArmGcc>
|
||||||
|
<armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
|
||||||
|
<armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
|
||||||
|
<armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
|
||||||
|
<armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
|
||||||
|
<armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
|
||||||
|
<armgcc.compiler.symbols.DefSymbols>
|
||||||
|
<ListValues>
|
||||||
|
<Value>NDEBUG</Value>
|
||||||
|
</ListValues>
|
||||||
|
</armgcc.compiler.symbols.DefSymbols>
|
||||||
|
<armgcc.compiler.directories.IncludePaths>
|
||||||
|
<ListValues>
|
||||||
|
<Value>%24(PackRepoDir)\arm\CMSIS\5.4.0\CMSIS\Core\Include\</Value>
|
||||||
|
<Value>../Config</Value>
|
||||||
|
<Value>../</Value>
|
||||||
|
<Value>../examples</Value>
|
||||||
|
<Value>../hal/include</Value>
|
||||||
|
<Value>../hal/utils/include</Value>
|
||||||
|
<Value>../hpl/cmcc</Value>
|
||||||
|
<Value>../hpl/core</Value>
|
||||||
|
<Value>../hpl/dmac</Value>
|
||||||
|
<Value>../hpl/gclk</Value>
|
||||||
|
<Value>../hpl/mclk</Value>
|
||||||
|
<Value>../hpl/osc32kctrl</Value>
|
||||||
|
<Value>../hpl/oscctrl</Value>
|
||||||
|
<Value>../hpl/pm</Value>
|
||||||
|
<Value>../hpl/port</Value>
|
||||||
|
<Value>../hpl/ramecc</Value>
|
||||||
|
<Value>../hpl/sercom</Value>
|
||||||
|
<Value>../hri</Value>
|
||||||
|
<Value>../stdio_redirect</Value>
|
||||||
|
<Value>%24(PackRepoDir)\atmel\SAME54_DFP\1.1.134\include</Value>
|
||||||
|
</ListValues>
|
||||||
|
</armgcc.compiler.directories.IncludePaths>
|
||||||
|
<armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
|
||||||
|
<armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
|
||||||
|
<armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
|
||||||
|
<armgcc.compiler.miscellaneous.OtherFlags>-std=gnu99 -mfloat-abi=softfp -mfpu=fpv4-sp-d16</armgcc.compiler.miscellaneous.OtherFlags>
|
||||||
|
<armgcc.linker.general.UseNewlibNano>True</armgcc.linker.general.UseNewlibNano>
|
||||||
|
<armgcc.linker.libraries.Libraries>
|
||||||
|
<ListValues>
|
||||||
|
<Value>libm</Value>
|
||||||
|
</ListValues>
|
||||||
|
</armgcc.linker.libraries.Libraries>
|
||||||
|
<armgcc.linker.libraries.LibrarySearchPaths>
|
||||||
|
<ListValues>
|
||||||
|
<Value>%24(ProjectDir)\Device_Startup</Value>
|
||||||
|
</ListValues>
|
||||||
|
</armgcc.linker.libraries.LibrarySearchPaths>
|
||||||
|
<armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
|
||||||
|
<armgcc.linker.miscellaneous.LinkerFlags>-Tsame54p20a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
|
||||||
|
<armgcc.assembler.general.IncludePaths>
|
||||||
|
<ListValues>
|
||||||
|
<Value>%24(PackRepoDir)\arm\CMSIS\5.4.0\CMSIS\Core\Include\</Value>
|
||||||
|
<Value>../Config</Value>
|
||||||
|
<Value>../</Value>
|
||||||
|
<Value>../examples</Value>
|
||||||
|
<Value>../hal/include</Value>
|
||||||
|
<Value>../hal/utils/include</Value>
|
||||||
|
<Value>../hpl/cmcc</Value>
|
||||||
|
<Value>../hpl/core</Value>
|
||||||
|
<Value>../hpl/dmac</Value>
|
||||||
|
<Value>../hpl/gclk</Value>
|
||||||
|
<Value>../hpl/mclk</Value>
|
||||||
|
<Value>../hpl/osc32kctrl</Value>
|
||||||
|
<Value>../hpl/oscctrl</Value>
|
||||||
|
<Value>../hpl/pm</Value>
|
||||||
|
<Value>../hpl/port</Value>
|
||||||
|
<Value>../hpl/ramecc</Value>
|
||||||
|
<Value>../hpl/sercom</Value>
|
||||||
|
<Value>../hri</Value>
|
||||||
|
<Value>../stdio_redirect</Value>
|
||||||
|
<Value>%24(PackRepoDir)\atmel\SAME54_DFP\1.1.134\include</Value>
|
||||||
|
</ListValues>
|
||||||
|
</armgcc.assembler.general.IncludePaths>
|
||||||
|
<armgcc.preprocessingassembler.general.IncludePaths>
|
||||||
|
<ListValues>
|
||||||
|
<Value>%24(PackRepoDir)\arm\CMSIS\5.4.0\CMSIS\Core\Include\</Value>
|
||||||
|
<Value>../Config</Value>
|
||||||
|
<Value>../</Value>
|
||||||
|
<Value>../examples</Value>
|
||||||
|
<Value>../hal/include</Value>
|
||||||
|
<Value>../hal/utils/include</Value>
|
||||||
|
<Value>../hpl/cmcc</Value>
|
||||||
|
<Value>../hpl/core</Value>
|
||||||
|
<Value>../hpl/dmac</Value>
|
||||||
|
<Value>../hpl/gclk</Value>
|
||||||
|
<Value>../hpl/mclk</Value>
|
||||||
|
<Value>../hpl/osc32kctrl</Value>
|
||||||
|
<Value>../hpl/oscctrl</Value>
|
||||||
|
<Value>../hpl/pm</Value>
|
||||||
|
<Value>../hpl/port</Value>
|
||||||
|
<Value>../hpl/ramecc</Value>
|
||||||
|
<Value>../hpl/sercom</Value>
|
||||||
|
<Value>../hri</Value>
|
||||||
|
<Value>../stdio_redirect</Value>
|
||||||
|
<Value>%24(PackRepoDir)\atmel\SAME54_DFP\1.1.134\include</Value>
|
||||||
|
</ListValues>
|
||||||
|
</armgcc.preprocessingassembler.general.IncludePaths>
|
||||||
|
</ArmGcc>
|
||||||
|
</ToolchainSettings>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
|
<ToolchainSettings>
|
||||||
|
<ArmGcc>
|
||||||
|
<armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
|
||||||
|
<armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
|
||||||
|
<armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
|
||||||
|
<armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
|
||||||
|
<armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
|
||||||
|
<armgcc.compiler.symbols.DefSymbols>
|
||||||
|
<ListValues>
|
||||||
|
<Value>DEBUG</Value>
|
||||||
|
</ListValues>
|
||||||
|
</armgcc.compiler.symbols.DefSymbols>
|
||||||
|
<armgcc.compiler.directories.IncludePaths>
|
||||||
|
<ListValues>
|
||||||
|
<Value>%24(PackRepoDir)\arm\CMSIS\5.4.0\CMSIS\Core\Include\</Value>
|
||||||
|
<Value>../Config</Value>
|
||||||
|
<Value>../</Value>
|
||||||
|
<Value>../examples</Value>
|
||||||
|
<Value>../hal/include</Value>
|
||||||
|
<Value>../hal/utils/include</Value>
|
||||||
|
<Value>../hpl/cmcc</Value>
|
||||||
|
<Value>../hpl/core</Value>
|
||||||
|
<Value>../hpl/dmac</Value>
|
||||||
|
<Value>../hpl/gclk</Value>
|
||||||
|
<Value>../hpl/mclk</Value>
|
||||||
|
<Value>../hpl/osc32kctrl</Value>
|
||||||
|
<Value>../hpl/oscctrl</Value>
|
||||||
|
<Value>../hpl/pm</Value>
|
||||||
|
<Value>../hpl/port</Value>
|
||||||
|
<Value>../hpl/ramecc</Value>
|
||||||
|
<Value>../hpl/sercom</Value>
|
||||||
|
<Value>../hri</Value>
|
||||||
|
<Value>../stdio_redirect</Value>
|
||||||
|
<Value>%24(PackRepoDir)\atmel\SAME54_DFP\1.1.134\include</Value>
|
||||||
|
</ListValues>
|
||||||
|
</armgcc.compiler.directories.IncludePaths>
|
||||||
|
<armgcc.compiler.optimization.level>Optimize debugging experience (-Og)</armgcc.compiler.optimization.level>
|
||||||
|
<armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
|
||||||
|
<armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
|
||||||
|
<armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
|
||||||
|
<armgcc.compiler.miscellaneous.OtherFlags>-std=gnu99 -mfloat-abi=softfp -mfpu=fpv4-sp-d16</armgcc.compiler.miscellaneous.OtherFlags>
|
||||||
|
<armgcc.linker.libraries.Libraries>
|
||||||
|
<ListValues>
|
||||||
|
<Value>libm</Value>
|
||||||
|
</ListValues>
|
||||||
|
</armgcc.linker.libraries.Libraries>
|
||||||
|
<armgcc.linker.libraries.LibrarySearchPaths>
|
||||||
|
<ListValues>
|
||||||
|
<Value>%24(ProjectDir)\Device_Startup</Value>
|
||||||
|
</ListValues>
|
||||||
|
</armgcc.linker.libraries.LibrarySearchPaths>
|
||||||
|
<armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
|
||||||
|
<armgcc.linker.memorysettings.ExternalRAM />
|
||||||
|
<armgcc.linker.miscellaneous.LinkerFlags>-Tsame54p20a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
|
||||||
|
<armgcc.assembler.general.IncludePaths>
|
||||||
|
<ListValues>
|
||||||
|
<Value>%24(PackRepoDir)\arm\CMSIS\5.4.0\CMSIS\Core\Include\</Value>
|
||||||
|
<Value>../Config</Value>
|
||||||
|
<Value>../</Value>
|
||||||
|
<Value>../examples</Value>
|
||||||
|
<Value>../hal/include</Value>
|
||||||
|
<Value>../hal/utils/include</Value>
|
||||||
|
<Value>../hpl/cmcc</Value>
|
||||||
|
<Value>../hpl/core</Value>
|
||||||
|
<Value>../hpl/dmac</Value>
|
||||||
|
<Value>../hpl/gclk</Value>
|
||||||
|
<Value>../hpl/mclk</Value>
|
||||||
|
<Value>../hpl/osc32kctrl</Value>
|
||||||
|
<Value>../hpl/oscctrl</Value>
|
||||||
|
<Value>../hpl/pm</Value>
|
||||||
|
<Value>../hpl/port</Value>
|
||||||
|
<Value>../hpl/ramecc</Value>
|
||||||
|
<Value>../hpl/sercom</Value>
|
||||||
|
<Value>../hri</Value>
|
||||||
|
<Value>../stdio_redirect</Value>
|
||||||
|
<Value>%24(PackRepoDir)\atmel\SAME54_DFP\1.1.134\include</Value>
|
||||||
|
</ListValues>
|
||||||
|
</armgcc.assembler.general.IncludePaths>
|
||||||
|
<armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
|
||||||
|
<armgcc.preprocessingassembler.general.IncludePaths>
|
||||||
|
<ListValues>
|
||||||
|
<Value>%24(PackRepoDir)\arm\CMSIS\5.4.0\CMSIS\Core\Include\</Value>
|
||||||
|
<Value>../Config</Value>
|
||||||
|
<Value>../</Value>
|
||||||
|
<Value>../examples</Value>
|
||||||
|
<Value>../hal/include</Value>
|
||||||
|
<Value>../hal/utils/include</Value>
|
||||||
|
<Value>../hpl/cmcc</Value>
|
||||||
|
<Value>../hpl/core</Value>
|
||||||
|
<Value>../hpl/dmac</Value>
|
||||||
|
<Value>../hpl/gclk</Value>
|
||||||
|
<Value>../hpl/mclk</Value>
|
||||||
|
<Value>../hpl/osc32kctrl</Value>
|
||||||
|
<Value>../hpl/oscctrl</Value>
|
||||||
|
<Value>../hpl/pm</Value>
|
||||||
|
<Value>../hpl/port</Value>
|
||||||
|
<Value>../hpl/ramecc</Value>
|
||||||
|
<Value>../hpl/sercom</Value>
|
||||||
|
<Value>../hri</Value>
|
||||||
|
<Value>../stdio_redirect</Value>
|
||||||
|
<Value>%24(PackRepoDir)\atmel\SAME54_DFP\1.1.134\include</Value>
|
||||||
|
</ListValues>
|
||||||
|
</armgcc.preprocessingassembler.general.IncludePaths>
|
||||||
|
<armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
|
||||||
|
</ArmGcc>
|
||||||
|
</ToolchainSettings>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="AS5048A.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="AS5048A.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="atmel_start.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="atmel_start.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="atmel_start_pins.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Config\hpl_cmcc_config.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Config\hpl_dmac_config.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Config\hpl_gclk_config.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Config\hpl_mclk_config.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Config\hpl_osc32kctrl_config.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Config\hpl_oscctrl_config.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Config\hpl_port_config.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Config\hpl_sercom_config.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Config\peripheral_clk_config.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Config\RTE_Components.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Config\stdio_redirect_config.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Device_Startup\startup_same54.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Device_Startup\system_same54.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="driver_init.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="driver_init.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="examples\driver_examples.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="examples\driver_examples.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hal_atomic.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hal_cache.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hal_delay.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hal_gpio.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hal_init.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hal_io.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hal_sleep.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hal_spi_m_sync.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hal_usart_sync.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_cmcc.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_core.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_delay.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_dma.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_gpio.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_i2c_m_async.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_i2c_m_sync.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_i2c_s_async.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_i2c_s_sync.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_init.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_irq.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_missing_features.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_ramecc.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_reset.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_sleep.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_spi.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_spi_async.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_spi_dma.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_spi_m_async.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_spi_m_dma.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_spi_m_sync.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_spi_sync.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_spi_s_async.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_spi_s_sync.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_usart.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_usart_async.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\include\hpl_usart_sync.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\src\hal_atomic.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\src\hal_cache.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\src\hal_delay.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\src\hal_gpio.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\src\hal_init.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\src\hal_io.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\src\hal_sleep.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\src\hal_spi_m_sync.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\src\hal_usart_sync.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\utils\include\compiler.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\utils\include\err_codes.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\utils\include\events.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\utils\include\parts.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\utils\include\utils.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\utils\include\utils_assert.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\utils\include\utils_event.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\utils\include\utils_increment_macro.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\utils\include\utils_list.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\utils\include\utils_repeat_macro.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\utils\src\utils_assert.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\utils\src\utils_event.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\utils\src\utils_list.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hal\utils\src\utils_syscalls.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hpl\cmcc\hpl_cmcc.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hpl\core\hpl_core_m4.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hpl\core\hpl_core_port.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hpl\core\hpl_init.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hpl\dmac\hpl_dmac.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hpl\gclk\hpl_gclk.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hpl\gclk\hpl_gclk_base.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hpl\mclk\hpl_mclk.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hpl\osc32kctrl\hpl_osc32kctrl.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hpl\oscctrl\hpl_oscctrl.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hpl\pm\hpl_pm.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hpl\pm\hpl_pm_base.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hpl\port\hpl_gpio_base.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hpl\ramecc\hpl_ramecc.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hpl\sercom\hpl_sercom.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_ac_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_adc_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_aes_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_can_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_ccl_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_cmcc_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_dac_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_dmac_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_dsu_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_eic_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_evsys_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_freqm_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_gclk_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_gmac_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_hmatrixb_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_i2s_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_icm_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_mclk_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_nvmctrl_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_osc32kctrl_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_oscctrl_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_pac_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_pcc_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_pdec_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_pm_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_port_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_qspi_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_ramecc_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_rstc_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_rtc_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_sdhc_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_sercom_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_supc_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_tcc_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_tc_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_trng_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_usb_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="hri\hri_wdt_e54.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="main.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="stdio_redirect\gcc\read.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="stdio_redirect\gcc\write.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="stdio_redirect\stdio_io.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="stdio_redirect\stdio_io.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="stdio_start.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="stdio_start.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Config\" />
|
||||||
|
<Folder Include="Device_Startup\" />
|
||||||
|
<Folder Include="documentation\" />
|
||||||
|
<Folder Include="examples\" />
|
||||||
|
<Folder Include="hal\" />
|
||||||
|
<Folder Include="hal\documentation\" />
|
||||||
|
<Folder Include="hal\include\" />
|
||||||
|
<Folder Include="hal\src\" />
|
||||||
|
<Folder Include="hal\utils\" />
|
||||||
|
<Folder Include="hal\utils\include\" />
|
||||||
|
<Folder Include="hal\utils\src\" />
|
||||||
|
<Folder Include="hpl\" />
|
||||||
|
<Folder Include="hpl\cmcc\" />
|
||||||
|
<Folder Include="hpl\core\" />
|
||||||
|
<Folder Include="hpl\dmac\" />
|
||||||
|
<Folder Include="hpl\gclk\" />
|
||||||
|
<Folder Include="hpl\mclk\" />
|
||||||
|
<Folder Include="hpl\osc32kctrl\" />
|
||||||
|
<Folder Include="hpl\oscctrl\" />
|
||||||
|
<Folder Include="hpl\pm\" />
|
||||||
|
<Folder Include="hpl\port\" />
|
||||||
|
<Folder Include="hpl\ramecc\" />
|
||||||
|
<Folder Include="hpl\sercom\" />
|
||||||
|
<Folder Include="hri\" />
|
||||||
|
<Folder Include="stdio_redirect\" />
|
||||||
|
<Folder Include="stdio_redirect\gcc\" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Device_Startup\same54p20a_flash.ld">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</None>
|
||||||
|
<None Include="Device_Startup\same54p20a_sram.ld">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</None>
|
||||||
|
<None Include="documentation\stdio.rst">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</None>
|
||||||
|
<None Include="hal\documentation\spi_master_sync.rst">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</None>
|
||||||
|
<None Include="hal\documentation\usart_sync.rst">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
|
||||||
|
</Project>
|
|
@ -0,0 +1,54 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief Autogenerated API include file for the Atmel Configuration Management Engine (ACME)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2012 Atmel Corporation. All rights reserved.
|
||||||
|
*
|
||||||
|
* \acme_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* 3. The name of Atmel may not be used to endorse or promote products derived
|
||||||
|
* from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* 4. This software may only be redistributed and used in connection with an
|
||||||
|
* Atmel microcontroller product.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||||
|
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
|
||||||
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* \acme_license_stop
|
||||||
|
*
|
||||||
|
* Project: AS5048A_test
|
||||||
|
* Target: ATSAME54P20A
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef RTE_COMPONENTS_H
|
||||||
|
#define RTE_COMPONENTS_H
|
||||||
|
|
||||||
|
|
||||||
|
#define ATMEL_START
|
||||||
|
|
||||||
|
#endif /* RTE_COMPONENTS_H */
|
|
@ -0,0 +1,54 @@
|
||||||
|
/* Auto-generated config file hpl_cmcc_config.h */
|
||||||
|
#ifndef HPL_CMCC_CONFIG_H
|
||||||
|
#define HPL_CMCC_CONFIG_H
|
||||||
|
|
||||||
|
// <<< Use Configuration Wizard in Context Menu >>>
|
||||||
|
|
||||||
|
// <h> Basic Configuration
|
||||||
|
|
||||||
|
// <q> Cache enable
|
||||||
|
//<i> Defines the cache should be enabled or not.
|
||||||
|
// <id> cmcc_enable
|
||||||
|
#ifndef CONF_CMCC_ENABLE
|
||||||
|
#define CONF_CMCC_ENABLE 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Cache Size
|
||||||
|
//<i> Defines the cache memory size to be configured.
|
||||||
|
// <0x0=>1 KB
|
||||||
|
// <0x1=>2 KB
|
||||||
|
// <0x2=>4 KB
|
||||||
|
// <id> cache_size
|
||||||
|
#ifndef CONF_CMCC_CACHE_SIZE
|
||||||
|
#define CONF_CMCC_CACHE_SIZE 0x2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <e> Advanced Configuration
|
||||||
|
// <id> cmcc_advanced_configuration
|
||||||
|
// <q> Data cache disable
|
||||||
|
//<i> Defines the data cache should be disabled or not.
|
||||||
|
// <id> cmcc_data_cache_disable
|
||||||
|
#ifndef CONF_CMCC_DATA_CACHE_DISABLE
|
||||||
|
#define CONF_CMCC_DATA_CACHE_DISABLE 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Instruction cache disable
|
||||||
|
//<i> Defines the Instruction cache should be disabled or not.
|
||||||
|
// <id> cmcc_inst_cache_disable
|
||||||
|
#ifndef CONF_CMCC_INST_CACHE_DISABLE
|
||||||
|
#define CONF_CMCC_INST_CACHE_DISABLE 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Clock Gating disable
|
||||||
|
//<i> Defines the clock gating should be disabled or not.
|
||||||
|
// <id> cmcc_clock_gating_disable
|
||||||
|
#ifndef CONF_CMCC_CLK_GATING_DISABLE
|
||||||
|
#define CONF_CMCC_CLK_GATING_DISABLE 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </e>
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
// <<< end of configuration section >>>
|
||||||
|
|
||||||
|
#endif // HPL_CMCC_CONFIG_H
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,920 @@
|
||||||
|
/* Auto-generated config file hpl_gclk_config.h */
|
||||||
|
#ifndef HPL_GCLK_CONFIG_H
|
||||||
|
#define HPL_GCLK_CONFIG_H
|
||||||
|
|
||||||
|
// <<< Use Configuration Wizard in Context Menu >>>
|
||||||
|
|
||||||
|
// <e> Generic clock generator 0 configuration
|
||||||
|
// <i> Indicates whether generic clock 0 configuration is enabled or not
|
||||||
|
// <id> enable_gclk_gen_0
|
||||||
|
#ifndef CONF_GCLK_GENERATOR_0_CONFIG
|
||||||
|
#define CONF_GCLK_GENERATOR_0_CONFIG 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> Generic Clock Generator Control
|
||||||
|
// <y> Generic clock generator 0 source
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC0"> External Crystal Oscillator 8-48MHz (XOSC0)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC1"> External Crystal Oscillator 8-48MHz (XOSC1)
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKIN"> Generic clock generator input pad
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKGEN1"> Generic clock generator 1
|
||||||
|
// <GCLK_GENCTRL_SRC_OSCULP32K"> 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC32K"> 32kHz External Crystal Oscillator (XOSC32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_DFLL"> Digital Frequency Locked Loop (DFLL48M)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL0"> Digital Phase Locked Loop (DPLL0)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL1"> Digital Phase Locked Loop (DPLL1)
|
||||||
|
// <i> This defines the clock source for generic clock generator 0
|
||||||
|
// <id> gclk_gen_0_oscillator
|
||||||
|
#ifndef CONF_GCLK_GEN_0_SOURCE
|
||||||
|
#define CONF_GCLK_GEN_0_SOURCE GCLK_GENCTRL_SRC_XOSC1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Run in Standby
|
||||||
|
// <i> Indicates whether Run in Standby is enabled or not
|
||||||
|
// <id> gclk_arch_gen_0_runstdby
|
||||||
|
#ifndef CONF_GCLK_GEN_0_RUNSTDBY
|
||||||
|
#define CONF_GCLK_GEN_0_RUNSTDBY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Divide Selection
|
||||||
|
// <i> Indicates whether Divide Selection is enabled or not
|
||||||
|
//<id> gclk_gen_0_div_sel
|
||||||
|
#ifndef CONF_GCLK_GEN_0_DIVSEL
|
||||||
|
#define CONF_GCLK_GEN_0_DIVSEL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Enable
|
||||||
|
// <i> Indicates whether Output Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_0_oe
|
||||||
|
#ifndef CONF_GCLK_GEN_0_OE
|
||||||
|
#define CONF_GCLK_GEN_0_OE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Off Value
|
||||||
|
// <i> Indicates whether Output Off Value is enabled or not
|
||||||
|
// <id> gclk_arch_gen_0_oov
|
||||||
|
#ifndef CONF_GCLK_GEN_0_OOV
|
||||||
|
#define CONF_GCLK_GEN_0_OOV 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Improve Duty Cycle
|
||||||
|
// <i> Indicates whether Improve Duty Cycle is enabled or not
|
||||||
|
// <id> gclk_arch_gen_0_idc
|
||||||
|
#ifndef CONF_GCLK_GEN_0_IDC
|
||||||
|
#define CONF_GCLK_GEN_0_IDC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Generic Clock Generator Enable
|
||||||
|
// <i> Indicates whether Generic Clock Generator Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_0_enable
|
||||||
|
#ifndef CONF_GCLK_GEN_0_GENEN
|
||||||
|
#define CONF_GCLK_GEN_0_GENEN 1
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
//<h> Generic Clock Generator Division
|
||||||
|
//<o> Generic clock generator 0 division <0x0000-0xFFFF>
|
||||||
|
// <id> gclk_gen_0_div
|
||||||
|
#ifndef CONF_GCLK_GEN_0_DIV
|
||||||
|
#define CONF_GCLK_GEN_0_DIV 1
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
// <e> Generic clock generator 1 configuration
|
||||||
|
// <i> Indicates whether generic clock 1 configuration is enabled or not
|
||||||
|
// <id> enable_gclk_gen_1
|
||||||
|
#ifndef CONF_GCLK_GENERATOR_1_CONFIG
|
||||||
|
#define CONF_GCLK_GENERATOR_1_CONFIG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> Generic Clock Generator Control
|
||||||
|
// <y> Generic clock generator 1 source
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC0"> External Crystal Oscillator 8-48MHz (XOSC0)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC1"> External Crystal Oscillator 8-48MHz (XOSC1)
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKIN"> Generic clock generator input pad
|
||||||
|
// <GCLK_GENCTRL_SRC_OSCULP32K"> 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC32K"> 32kHz External Crystal Oscillator (XOSC32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_DFLL"> Digital Frequency Locked Loop (DFLL48M)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL0"> Digital Phase Locked Loop (DPLL0)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL1"> Digital Phase Locked Loop (DPLL1)
|
||||||
|
// <i> This defines the clock source for generic clock generator 1
|
||||||
|
// <id> gclk_gen_1_oscillator
|
||||||
|
#ifndef CONF_GCLK_GEN_1_SOURCE
|
||||||
|
#define CONF_GCLK_GEN_1_SOURCE GCLK_GENCTRL_SRC_DFLL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Run in Standby
|
||||||
|
// <i> Indicates whether Run in Standby is enabled or not
|
||||||
|
// <id> gclk_arch_gen_1_runstdby
|
||||||
|
#ifndef CONF_GCLK_GEN_1_RUNSTDBY
|
||||||
|
#define CONF_GCLK_GEN_1_RUNSTDBY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Divide Selection
|
||||||
|
// <i> Indicates whether Divide Selection is enabled or not
|
||||||
|
//<id> gclk_gen_1_div_sel
|
||||||
|
#ifndef CONF_GCLK_GEN_1_DIVSEL
|
||||||
|
#define CONF_GCLK_GEN_1_DIVSEL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Enable
|
||||||
|
// <i> Indicates whether Output Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_1_oe
|
||||||
|
#ifndef CONF_GCLK_GEN_1_OE
|
||||||
|
#define CONF_GCLK_GEN_1_OE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Off Value
|
||||||
|
// <i> Indicates whether Output Off Value is enabled or not
|
||||||
|
// <id> gclk_arch_gen_1_oov
|
||||||
|
#ifndef CONF_GCLK_GEN_1_OOV
|
||||||
|
#define CONF_GCLK_GEN_1_OOV 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Improve Duty Cycle
|
||||||
|
// <i> Indicates whether Improve Duty Cycle is enabled or not
|
||||||
|
// <id> gclk_arch_gen_1_idc
|
||||||
|
#ifndef CONF_GCLK_GEN_1_IDC
|
||||||
|
#define CONF_GCLK_GEN_1_IDC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Generic Clock Generator Enable
|
||||||
|
// <i> Indicates whether Generic Clock Generator Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_1_enable
|
||||||
|
#ifndef CONF_GCLK_GEN_1_GENEN
|
||||||
|
#define CONF_GCLK_GEN_1_GENEN 0
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
//<h> Generic Clock Generator Division
|
||||||
|
//<o> Generic clock generator 1 division <0x0000-0xFFFF>
|
||||||
|
// <id> gclk_gen_1_div
|
||||||
|
#ifndef CONF_GCLK_GEN_1_DIV
|
||||||
|
#define CONF_GCLK_GEN_1_DIV 1
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
// <e> Generic clock generator 2 configuration
|
||||||
|
// <i> Indicates whether generic clock 2 configuration is enabled or not
|
||||||
|
// <id> enable_gclk_gen_2
|
||||||
|
#ifndef CONF_GCLK_GENERATOR_2_CONFIG
|
||||||
|
#define CONF_GCLK_GENERATOR_2_CONFIG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> Generic Clock Generator Control
|
||||||
|
// <y> Generic clock generator 2 source
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC0"> External Crystal Oscillator 8-48MHz (XOSC0)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC1"> External Crystal Oscillator 8-48MHz (XOSC1)
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKIN"> Generic clock generator input pad
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKGEN1"> Generic clock generator 1
|
||||||
|
// <GCLK_GENCTRL_SRC_OSCULP32K"> 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC32K"> 32kHz External Crystal Oscillator (XOSC32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_DFLL"> Digital Frequency Locked Loop (DFLL48M)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL0"> Digital Phase Locked Loop (DPLL0)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL1"> Digital Phase Locked Loop (DPLL1)
|
||||||
|
// <i> This defines the clock source for generic clock generator 2
|
||||||
|
// <id> gclk_gen_2_oscillator
|
||||||
|
#ifndef CONF_GCLK_GEN_2_SOURCE
|
||||||
|
#define CONF_GCLK_GEN_2_SOURCE GCLK_GENCTRL_SRC_XOSC1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Run in Standby
|
||||||
|
// <i> Indicates whether Run in Standby is enabled or not
|
||||||
|
// <id> gclk_arch_gen_2_runstdby
|
||||||
|
#ifndef CONF_GCLK_GEN_2_RUNSTDBY
|
||||||
|
#define CONF_GCLK_GEN_2_RUNSTDBY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Divide Selection
|
||||||
|
// <i> Indicates whether Divide Selection is enabled or not
|
||||||
|
//<id> gclk_gen_2_div_sel
|
||||||
|
#ifndef CONF_GCLK_GEN_2_DIVSEL
|
||||||
|
#define CONF_GCLK_GEN_2_DIVSEL 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Enable
|
||||||
|
// <i> Indicates whether Output Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_2_oe
|
||||||
|
#ifndef CONF_GCLK_GEN_2_OE
|
||||||
|
#define CONF_GCLK_GEN_2_OE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Off Value
|
||||||
|
// <i> Indicates whether Output Off Value is enabled or not
|
||||||
|
// <id> gclk_arch_gen_2_oov
|
||||||
|
#ifndef CONF_GCLK_GEN_2_OOV
|
||||||
|
#define CONF_GCLK_GEN_2_OOV 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Improve Duty Cycle
|
||||||
|
// <i> Indicates whether Improve Duty Cycle is enabled or not
|
||||||
|
// <id> gclk_arch_gen_2_idc
|
||||||
|
#ifndef CONF_GCLK_GEN_2_IDC
|
||||||
|
#define CONF_GCLK_GEN_2_IDC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Generic Clock Generator Enable
|
||||||
|
// <i> Indicates whether Generic Clock Generator Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_2_enable
|
||||||
|
#ifndef CONF_GCLK_GEN_2_GENEN
|
||||||
|
#define CONF_GCLK_GEN_2_GENEN 0
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
//<h> Generic Clock Generator Division
|
||||||
|
//<o> Generic clock generator 2 division <0x0000-0xFFFF>
|
||||||
|
// <id> gclk_gen_2_div
|
||||||
|
#ifndef CONF_GCLK_GEN_2_DIV
|
||||||
|
#define CONF_GCLK_GEN_2_DIV 1
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
// <e> Generic clock generator 3 configuration
|
||||||
|
// <i> Indicates whether generic clock 3 configuration is enabled or not
|
||||||
|
// <id> enable_gclk_gen_3
|
||||||
|
#ifndef CONF_GCLK_GENERATOR_3_CONFIG
|
||||||
|
#define CONF_GCLK_GENERATOR_3_CONFIG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> Generic Clock Generator Control
|
||||||
|
// <y> Generic clock generator 3 source
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC0"> External Crystal Oscillator 8-48MHz (XOSC0)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC1"> External Crystal Oscillator 8-48MHz (XOSC1)
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKIN"> Generic clock generator input pad
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKGEN1"> Generic clock generator 1
|
||||||
|
// <GCLK_GENCTRL_SRC_OSCULP32K"> 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC32K"> 32kHz External Crystal Oscillator (XOSC32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_DFLL"> Digital Frequency Locked Loop (DFLL48M)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL0"> Digital Phase Locked Loop (DPLL0)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL1"> Digital Phase Locked Loop (DPLL1)
|
||||||
|
// <i> This defines the clock source for generic clock generator 3
|
||||||
|
// <id> gclk_gen_3_oscillator
|
||||||
|
#ifndef CONF_GCLK_GEN_3_SOURCE
|
||||||
|
#define CONF_GCLK_GEN_3_SOURCE GCLK_GENCTRL_SRC_XOSC32K
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Run in Standby
|
||||||
|
// <i> Indicates whether Run in Standby is enabled or not
|
||||||
|
// <id> gclk_arch_gen_3_runstdby
|
||||||
|
#ifndef CONF_GCLK_GEN_3_RUNSTDBY
|
||||||
|
#define CONF_GCLK_GEN_3_RUNSTDBY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Divide Selection
|
||||||
|
// <i> Indicates whether Divide Selection is enabled or not
|
||||||
|
//<id> gclk_gen_3_div_sel
|
||||||
|
#ifndef CONF_GCLK_GEN_3_DIVSEL
|
||||||
|
#define CONF_GCLK_GEN_3_DIVSEL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Enable
|
||||||
|
// <i> Indicates whether Output Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_3_oe
|
||||||
|
#ifndef CONF_GCLK_GEN_3_OE
|
||||||
|
#define CONF_GCLK_GEN_3_OE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Off Value
|
||||||
|
// <i> Indicates whether Output Off Value is enabled or not
|
||||||
|
// <id> gclk_arch_gen_3_oov
|
||||||
|
#ifndef CONF_GCLK_GEN_3_OOV
|
||||||
|
#define CONF_GCLK_GEN_3_OOV 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Improve Duty Cycle
|
||||||
|
// <i> Indicates whether Improve Duty Cycle is enabled or not
|
||||||
|
// <id> gclk_arch_gen_3_idc
|
||||||
|
#ifndef CONF_GCLK_GEN_3_IDC
|
||||||
|
#define CONF_GCLK_GEN_3_IDC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Generic Clock Generator Enable
|
||||||
|
// <i> Indicates whether Generic Clock Generator Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_3_enable
|
||||||
|
#ifndef CONF_GCLK_GEN_3_GENEN
|
||||||
|
#define CONF_GCLK_GEN_3_GENEN 0
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
//<h> Generic Clock Generator Division
|
||||||
|
//<o> Generic clock generator 3 division <0x0000-0xFFFF>
|
||||||
|
// <id> gclk_gen_3_div
|
||||||
|
#ifndef CONF_GCLK_GEN_3_DIV
|
||||||
|
#define CONF_GCLK_GEN_3_DIV 1
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
// <e> Generic clock generator 4 configuration
|
||||||
|
// <i> Indicates whether generic clock 4 configuration is enabled or not
|
||||||
|
// <id> enable_gclk_gen_4
|
||||||
|
#ifndef CONF_GCLK_GENERATOR_4_CONFIG
|
||||||
|
#define CONF_GCLK_GENERATOR_4_CONFIG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> Generic Clock Generator Control
|
||||||
|
// <y> Generic clock generator 4 source
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC0"> External Crystal Oscillator 8-48MHz (XOSC0)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC1"> External Crystal Oscillator 8-48MHz (XOSC1)
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKIN"> Generic clock generator input pad
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKGEN1"> Generic clock generator 1
|
||||||
|
// <GCLK_GENCTRL_SRC_OSCULP32K"> 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC32K"> 32kHz External Crystal Oscillator (XOSC32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_DFLL"> Digital Frequency Locked Loop (DFLL48M)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL0"> Digital Phase Locked Loop (DPLL0)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL1"> Digital Phase Locked Loop (DPLL1)
|
||||||
|
// <i> This defines the clock source for generic clock generator 4
|
||||||
|
// <id> gclk_gen_4_oscillator
|
||||||
|
#ifndef CONF_GCLK_GEN_4_SOURCE
|
||||||
|
#define CONF_GCLK_GEN_4_SOURCE GCLK_GENCTRL_SRC_XOSC1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Run in Standby
|
||||||
|
// <i> Indicates whether Run in Standby is enabled or not
|
||||||
|
// <id> gclk_arch_gen_4_runstdby
|
||||||
|
#ifndef CONF_GCLK_GEN_4_RUNSTDBY
|
||||||
|
#define CONF_GCLK_GEN_4_RUNSTDBY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Divide Selection
|
||||||
|
// <i> Indicates whether Divide Selection is enabled or not
|
||||||
|
//<id> gclk_gen_4_div_sel
|
||||||
|
#ifndef CONF_GCLK_GEN_4_DIVSEL
|
||||||
|
#define CONF_GCLK_GEN_4_DIVSEL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Enable
|
||||||
|
// <i> Indicates whether Output Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_4_oe
|
||||||
|
#ifndef CONF_GCLK_GEN_4_OE
|
||||||
|
#define CONF_GCLK_GEN_4_OE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Off Value
|
||||||
|
// <i> Indicates whether Output Off Value is enabled or not
|
||||||
|
// <id> gclk_arch_gen_4_oov
|
||||||
|
#ifndef CONF_GCLK_GEN_4_OOV
|
||||||
|
#define CONF_GCLK_GEN_4_OOV 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Improve Duty Cycle
|
||||||
|
// <i> Indicates whether Improve Duty Cycle is enabled or not
|
||||||
|
// <id> gclk_arch_gen_4_idc
|
||||||
|
#ifndef CONF_GCLK_GEN_4_IDC
|
||||||
|
#define CONF_GCLK_GEN_4_IDC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Generic Clock Generator Enable
|
||||||
|
// <i> Indicates whether Generic Clock Generator Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_4_enable
|
||||||
|
#ifndef CONF_GCLK_GEN_4_GENEN
|
||||||
|
#define CONF_GCLK_GEN_4_GENEN 0
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
//<h> Generic Clock Generator Division
|
||||||
|
//<o> Generic clock generator 4 division <0x0000-0xFFFF>
|
||||||
|
// <id> gclk_gen_4_div
|
||||||
|
#ifndef CONF_GCLK_GEN_4_DIV
|
||||||
|
#define CONF_GCLK_GEN_4_DIV 1
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
// <e> Generic clock generator 5 configuration
|
||||||
|
// <i> Indicates whether generic clock 5 configuration is enabled or not
|
||||||
|
// <id> enable_gclk_gen_5
|
||||||
|
#ifndef CONF_GCLK_GENERATOR_5_CONFIG
|
||||||
|
#define CONF_GCLK_GENERATOR_5_CONFIG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> Generic Clock Generator Control
|
||||||
|
// <y> Generic clock generator 5 source
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC0"> External Crystal Oscillator 8-48MHz (XOSC0)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC1"> External Crystal Oscillator 8-48MHz (XOSC1)
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKIN"> Generic clock generator input pad
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKGEN1"> Generic clock generator 1
|
||||||
|
// <GCLK_GENCTRL_SRC_OSCULP32K"> 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC32K"> 32kHz External Crystal Oscillator (XOSC32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_DFLL"> Digital Frequency Locked Loop (DFLL48M)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL0"> Digital Phase Locked Loop (DPLL0)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL1"> Digital Phase Locked Loop (DPLL1)
|
||||||
|
// <i> This defines the clock source for generic clock generator 5
|
||||||
|
// <id> gclk_gen_5_oscillator
|
||||||
|
#ifndef CONF_GCLK_GEN_5_SOURCE
|
||||||
|
#define CONF_GCLK_GEN_5_SOURCE GCLK_GENCTRL_SRC_XOSC1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Run in Standby
|
||||||
|
// <i> Indicates whether Run in Standby is enabled or not
|
||||||
|
// <id> gclk_arch_gen_5_runstdby
|
||||||
|
#ifndef CONF_GCLK_GEN_5_RUNSTDBY
|
||||||
|
#define CONF_GCLK_GEN_5_RUNSTDBY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Divide Selection
|
||||||
|
// <i> Indicates whether Divide Selection is enabled or not
|
||||||
|
//<id> gclk_gen_5_div_sel
|
||||||
|
#ifndef CONF_GCLK_GEN_5_DIVSEL
|
||||||
|
#define CONF_GCLK_GEN_5_DIVSEL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Enable
|
||||||
|
// <i> Indicates whether Output Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_5_oe
|
||||||
|
#ifndef CONF_GCLK_GEN_5_OE
|
||||||
|
#define CONF_GCLK_GEN_5_OE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Off Value
|
||||||
|
// <i> Indicates whether Output Off Value is enabled or not
|
||||||
|
// <id> gclk_arch_gen_5_oov
|
||||||
|
#ifndef CONF_GCLK_GEN_5_OOV
|
||||||
|
#define CONF_GCLK_GEN_5_OOV 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Improve Duty Cycle
|
||||||
|
// <i> Indicates whether Improve Duty Cycle is enabled or not
|
||||||
|
// <id> gclk_arch_gen_5_idc
|
||||||
|
#ifndef CONF_GCLK_GEN_5_IDC
|
||||||
|
#define CONF_GCLK_GEN_5_IDC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Generic Clock Generator Enable
|
||||||
|
// <i> Indicates whether Generic Clock Generator Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_5_enable
|
||||||
|
#ifndef CONF_GCLK_GEN_5_GENEN
|
||||||
|
#define CONF_GCLK_GEN_5_GENEN 0
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
//<h> Generic Clock Generator Division
|
||||||
|
//<o> Generic clock generator 5 division <0x0000-0xFFFF>
|
||||||
|
// <id> gclk_gen_5_div
|
||||||
|
#ifndef CONF_GCLK_GEN_5_DIV
|
||||||
|
#define CONF_GCLK_GEN_5_DIV 1
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
// <e> Generic clock generator 6 configuration
|
||||||
|
// <i> Indicates whether generic clock 6 configuration is enabled or not
|
||||||
|
// <id> enable_gclk_gen_6
|
||||||
|
#ifndef CONF_GCLK_GENERATOR_6_CONFIG
|
||||||
|
#define CONF_GCLK_GENERATOR_6_CONFIG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> Generic Clock Generator Control
|
||||||
|
// <y> Generic clock generator 6 source
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC0"> External Crystal Oscillator 8-48MHz (XOSC0)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC1"> External Crystal Oscillator 8-48MHz (XOSC1)
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKIN"> Generic clock generator input pad
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKGEN1"> Generic clock generator 1
|
||||||
|
// <GCLK_GENCTRL_SRC_OSCULP32K"> 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC32K"> 32kHz External Crystal Oscillator (XOSC32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_DFLL"> Digital Frequency Locked Loop (DFLL48M)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL0"> Digital Phase Locked Loop (DPLL0)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL1"> Digital Phase Locked Loop (DPLL1)
|
||||||
|
// <i> This defines the clock source for generic clock generator 6
|
||||||
|
// <id> gclk_gen_6_oscillator
|
||||||
|
#ifndef CONF_GCLK_GEN_6_SOURCE
|
||||||
|
#define CONF_GCLK_GEN_6_SOURCE GCLK_GENCTRL_SRC_XOSC1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Run in Standby
|
||||||
|
// <i> Indicates whether Run in Standby is enabled or not
|
||||||
|
// <id> gclk_arch_gen_6_runstdby
|
||||||
|
#ifndef CONF_GCLK_GEN_6_RUNSTDBY
|
||||||
|
#define CONF_GCLK_GEN_6_RUNSTDBY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Divide Selection
|
||||||
|
// <i> Indicates whether Divide Selection is enabled or not
|
||||||
|
//<id> gclk_gen_6_div_sel
|
||||||
|
#ifndef CONF_GCLK_GEN_6_DIVSEL
|
||||||
|
#define CONF_GCLK_GEN_6_DIVSEL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Enable
|
||||||
|
// <i> Indicates whether Output Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_6_oe
|
||||||
|
#ifndef CONF_GCLK_GEN_6_OE
|
||||||
|
#define CONF_GCLK_GEN_6_OE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Off Value
|
||||||
|
// <i> Indicates whether Output Off Value is enabled or not
|
||||||
|
// <id> gclk_arch_gen_6_oov
|
||||||
|
#ifndef CONF_GCLK_GEN_6_OOV
|
||||||
|
#define CONF_GCLK_GEN_6_OOV 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Improve Duty Cycle
|
||||||
|
// <i> Indicates whether Improve Duty Cycle is enabled or not
|
||||||
|
// <id> gclk_arch_gen_6_idc
|
||||||
|
#ifndef CONF_GCLK_GEN_6_IDC
|
||||||
|
#define CONF_GCLK_GEN_6_IDC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Generic Clock Generator Enable
|
||||||
|
// <i> Indicates whether Generic Clock Generator Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_6_enable
|
||||||
|
#ifndef CONF_GCLK_GEN_6_GENEN
|
||||||
|
#define CONF_GCLK_GEN_6_GENEN 0
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
//<h> Generic Clock Generator Division
|
||||||
|
//<o> Generic clock generator 6 division <0x0000-0xFFFF>
|
||||||
|
// <id> gclk_gen_6_div
|
||||||
|
#ifndef CONF_GCLK_GEN_6_DIV
|
||||||
|
#define CONF_GCLK_GEN_6_DIV 1
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
// <e> Generic clock generator 7 configuration
|
||||||
|
// <i> Indicates whether generic clock 7 configuration is enabled or not
|
||||||
|
// <id> enable_gclk_gen_7
|
||||||
|
#ifndef CONF_GCLK_GENERATOR_7_CONFIG
|
||||||
|
#define CONF_GCLK_GENERATOR_7_CONFIG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> Generic Clock Generator Control
|
||||||
|
// <y> Generic clock generator 7 source
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC0"> External Crystal Oscillator 8-48MHz (XOSC0)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC1"> External Crystal Oscillator 8-48MHz (XOSC1)
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKIN"> Generic clock generator input pad
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKGEN1"> Generic clock generator 1
|
||||||
|
// <GCLK_GENCTRL_SRC_OSCULP32K"> 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC32K"> 32kHz External Crystal Oscillator (XOSC32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_DFLL"> Digital Frequency Locked Loop (DFLL48M)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL0"> Digital Phase Locked Loop (DPLL0)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL1"> Digital Phase Locked Loop (DPLL1)
|
||||||
|
// <i> This defines the clock source for generic clock generator 7
|
||||||
|
// <id> gclk_gen_7_oscillator
|
||||||
|
#ifndef CONF_GCLK_GEN_7_SOURCE
|
||||||
|
#define CONF_GCLK_GEN_7_SOURCE GCLK_GENCTRL_SRC_XOSC1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Run in Standby
|
||||||
|
// <i> Indicates whether Run in Standby is enabled or not
|
||||||
|
// <id> gclk_arch_gen_7_runstdby
|
||||||
|
#ifndef CONF_GCLK_GEN_7_RUNSTDBY
|
||||||
|
#define CONF_GCLK_GEN_7_RUNSTDBY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Divide Selection
|
||||||
|
// <i> Indicates whether Divide Selection is enabled or not
|
||||||
|
//<id> gclk_gen_7_div_sel
|
||||||
|
#ifndef CONF_GCLK_GEN_7_DIVSEL
|
||||||
|
#define CONF_GCLK_GEN_7_DIVSEL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Enable
|
||||||
|
// <i> Indicates whether Output Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_7_oe
|
||||||
|
#ifndef CONF_GCLK_GEN_7_OE
|
||||||
|
#define CONF_GCLK_GEN_7_OE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Off Value
|
||||||
|
// <i> Indicates whether Output Off Value is enabled or not
|
||||||
|
// <id> gclk_arch_gen_7_oov
|
||||||
|
#ifndef CONF_GCLK_GEN_7_OOV
|
||||||
|
#define CONF_GCLK_GEN_7_OOV 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Improve Duty Cycle
|
||||||
|
// <i> Indicates whether Improve Duty Cycle is enabled or not
|
||||||
|
// <id> gclk_arch_gen_7_idc
|
||||||
|
#ifndef CONF_GCLK_GEN_7_IDC
|
||||||
|
#define CONF_GCLK_GEN_7_IDC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Generic Clock Generator Enable
|
||||||
|
// <i> Indicates whether Generic Clock Generator Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_7_enable
|
||||||
|
#ifndef CONF_GCLK_GEN_7_GENEN
|
||||||
|
#define CONF_GCLK_GEN_7_GENEN 0
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
//<h> Generic Clock Generator Division
|
||||||
|
//<o> Generic clock generator 7 division <0x0000-0xFFFF>
|
||||||
|
// <id> gclk_gen_7_div
|
||||||
|
#ifndef CONF_GCLK_GEN_7_DIV
|
||||||
|
#define CONF_GCLK_GEN_7_DIV 1
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
// <e> Generic clock generator 8 configuration
|
||||||
|
// <i> Indicates whether generic clock 8 configuration is enabled or not
|
||||||
|
// <id> enable_gclk_gen_8
|
||||||
|
#ifndef CONF_GCLK_GENERATOR_8_CONFIG
|
||||||
|
#define CONF_GCLK_GENERATOR_8_CONFIG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> Generic Clock Generator Control
|
||||||
|
// <y> Generic clock generator 8 source
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC0"> External Crystal Oscillator 8-48MHz (XOSC0)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC1"> External Crystal Oscillator 8-48MHz (XOSC1)
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKIN"> Generic clock generator input pad
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKGEN1"> Generic clock generator 1
|
||||||
|
// <GCLK_GENCTRL_SRC_OSCULP32K"> 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC32K"> 32kHz External Crystal Oscillator (XOSC32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_DFLL"> Digital Frequency Locked Loop (DFLL48M)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL0"> Digital Phase Locked Loop (DPLL0)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL1"> Digital Phase Locked Loop (DPLL1)
|
||||||
|
// <i> This defines the clock source for generic clock generator 8
|
||||||
|
// <id> gclk_gen_8_oscillator
|
||||||
|
#ifndef CONF_GCLK_GEN_8_SOURCE
|
||||||
|
#define CONF_GCLK_GEN_8_SOURCE GCLK_GENCTRL_SRC_XOSC1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Run in Standby
|
||||||
|
// <i> Indicates whether Run in Standby is enabled or not
|
||||||
|
// <id> gclk_arch_gen_8_runstdby
|
||||||
|
#ifndef CONF_GCLK_GEN_8_RUNSTDBY
|
||||||
|
#define CONF_GCLK_GEN_8_RUNSTDBY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Divide Selection
|
||||||
|
// <i> Indicates whether Divide Selection is enabled or not
|
||||||
|
//<id> gclk_gen_8_div_sel
|
||||||
|
#ifndef CONF_GCLK_GEN_8_DIVSEL
|
||||||
|
#define CONF_GCLK_GEN_8_DIVSEL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Enable
|
||||||
|
// <i> Indicates whether Output Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_8_oe
|
||||||
|
#ifndef CONF_GCLK_GEN_8_OE
|
||||||
|
#define CONF_GCLK_GEN_8_OE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Off Value
|
||||||
|
// <i> Indicates whether Output Off Value is enabled or not
|
||||||
|
// <id> gclk_arch_gen_8_oov
|
||||||
|
#ifndef CONF_GCLK_GEN_8_OOV
|
||||||
|
#define CONF_GCLK_GEN_8_OOV 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Improve Duty Cycle
|
||||||
|
// <i> Indicates whether Improve Duty Cycle is enabled or not
|
||||||
|
// <id> gclk_arch_gen_8_idc
|
||||||
|
#ifndef CONF_GCLK_GEN_8_IDC
|
||||||
|
#define CONF_GCLK_GEN_8_IDC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Generic Clock Generator Enable
|
||||||
|
// <i> Indicates whether Generic Clock Generator Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_8_enable
|
||||||
|
#ifndef CONF_GCLK_GEN_8_GENEN
|
||||||
|
#define CONF_GCLK_GEN_8_GENEN 0
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
//<h> Generic Clock Generator Division
|
||||||
|
//<o> Generic clock generator 8 division <0x0000-0xFFFF>
|
||||||
|
// <id> gclk_gen_8_div
|
||||||
|
#ifndef CONF_GCLK_GEN_8_DIV
|
||||||
|
#define CONF_GCLK_GEN_8_DIV 1
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
// <e> Generic clock generator 9 configuration
|
||||||
|
// <i> Indicates whether generic clock 9 configuration is enabled or not
|
||||||
|
// <id> enable_gclk_gen_9
|
||||||
|
#ifndef CONF_GCLK_GENERATOR_9_CONFIG
|
||||||
|
#define CONF_GCLK_GENERATOR_9_CONFIG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> Generic Clock Generator Control
|
||||||
|
// <y> Generic clock generator 9 source
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC0"> External Crystal Oscillator 8-48MHz (XOSC0)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC1"> External Crystal Oscillator 8-48MHz (XOSC1)
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKIN"> Generic clock generator input pad
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKGEN1"> Generic clock generator 1
|
||||||
|
// <GCLK_GENCTRL_SRC_OSCULP32K"> 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC32K"> 32kHz External Crystal Oscillator (XOSC32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_DFLL"> Digital Frequency Locked Loop (DFLL48M)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL0"> Digital Phase Locked Loop (DPLL0)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL1"> Digital Phase Locked Loop (DPLL1)
|
||||||
|
// <i> This defines the clock source for generic clock generator 9
|
||||||
|
// <id> gclk_gen_9_oscillator
|
||||||
|
#ifndef CONF_GCLK_GEN_9_SOURCE
|
||||||
|
#define CONF_GCLK_GEN_9_SOURCE GCLK_GENCTRL_SRC_XOSC1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Run in Standby
|
||||||
|
// <i> Indicates whether Run in Standby is enabled or not
|
||||||
|
// <id> gclk_arch_gen_9_runstdby
|
||||||
|
#ifndef CONF_GCLK_GEN_9_RUNSTDBY
|
||||||
|
#define CONF_GCLK_GEN_9_RUNSTDBY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Divide Selection
|
||||||
|
// <i> Indicates whether Divide Selection is enabled or not
|
||||||
|
//<id> gclk_gen_9_div_sel
|
||||||
|
#ifndef CONF_GCLK_GEN_9_DIVSEL
|
||||||
|
#define CONF_GCLK_GEN_9_DIVSEL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Enable
|
||||||
|
// <i> Indicates whether Output Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_9_oe
|
||||||
|
#ifndef CONF_GCLK_GEN_9_OE
|
||||||
|
#define CONF_GCLK_GEN_9_OE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Off Value
|
||||||
|
// <i> Indicates whether Output Off Value is enabled or not
|
||||||
|
// <id> gclk_arch_gen_9_oov
|
||||||
|
#ifndef CONF_GCLK_GEN_9_OOV
|
||||||
|
#define CONF_GCLK_GEN_9_OOV 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Improve Duty Cycle
|
||||||
|
// <i> Indicates whether Improve Duty Cycle is enabled or not
|
||||||
|
// <id> gclk_arch_gen_9_idc
|
||||||
|
#ifndef CONF_GCLK_GEN_9_IDC
|
||||||
|
#define CONF_GCLK_GEN_9_IDC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Generic Clock Generator Enable
|
||||||
|
// <i> Indicates whether Generic Clock Generator Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_9_enable
|
||||||
|
#ifndef CONF_GCLK_GEN_9_GENEN
|
||||||
|
#define CONF_GCLK_GEN_9_GENEN 0
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
//<h> Generic Clock Generator Division
|
||||||
|
//<o> Generic clock generator 9 division <0x0000-0xFFFF>
|
||||||
|
// <id> gclk_gen_9_div
|
||||||
|
#ifndef CONF_GCLK_GEN_9_DIV
|
||||||
|
#define CONF_GCLK_GEN_9_DIV 1
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
// <e> Generic clock generator 10 configuration
|
||||||
|
// <i> Indicates whether generic clock 10 configuration is enabled or not
|
||||||
|
// <id> enable_gclk_gen_10
|
||||||
|
#ifndef CONF_GCLK_GENERATOR_10_CONFIG
|
||||||
|
#define CONF_GCLK_GENERATOR_10_CONFIG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> Generic Clock Generator Control
|
||||||
|
// <y> Generic clock generator 10 source
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC0"> External Crystal Oscillator 8-48MHz (XOSC0)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC1"> External Crystal Oscillator 8-48MHz (XOSC1)
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKIN"> Generic clock generator input pad
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKGEN1"> Generic clock generator 1
|
||||||
|
// <GCLK_GENCTRL_SRC_OSCULP32K"> 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC32K"> 32kHz External Crystal Oscillator (XOSC32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_DFLL"> Digital Frequency Locked Loop (DFLL48M)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL0"> Digital Phase Locked Loop (DPLL0)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL1"> Digital Phase Locked Loop (DPLL1)
|
||||||
|
// <i> This defines the clock source for generic clock generator 10
|
||||||
|
// <id> gclk_gen_10_oscillator
|
||||||
|
#ifndef CONF_GCLK_GEN_10_SOURCE
|
||||||
|
#define CONF_GCLK_GEN_10_SOURCE GCLK_GENCTRL_SRC_XOSC1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Run in Standby
|
||||||
|
// <i> Indicates whether Run in Standby is enabled or not
|
||||||
|
// <id> gclk_arch_gen_10_runstdby
|
||||||
|
#ifndef CONF_GCLK_GEN_10_RUNSTDBY
|
||||||
|
#define CONF_GCLK_GEN_10_RUNSTDBY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Divide Selection
|
||||||
|
// <i> Indicates whether Divide Selection is enabled or not
|
||||||
|
//<id> gclk_gen_10_div_sel
|
||||||
|
#ifndef CONF_GCLK_GEN_10_DIVSEL
|
||||||
|
#define CONF_GCLK_GEN_10_DIVSEL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Enable
|
||||||
|
// <i> Indicates whether Output Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_10_oe
|
||||||
|
#ifndef CONF_GCLK_GEN_10_OE
|
||||||
|
#define CONF_GCLK_GEN_10_OE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Off Value
|
||||||
|
// <i> Indicates whether Output Off Value is enabled or not
|
||||||
|
// <id> gclk_arch_gen_10_oov
|
||||||
|
#ifndef CONF_GCLK_GEN_10_OOV
|
||||||
|
#define CONF_GCLK_GEN_10_OOV 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Improve Duty Cycle
|
||||||
|
// <i> Indicates whether Improve Duty Cycle is enabled or not
|
||||||
|
// <id> gclk_arch_gen_10_idc
|
||||||
|
#ifndef CONF_GCLK_GEN_10_IDC
|
||||||
|
#define CONF_GCLK_GEN_10_IDC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Generic Clock Generator Enable
|
||||||
|
// <i> Indicates whether Generic Clock Generator Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_10_enable
|
||||||
|
#ifndef CONF_GCLK_GEN_10_GENEN
|
||||||
|
#define CONF_GCLK_GEN_10_GENEN 0
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
//<h> Generic Clock Generator Division
|
||||||
|
//<o> Generic clock generator 10 division <0x0000-0xFFFF>
|
||||||
|
// <id> gclk_gen_10_div
|
||||||
|
#ifndef CONF_GCLK_GEN_10_DIV
|
||||||
|
#define CONF_GCLK_GEN_10_DIV 1
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
// <e> Generic clock generator 11 configuration
|
||||||
|
// <i> Indicates whether generic clock 11 configuration is enabled or not
|
||||||
|
// <id> enable_gclk_gen_11
|
||||||
|
#ifndef CONF_GCLK_GENERATOR_11_CONFIG
|
||||||
|
#define CONF_GCLK_GENERATOR_11_CONFIG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> Generic Clock Generator Control
|
||||||
|
// <y> Generic clock generator 11 source
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC0"> External Crystal Oscillator 8-48MHz (XOSC0)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC1"> External Crystal Oscillator 8-48MHz (XOSC1)
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKIN"> Generic clock generator input pad
|
||||||
|
// <GCLK_GENCTRL_SRC_GCLKGEN1"> Generic clock generator 1
|
||||||
|
// <GCLK_GENCTRL_SRC_OSCULP32K"> 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC32K"> 32kHz External Crystal Oscillator (XOSC32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_DFLL"> Digital Frequency Locked Loop (DFLL48M)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL0"> Digital Phase Locked Loop (DPLL0)
|
||||||
|
// <GCLK_GENCTRL_SRC_DPLL1"> Digital Phase Locked Loop (DPLL1)
|
||||||
|
// <i> This defines the clock source for generic clock generator 11
|
||||||
|
// <id> gclk_gen_11_oscillator
|
||||||
|
#ifndef CONF_GCLK_GEN_11_SOURCE
|
||||||
|
#define CONF_GCLK_GEN_11_SOURCE GCLK_GENCTRL_SRC_XOSC1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Run in Standby
|
||||||
|
// <i> Indicates whether Run in Standby is enabled or not
|
||||||
|
// <id> gclk_arch_gen_11_runstdby
|
||||||
|
#ifndef CONF_GCLK_GEN_11_RUNSTDBY
|
||||||
|
#define CONF_GCLK_GEN_11_RUNSTDBY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Divide Selection
|
||||||
|
// <i> Indicates whether Divide Selection is enabled or not
|
||||||
|
//<id> gclk_gen_11_div_sel
|
||||||
|
#ifndef CONF_GCLK_GEN_11_DIVSEL
|
||||||
|
#define CONF_GCLK_GEN_11_DIVSEL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Enable
|
||||||
|
// <i> Indicates whether Output Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_11_oe
|
||||||
|
#ifndef CONF_GCLK_GEN_11_OE
|
||||||
|
#define CONF_GCLK_GEN_11_OE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Output Off Value
|
||||||
|
// <i> Indicates whether Output Off Value is enabled or not
|
||||||
|
// <id> gclk_arch_gen_11_oov
|
||||||
|
#ifndef CONF_GCLK_GEN_11_OOV
|
||||||
|
#define CONF_GCLK_GEN_11_OOV 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Improve Duty Cycle
|
||||||
|
// <i> Indicates whether Improve Duty Cycle is enabled or not
|
||||||
|
// <id> gclk_arch_gen_11_idc
|
||||||
|
#ifndef CONF_GCLK_GEN_11_IDC
|
||||||
|
#define CONF_GCLK_GEN_11_IDC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Generic Clock Generator Enable
|
||||||
|
// <i> Indicates whether Generic Clock Generator Enable is enabled or not
|
||||||
|
// <id> gclk_arch_gen_11_enable
|
||||||
|
#ifndef CONF_GCLK_GEN_11_GENEN
|
||||||
|
#define CONF_GCLK_GEN_11_GENEN 0
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
//<h> Generic Clock Generator Division
|
||||||
|
//<o> Generic clock generator 11 division <0x0000-0xFFFF>
|
||||||
|
// <id> gclk_gen_11_div
|
||||||
|
#ifndef CONF_GCLK_GEN_11_DIV
|
||||||
|
#define CONF_GCLK_GEN_11_DIV 1
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
// <<< end of configuration section >>>
|
||||||
|
|
||||||
|
#endif // HPL_GCLK_CONFIG_H
|
|
@ -0,0 +1,104 @@
|
||||||
|
/* Auto-generated config file hpl_mclk_config.h */
|
||||||
|
#ifndef HPL_MCLK_CONFIG_H
|
||||||
|
#define HPL_MCLK_CONFIG_H
|
||||||
|
|
||||||
|
// <<< Use Configuration Wizard in Context Menu >>>
|
||||||
|
|
||||||
|
#include <peripheral_clk_config.h>
|
||||||
|
|
||||||
|
// <e> System Configuration
|
||||||
|
// <i> Indicates whether configuration for system is enabled or not
|
||||||
|
// <id> enable_cpu_clock
|
||||||
|
#ifndef CONF_SYSTEM_CONFIG
|
||||||
|
#define CONF_SYSTEM_CONFIG 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> Basic settings
|
||||||
|
// <y> CPU Clock source
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK0_Val"> Generic clock generator 0
|
||||||
|
// <i> This defines the clock source for the CPU
|
||||||
|
// <id> cpu_clock_source
|
||||||
|
#ifndef CONF_CPU_SRC
|
||||||
|
#define CONF_CPU_SRC GCLK_PCHCTRL_GEN_GCLK0_Val
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <y> CPU Clock Division Factor
|
||||||
|
// <MCLK_CPUDIV_DIV_DIV1_Val"> 1
|
||||||
|
// <MCLK_CPUDIV_DIV_DIV2_Val"> 2
|
||||||
|
// <MCLK_CPUDIV_DIV_DIV4_Val"> 4
|
||||||
|
// <MCLK_CPUDIV_DIV_DIV8_Val"> 8
|
||||||
|
// <MCLK_CPUDIV_DIV_DIV16_Val"> 16
|
||||||
|
// <MCLK_CPUDIV_DIV_DIV32_Val"> 32
|
||||||
|
// <MCLK_CPUDIV_DIV_DIV64_Val"> 64
|
||||||
|
// <MCLK_CPUDIV_DIV_DIV128_Val"> 128
|
||||||
|
// <i> Prescalar for CPU clock
|
||||||
|
// <id> cpu_div
|
||||||
|
#ifndef CONF_MCLK_CPUDIV
|
||||||
|
#define CONF_MCLK_CPUDIV MCLK_CPUDIV_DIV_DIV1_Val
|
||||||
|
#endif
|
||||||
|
// <y> Low Power Clock Division
|
||||||
|
// <MCLK_LPDIV_LPDIV_DIV1_Val"> Divide by 1
|
||||||
|
// <MCLK_LPDIV_LPDIV_DIV2_Val"> Divide by 2
|
||||||
|
// <MCLK_LPDIV_LPDIV_DIV4_Val"> Divide by 4
|
||||||
|
// <MCLK_LPDIV_LPDIV_DIV8_Val"> Divide by 8
|
||||||
|
// <MCLK_LPDIV_LPDIV_DIV16_Val"> Divide by 16
|
||||||
|
// <MCLK_LPDIV_LPDIV_DIV32_Val"> Divide by 32
|
||||||
|
// <MCLK_LPDIV_LPDIV_DIV64_Val"> Divide by 64
|
||||||
|
// <MCLK_LPDIV_LPDIV_DIV128_Val"> Divide by 128
|
||||||
|
// <id> mclk_arch_lpdiv
|
||||||
|
#ifndef CONF_MCLK_LPDIV
|
||||||
|
#define CONF_MCLK_LPDIV MCLK_LPDIV_LPDIV_DIV4_Val
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <y> Backup Clock Division
|
||||||
|
// <MCLK_BUPDIV_BUPDIV_DIV1_Val"> Divide by 1
|
||||||
|
// <MCLK_BUPDIV_BUPDIV_DIV2_Val"> Divide by 2
|
||||||
|
// <MCLK_BUPDIV_BUPDIV_DIV4_Val"> Divide by 4
|
||||||
|
// <MCLK_BUPDIV_BUPDIV_DIV8_Val"> Divide by 8
|
||||||
|
// <MCLK_BUPDIV_BUPDIV_DIV16_Val"> Divide by 16
|
||||||
|
// <MCLK_BUPDIV_BUPDIV_DIV32_Val"> Divide by 32
|
||||||
|
// <MCLK_BUPDIV_BUPDIV_DIV64_Val"> Divide by 64
|
||||||
|
// <MCLK_BUPDIV_BUPDIV_DIV128_Val"> Divide by 128
|
||||||
|
// <id> mclk_arch_bupdiv
|
||||||
|
#ifndef CONF_MCLK_BUPDIV
|
||||||
|
#define CONF_MCLK_BUPDIV MCLK_BUPDIV_BUPDIV_DIV8_Val
|
||||||
|
#endif
|
||||||
|
// <y> High-Speed Clock Division
|
||||||
|
// <MCLK_HSDIV_DIV_DIV1_Val"> Divide by 1
|
||||||
|
// <id> mclk_arch_hsdiv
|
||||||
|
#ifndef CONF_MCLK_HSDIV
|
||||||
|
#define CONF_MCLK_HSDIV MCLK_HSDIV_DIV_DIV1_Val
|
||||||
|
#endif
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
// <h> NVM Settings
|
||||||
|
// <o> NVM Wait States
|
||||||
|
// <i> These bits select the number of wait states for a read operation.
|
||||||
|
// <0=> 0
|
||||||
|
// <1=> 1
|
||||||
|
// <2=> 2
|
||||||
|
// <3=> 3
|
||||||
|
// <4=> 4
|
||||||
|
// <5=> 5
|
||||||
|
// <6=> 6
|
||||||
|
// <7=> 7
|
||||||
|
// <8=> 8
|
||||||
|
// <9=> 9
|
||||||
|
// <10=> 10
|
||||||
|
// <11=> 11
|
||||||
|
// <12=> 12
|
||||||
|
// <13=> 13
|
||||||
|
// <14=> 14
|
||||||
|
// <15=> 15
|
||||||
|
// <id> nvm_wait_states
|
||||||
|
#ifndef CONF_NVM_WAIT_STATE
|
||||||
|
#define CONF_NVM_WAIT_STATE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
// <<< end of configuration section >>>
|
||||||
|
|
||||||
|
#endif // HPL_MCLK_CONFIG_H
|
|
@ -0,0 +1,165 @@
|
||||||
|
/* Auto-generated config file hpl_osc32kctrl_config.h */
|
||||||
|
#ifndef HPL_OSC32KCTRL_CONFIG_H
|
||||||
|
#define HPL_OSC32KCTRL_CONFIG_H
|
||||||
|
|
||||||
|
// <<< Use Configuration Wizard in Context Menu >>>
|
||||||
|
|
||||||
|
// <e> RTC Source configuration
|
||||||
|
// <id> enable_rtc_source
|
||||||
|
#ifndef CONF_RTCCTRL_CONFIG
|
||||||
|
#define CONF_RTCCTRL_CONFIG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> RTC source control
|
||||||
|
// <y> RTC Clock Source Selection
|
||||||
|
// <GCLK_GENCTRL_SRC_OSCULP32K"> 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC32K"> 32kHz External Crystal Oscillator (XOSC32K)
|
||||||
|
// <i> This defines the clock source for RTC
|
||||||
|
// <id> rtc_source_oscillator
|
||||||
|
#ifndef CONF_RTCCTRL_SRC
|
||||||
|
#define CONF_RTCCTRL_SRC GCLK_GENCTRL_SRC_OSCULP32K
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Use 1 kHz output
|
||||||
|
// <id> rtc_1khz_selection
|
||||||
|
#ifndef CONF_RTCCTRL_1KHZ
|
||||||
|
|
||||||
|
#define CONF_RTCCTRL_1KHZ 0
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if CONF_RTCCTRL_SRC == GCLK_GENCTRL_SRC_OSCULP32K
|
||||||
|
#define CONF_RTCCTRL (CONF_RTCCTRL_1KHZ ? OSC32KCTRL_RTCCTRL_RTCSEL_ULP1K_Val : OSC32KCTRL_RTCCTRL_RTCSEL_ULP32K_Val)
|
||||||
|
#elif CONF_RTCCTRL_SRC == GCLK_GENCTRL_SRC_XOSC32K
|
||||||
|
#define CONF_RTCCTRL (CONF_RTCCTRL_1KHZ ? OSC32KCTRL_RTCCTRL_RTCSEL_XOSC1K_Val : OSC32KCTRL_RTCCTRL_RTCSEL_XOSC32K_Val)
|
||||||
|
#else
|
||||||
|
#error unexpected CONF_RTCCTRL_SRC
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
// <e> 32kHz External Crystal Oscillator Configuration
|
||||||
|
// <i> Indicates whether configuration for External 32K Osc is enabled or not
|
||||||
|
// <id> enable_xosc32k
|
||||||
|
#ifndef CONF_XOSC32K_CONFIG
|
||||||
|
#define CONF_XOSC32K_CONFIG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> 32kHz External Crystal Oscillator Control
|
||||||
|
// <q> Oscillator enable
|
||||||
|
// <i> Indicates whether 32kHz External Crystal Oscillator is enabled or not
|
||||||
|
// <id> xosc32k_arch_enable
|
||||||
|
#ifndef CONF_XOSC32K_ENABLE
|
||||||
|
#define CONF_XOSC32K_ENABLE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Start-Up Time
|
||||||
|
// <0x0=>62592us
|
||||||
|
// <0x1=>125092us
|
||||||
|
// <0x2=>500092us
|
||||||
|
// <0x3=>1000092us
|
||||||
|
// <0x4=>2000092us
|
||||||
|
// <0x5=>4000092us
|
||||||
|
// <0x6=>8000092us
|
||||||
|
// <id> xosc32k_arch_startup
|
||||||
|
#ifndef CONF_XOSC32K_STARTUP
|
||||||
|
#define CONF_XOSC32K_STARTUP 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> On Demand Control
|
||||||
|
// <i> Indicates whether On Demand Control is enabled or not
|
||||||
|
// <id> xosc32k_arch_ondemand
|
||||||
|
#ifndef CONF_XOSC32K_ONDEMAND
|
||||||
|
#define CONF_XOSC32K_ONDEMAND 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Run in Standby
|
||||||
|
// <i> Indicates whether Run in Standby is enabled or not
|
||||||
|
// <id> xosc32k_arch_runstdby
|
||||||
|
#ifndef CONF_XOSC32K_RUNSTDBY
|
||||||
|
#define CONF_XOSC32K_RUNSTDBY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> 1kHz Output Enable
|
||||||
|
// <i> Indicates whether 1kHz Output is enabled or not
|
||||||
|
// <id> xosc32k_arch_en1k
|
||||||
|
#ifndef CONF_XOSC32K_EN1K
|
||||||
|
#define CONF_XOSC32K_EN1K 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> 32kHz Output Enable
|
||||||
|
// <i> Indicates whether 32kHz Output is enabled or not
|
||||||
|
// <id> xosc32k_arch_en32k
|
||||||
|
#ifndef CONF_XOSC32K_EN32K
|
||||||
|
#define CONF_XOSC32K_EN32K 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Clock Switch Back
|
||||||
|
// <i> Indicates whether Clock Switch Back is enabled or not
|
||||||
|
// <id> xosc32k_arch_swben
|
||||||
|
#ifndef CONF_XOSC32K_SWBEN
|
||||||
|
#define CONF_XOSC32K_SWBEN 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Clock Failure Detector
|
||||||
|
// <i> Indicates whether Clock Failure Detector is enabled or not
|
||||||
|
// <id> xosc32k_arch_cfden
|
||||||
|
#ifndef CONF_XOSC32K_CFDEN
|
||||||
|
#define CONF_XOSC32K_CFDEN 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Clock Failure Detector Event Out
|
||||||
|
// <i> Indicates whether Clock Failure Detector Event Out is enabled or not
|
||||||
|
// <id> xosc32k_arch_cfdeo
|
||||||
|
#ifndef CONF_XOSC32K_CFDEO
|
||||||
|
#define CONF_XOSC32K_CFDEO 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Crystal connected to XIN32/XOUT32 Enable
|
||||||
|
// <i> Indicates whether the connections between the I/O pads and the external clock or crystal oscillator is enabled or not
|
||||||
|
// <id> xosc32k_arch_xtalen
|
||||||
|
#ifndef CONF_XOSC32K_XTALEN
|
||||||
|
#define CONF_XOSC32K_XTALEN 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Control Gain Mode
|
||||||
|
// <0x0=>Low Power mode
|
||||||
|
// <0x1=>Standard mode
|
||||||
|
// <0x2=>High Speed mode
|
||||||
|
// <id> xosc32k_arch_cgm
|
||||||
|
#ifndef CONF_XOSC32K_CGM
|
||||||
|
#define CONF_XOSC32K_CGM 0x1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
// <e> 32kHz Ultra Low Power Internal Oscillator Configuration
|
||||||
|
// <i> Indicates whether configuration for OSCULP32K is enabled or not
|
||||||
|
// <id> enable_osculp32k
|
||||||
|
#ifndef CONF_OSCULP32K_CONFIG
|
||||||
|
#define CONF_OSCULP32K_CONFIG 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> 32kHz Ultra Low Power Internal Oscillator Control
|
||||||
|
|
||||||
|
// <q> Oscillator Calibration Control
|
||||||
|
// <i> Indicates whether Oscillator Calibration is enabled or not
|
||||||
|
// <id> osculp32k_calib_enable
|
||||||
|
#ifndef CONF_OSCULP32K_CALIB_ENABLE
|
||||||
|
#define CONF_OSCULP32K_CALIB_ENABLE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Oscillator Calibration <0x0-0x3F>
|
||||||
|
// <id> osculp32k_calib
|
||||||
|
#ifndef CONF_OSCULP32K_CALIB
|
||||||
|
#define CONF_OSCULP32K_CALIB 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
// <<< end of configuration section >>>
|
||||||
|
|
||||||
|
#endif // HPL_OSC32KCTRL_CONFIG_H
|
|
@ -0,0 +1,640 @@
|
||||||
|
/* Auto-generated config file hpl_oscctrl_config.h */
|
||||||
|
#ifndef HPL_OSCCTRL_CONFIG_H
|
||||||
|
#define HPL_OSCCTRL_CONFIG_H
|
||||||
|
|
||||||
|
// <<< Use Configuration Wizard in Context Menu >>>
|
||||||
|
|
||||||
|
// <e> External Multipurpose Crystal Oscillator Configuration
|
||||||
|
// <i> Indicates whether configuration for XOSC0 is enabled or not
|
||||||
|
// <id> enable_xosc0
|
||||||
|
#ifndef CONF_XOSC0_CONFIG
|
||||||
|
#define CONF_XOSC0_CONFIG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Frequency <8000000-48000000>
|
||||||
|
// <i> Oscillation frequency of the resonator connected to the External Multipurpose Crystal Oscillator.
|
||||||
|
// <id> xosc0_frequency
|
||||||
|
#ifndef CONF_XOSC_FREQUENCY
|
||||||
|
#define CONF_XOSC0_FREQUENCY 12000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> External Multipurpose Crystal Oscillator Control
|
||||||
|
// <q> Oscillator enable
|
||||||
|
// <i> Indicates whether External Multipurpose Crystal Oscillator is enabled or not
|
||||||
|
// <id> xosc0_arch_enable
|
||||||
|
#ifndef CONF_XOSC0_ENABLE
|
||||||
|
#define CONF_XOSC0_ENABLE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Start-Up Time
|
||||||
|
// <0x0=>31us
|
||||||
|
// <0x1=>61us
|
||||||
|
// <0x2=>122us
|
||||||
|
// <0x3=>244us
|
||||||
|
// <0x4=>488us
|
||||||
|
// <0x5=>977us
|
||||||
|
// <0x6=>1953us
|
||||||
|
// <0x7=>3906us
|
||||||
|
// <0x8=>7813us
|
||||||
|
// <0x9=>15625us
|
||||||
|
// <0xA=>31250us
|
||||||
|
// <0xB=>62500us
|
||||||
|
// <0xC=>125000us
|
||||||
|
// <0xD=>250000us
|
||||||
|
// <0xE=>500000us
|
||||||
|
// <0xF=>1000000us
|
||||||
|
// <id> xosc0_arch_startup
|
||||||
|
#ifndef CONF_XOSC0_STARTUP
|
||||||
|
#define CONF_XOSC0_STARTUP 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Clock Switch Back
|
||||||
|
// <i> Indicates whether Clock Switch Back is enabled or not
|
||||||
|
// <id> xosc0_arch_swben
|
||||||
|
#ifndef CONF_XOSC0_SWBEN
|
||||||
|
#define CONF_XOSC0_SWBEN 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Clock Failure Detector
|
||||||
|
// <i> Indicates whether Clock Failure Detector is enabled or not
|
||||||
|
// <id> xosc0_arch_cfden
|
||||||
|
#ifndef CONF_XOSC0_CFDEN
|
||||||
|
#define CONF_XOSC0_CFDEN 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Automatic Loop Control Enable
|
||||||
|
// <i> Indicates whether Automatic Loop Control is enabled or not
|
||||||
|
// <id> xosc0_arch_enalc
|
||||||
|
#ifndef CONF_XOSC0_ENALC
|
||||||
|
#define CONF_XOSC0_ENALC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Low Buffer Gain Enable
|
||||||
|
// <i> Indicates whether Low Buffer Gain is enabled or not
|
||||||
|
// <id> xosc0_arch_lowbufgain
|
||||||
|
#ifndef CONF_XOSC0_LOWBUFGAIN
|
||||||
|
#define CONF_XOSC0_LOWBUFGAIN 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> On Demand Control
|
||||||
|
// <i> Indicates whether On Demand Control is enabled or not
|
||||||
|
// <id> xosc0_arch_ondemand
|
||||||
|
#ifndef CONF_XOSC0_ONDEMAND
|
||||||
|
#define CONF_XOSC0_ONDEMAND 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Run in Standby
|
||||||
|
// <i> Indicates whether Run in Standby is enabled or not
|
||||||
|
// <id> xosc0_arch_runstdby
|
||||||
|
#ifndef CONF_XOSC0_RUNSTDBY
|
||||||
|
#define CONF_XOSC0_RUNSTDBY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Crystal connected to XIN/XOUT Enable
|
||||||
|
// <i> Indicates whether the connections between the I/O pads and the external clock or crystal oscillator is enabled or not
|
||||||
|
// <id> xosc0_arch_xtalen
|
||||||
|
#ifndef CONF_XOSC0_XTALEN
|
||||||
|
#define CONF_XOSC0_XTALEN 0
|
||||||
|
#endif
|
||||||
|
//</h>
|
||||||
|
//</e>
|
||||||
|
|
||||||
|
#if CONF_XOSC0_FREQUENCY >= 32000000
|
||||||
|
#define CONF_XOSC0_CFDPRESC 0x0
|
||||||
|
#define CONF_XOSC0_IMULT 0x7
|
||||||
|
#define CONF_XOSC0_IPTAT 0x3
|
||||||
|
#elif CONF_XOSC0_FREQUENCY >= 24000000
|
||||||
|
#define CONF_XOSC0_CFDPRESC 0x1
|
||||||
|
#define CONF_XOSC0_IMULT 0x6
|
||||||
|
#define CONF_XOSC0_IPTAT 0x3
|
||||||
|
#elif CONF_XOSC0_FREQUENCY >= 16000000
|
||||||
|
#define CONF_XOSC0_CFDPRESC 0x2
|
||||||
|
#define CONF_XOSC0_IMULT 0x5
|
||||||
|
#define CONF_XOSC0_IPTAT 0x3
|
||||||
|
#elif CONF_XOSC0_FREQUENCY >= 8000000
|
||||||
|
#define CONF_XOSC0_CFDPRESC 0x3
|
||||||
|
#define CONF_XOSC0_IMULT 0x4
|
||||||
|
#define CONF_XOSC0_IPTAT 0x3
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <e> External Multipurpose Crystal Oscillator Configuration
|
||||||
|
// <i> Indicates whether configuration for XOSC1 is enabled or not
|
||||||
|
// <id> enable_xosc1
|
||||||
|
#ifndef CONF_XOSC1_CONFIG
|
||||||
|
#define CONF_XOSC1_CONFIG 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Frequency <8000000-48000000>
|
||||||
|
// <i> Oscillation frequency of the resonator connected to the External Multipurpose Crystal Oscillator.
|
||||||
|
// <id> xosc1_frequency
|
||||||
|
#ifndef CONF_XOSC_FREQUENCY
|
||||||
|
#define CONF_XOSC1_FREQUENCY 12000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> External Multipurpose Crystal Oscillator Control
|
||||||
|
// <q> Oscillator enable
|
||||||
|
// <i> Indicates whether External Multipurpose Crystal Oscillator is enabled or not
|
||||||
|
// <id> xosc1_arch_enable
|
||||||
|
#ifndef CONF_XOSC1_ENABLE
|
||||||
|
#define CONF_XOSC1_ENABLE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Start-Up Time
|
||||||
|
// <0x0=>31us
|
||||||
|
// <0x1=>61us
|
||||||
|
// <0x2=>122us
|
||||||
|
// <0x3=>244us
|
||||||
|
// <0x4=>488us
|
||||||
|
// <0x5=>977us
|
||||||
|
// <0x6=>1953us
|
||||||
|
// <0x7=>3906us
|
||||||
|
// <0x8=>7813us
|
||||||
|
// <0x9=>15625us
|
||||||
|
// <0xA=>31250us
|
||||||
|
// <0xB=>62500us
|
||||||
|
// <0xC=>125000us
|
||||||
|
// <0xD=>250000us
|
||||||
|
// <0xE=>500000us
|
||||||
|
// <0xF=>1000000us
|
||||||
|
// <id> xosc1_arch_startup
|
||||||
|
#ifndef CONF_XOSC1_STARTUP
|
||||||
|
#define CONF_XOSC1_STARTUP 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Clock Switch Back
|
||||||
|
// <i> Indicates whether Clock Switch Back is enabled or not
|
||||||
|
// <id> xosc1_arch_swben
|
||||||
|
#ifndef CONF_XOSC1_SWBEN
|
||||||
|
#define CONF_XOSC1_SWBEN 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Clock Failure Detector
|
||||||
|
// <i> Indicates whether Clock Failure Detector is enabled or not
|
||||||
|
// <id> xosc1_arch_cfden
|
||||||
|
#ifndef CONF_XOSC1_CFDEN
|
||||||
|
#define CONF_XOSC1_CFDEN 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Automatic Loop Control Enable
|
||||||
|
// <i> Indicates whether Automatic Loop Control is enabled or not
|
||||||
|
// <id> xosc1_arch_enalc
|
||||||
|
#ifndef CONF_XOSC1_ENALC
|
||||||
|
#define CONF_XOSC1_ENALC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Low Buffer Gain Enable
|
||||||
|
// <i> Indicates whether Low Buffer Gain is enabled or not
|
||||||
|
// <id> xosc1_arch_lowbufgain
|
||||||
|
#ifndef CONF_XOSC1_LOWBUFGAIN
|
||||||
|
#define CONF_XOSC1_LOWBUFGAIN 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> On Demand Control
|
||||||
|
// <i> Indicates whether On Demand Control is enabled or not
|
||||||
|
// <id> xosc1_arch_ondemand
|
||||||
|
#ifndef CONF_XOSC1_ONDEMAND
|
||||||
|
#define CONF_XOSC1_ONDEMAND 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Run in Standby
|
||||||
|
// <i> Indicates whether Run in Standby is enabled or not
|
||||||
|
// <id> xosc1_arch_runstdby
|
||||||
|
#ifndef CONF_XOSC1_RUNSTDBY
|
||||||
|
#define CONF_XOSC1_RUNSTDBY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Crystal connected to XIN/XOUT Enable
|
||||||
|
// <i> Indicates whether the connections between the I/O pads and the external clock or crystal oscillator is enabled or not
|
||||||
|
// <id> xosc1_arch_xtalen
|
||||||
|
#ifndef CONF_XOSC1_XTALEN
|
||||||
|
#define CONF_XOSC1_XTALEN 1
|
||||||
|
#endif
|
||||||
|
//</h>
|
||||||
|
//</e>
|
||||||
|
|
||||||
|
#if CONF_XOSC1_FREQUENCY >= 32000000
|
||||||
|
#define CONF_XOSC1_CFDPRESC 0x0
|
||||||
|
#define CONF_XOSC1_IMULT 0x7
|
||||||
|
#define CONF_XOSC1_IPTAT 0x3
|
||||||
|
#elif CONF_XOSC1_FREQUENCY >= 24000000
|
||||||
|
#define CONF_XOSC1_CFDPRESC 0x1
|
||||||
|
#define CONF_XOSC1_IMULT 0x6
|
||||||
|
#define CONF_XOSC1_IPTAT 0x3
|
||||||
|
#elif CONF_XOSC1_FREQUENCY >= 16000000
|
||||||
|
#define CONF_XOSC1_CFDPRESC 0x2
|
||||||
|
#define CONF_XOSC1_IMULT 0x5
|
||||||
|
#define CONF_XOSC1_IPTAT 0x3
|
||||||
|
#elif CONF_XOSC1_FREQUENCY >= 8000000
|
||||||
|
#define CONF_XOSC1_CFDPRESC 0x3
|
||||||
|
#define CONF_XOSC1_IMULT 0x4
|
||||||
|
#define CONF_XOSC1_IPTAT 0x3
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <e> DFLL Configuration
|
||||||
|
// <i> Indicates whether configuration for DFLL is enabled or not
|
||||||
|
// <id> enable_dfll
|
||||||
|
#ifndef CONF_DFLL_CONFIG
|
||||||
|
#define CONF_DFLL_CONFIG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <y> Reference Clock Source
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK0_Val"> Generic clock generator 0
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK1_Val"> Generic clock generator 1
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK2_Val"> Generic clock generator 2
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK3_Val"> Generic clock generator 3
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK4_Val"> Generic clock generator 4
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK5_Val"> Generic clock generator 5
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK6_Val"> Generic clock generator 6
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK7_Val"> Generic clock generator 7
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK8_Val"> Generic clock generator 8
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK9_Val"> Generic clock generator 9
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK10_Val"> Generic clock generator 10
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK11_Val"> Generic clock generator 11
|
||||||
|
// <i> Select the clock source
|
||||||
|
// <id> dfll_ref_clock
|
||||||
|
#ifndef CONF_DFLL_GCLK
|
||||||
|
#define CONF_DFLL_GCLK GCLK_PCHCTRL_GEN_GCLK3_Val
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> Digital Frequency Locked Loop Control
|
||||||
|
// <q> DFLL Enable
|
||||||
|
// <i> Indicates whether DFLL is enabled or not
|
||||||
|
// <id> dfll_arch_enable
|
||||||
|
#ifndef CONF_DFLL_ENABLE
|
||||||
|
#define CONF_DFLL_ENABLE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> On Demand Control
|
||||||
|
// <i> Indicates whether On Demand Control is enabled or not
|
||||||
|
// <id> dfll_arch_ondemand
|
||||||
|
#ifndef CONF_DFLL_ONDEMAND
|
||||||
|
#define CONF_DFLL_ONDEMAND 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Run in Standby
|
||||||
|
// <i> Indicates whether Run in Standby is enabled or not
|
||||||
|
// <id> dfll_arch_runstdby
|
||||||
|
#ifndef CONF_DFLL_RUNSTDBY
|
||||||
|
#define CONF_DFLL_RUNSTDBY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> USB Clock Recovery Mode
|
||||||
|
// <i> Indicates whether USB Clock Recovery Mode is enabled or not
|
||||||
|
// <id> dfll_arch_usbcrm
|
||||||
|
#ifndef CONF_DFLL_USBCRM
|
||||||
|
#define CONF_DFLL_USBCRM 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Wait Lock
|
||||||
|
// <i> Indicates whether Wait Lock is enabled or not
|
||||||
|
// <id> dfll_arch_waitlock
|
||||||
|
#ifndef CONF_DFLL_WAITLOCK
|
||||||
|
#define CONF_DFLL_WAITLOCK 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Bypass Coarse Lock
|
||||||
|
// <i> Indicates whether Bypass Coarse Lock is enabled or not
|
||||||
|
// <id> dfll_arch_bplckc
|
||||||
|
#ifndef CONF_DFLL_BPLCKC
|
||||||
|
#define CONF_DFLL_BPLCKC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Quick Lock Disable
|
||||||
|
// <i> Indicates whether Quick Lock Disable is enabled or not
|
||||||
|
// <id> dfll_arch_qldis
|
||||||
|
#ifndef CONF_DFLL_QLDIS
|
||||||
|
#define CONF_DFLL_QLDIS 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Chill Cycle Disable
|
||||||
|
// <i> Indicates whether Chill Cycle Disable is enabled or not
|
||||||
|
// <id> dfll_arch_ccdis
|
||||||
|
#ifndef CONF_DFLL_CCDIS
|
||||||
|
#define CONF_DFLL_CCDIS 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Lose Lock After Wake
|
||||||
|
// <i> Indicates whether Lose Lock After Wake is enabled or not
|
||||||
|
// <id> dfll_arch_llaw
|
||||||
|
#ifndef CONF_DFLL_LLAW
|
||||||
|
#define CONF_DFLL_LLAW 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Stable DFLL Frequency
|
||||||
|
// <i> Indicates whether Stable DFLL Frequency is enabled or not
|
||||||
|
// <id> dfll_arch_stable
|
||||||
|
#ifndef CONF_DFLL_STABLE
|
||||||
|
#define CONF_DFLL_STABLE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Operating Mode Selection
|
||||||
|
// <0=>Open Loop Mode
|
||||||
|
// <1=>Closed Loop Mode
|
||||||
|
// <id> dfll_mode
|
||||||
|
#ifndef CONF_DFLL_MODE
|
||||||
|
#define CONF_DFLL_MODE 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Coarse Maximum Step <0x0-0x1F>
|
||||||
|
// <id> dfll_arch_cstep
|
||||||
|
#ifndef CONF_DFLL_CSTEP
|
||||||
|
#define CONF_DFLL_CSTEP 0x1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Fine Maximum Step <0x0-0xFF>
|
||||||
|
// <id> dfll_arch_fstep
|
||||||
|
#ifndef CONF_DFLL_FSTEP
|
||||||
|
#define CONF_DFLL_FSTEP 0x1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> DFLL Multiply Factor <0x0-0xFFFF>
|
||||||
|
// <id> dfll_mul
|
||||||
|
#ifndef CONF_DFLL_MUL
|
||||||
|
#define CONF_DFLL_MUL 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <e> DFLL Calibration Overwrite
|
||||||
|
// <i> Indicates whether Overwrite Calibration value of DFLL
|
||||||
|
// <id> dfll_arch_calibration
|
||||||
|
#ifndef CONF_DFLL_OVERWRITE_CALIBRATION
|
||||||
|
#define CONF_DFLL_OVERWRITE_CALIBRATION 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Coarse Value <0x0-0x3F>
|
||||||
|
// <id> dfll_arch_coarse
|
||||||
|
#ifndef CONF_DFLL_COARSE
|
||||||
|
#define CONF_DFLL_COARSE (0x1f / 4)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Fine Value <0x0-0xFF>
|
||||||
|
// <id> dfll_arch_fine
|
||||||
|
#ifndef CONF_DFLL_FINE
|
||||||
|
#define CONF_DFLL_FINE (0x80)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//</e>
|
||||||
|
|
||||||
|
//</h>
|
||||||
|
|
||||||
|
//</e>
|
||||||
|
|
||||||
|
// <e> FDPLL0 Configuration
|
||||||
|
// <i> Indicates whether configuration for FDPLL0 is enabled or not
|
||||||
|
// <id> enable_fdpll0
|
||||||
|
#ifndef CONF_FDPLL0_CONFIG
|
||||||
|
#define CONF_FDPLL0_CONFIG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <y> Reference Clock Source
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC32K"> 32kHz External Crystal Oscillator (XOSC32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC0"> External Crystal Oscillator 8-48MHz (XOSC0)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC1"> External Crystal Oscillator 8-48MHz (XOSC1)
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK0_Val"> Generic clock generator 0
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK1_Val"> Generic clock generator 1
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK2_Val"> Generic clock generator 2
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK3_Val"> Generic clock generator 3
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK4_Val"> Generic clock generator 4
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK5_Val"> Generic clock generator 5
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK6_Val"> Generic clock generator 6
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK7_Val"> Generic clock generator 7
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK8_Val"> Generic clock generator 8
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK9_Val"> Generic clock generator 9
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK10_Val"> Generic clock generator 10
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK11_Val"> Generic clock generator 11
|
||||||
|
// <i> Select the clock source.
|
||||||
|
// <id> fdpll0_ref_clock
|
||||||
|
#ifndef CONF_FDPLL0_GCLK
|
||||||
|
#define CONF_FDPLL0_GCLK GCLK_GENCTRL_SRC_XOSC32K
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> Digital Phase Locked Loop Control
|
||||||
|
// <q> Enable
|
||||||
|
// <i> Indicates whether Digital Phase Locked Loop is enabled or not
|
||||||
|
// <id> fdpll0_arch_enable
|
||||||
|
#ifndef CONF_FDPLL0_ENABLE
|
||||||
|
#define CONF_FDPLL0_ENABLE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> On Demand Control
|
||||||
|
// <i> Indicates whether On Demand Control is enabled or not
|
||||||
|
// <id> fdpll0_arch_ondemand
|
||||||
|
#ifndef CONF_FDPLL0_ONDEMAND
|
||||||
|
#define CONF_FDPLL0_ONDEMAND 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Run in Standby
|
||||||
|
// <i> Indicates whether Run in Standby is enabled or not
|
||||||
|
// <id> fdpll0_arch_runstdby
|
||||||
|
#ifndef CONF_FDPLL0_RUNSTDBY
|
||||||
|
#define CONF_FDPLL0_RUNSTDBY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Loop Divider Ratio Fractional Part <0x0-0x1F>
|
||||||
|
// <i> Value of LDRFRAC is calculated using Fclk_dpll=Fckr*(LDR+1+LDRFRAC/32) formula as given in datasheet. This value is directly written in to DPLLRATIO register
|
||||||
|
// <id> fdpll0_ldrfrac
|
||||||
|
#ifndef CONF_FDPLL0_LDRFRAC
|
||||||
|
#define CONF_FDPLL0_LDRFRAC 0xd
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Loop Divider Ratio Integer Part <0x0-0x1FFF>
|
||||||
|
// <i> Value of LDR is calculated using Fclk_dpll=Fckr*(LDR+1+LDRFRAC/32) formula as given in datasheet. This value is directly written in to DPLLRATIO register
|
||||||
|
// <id> fdpll0_ldr
|
||||||
|
#ifndef CONF_FDPLL0_LDR
|
||||||
|
#define CONF_FDPLL0_LDR 0x5b7
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Clock Divider <0x0-0x7FF>
|
||||||
|
// <i> This Clock divider is only for XOSC clock input to DPLL
|
||||||
|
// <id> fdpll0_clock_div
|
||||||
|
#ifndef CONF_FDPLL0_DIV
|
||||||
|
#define CONF_FDPLL0_DIV 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> DCO Filter Enable
|
||||||
|
// <i> Indicates whether DCO Filter Enable is enabled or not
|
||||||
|
// <id> fdpll0_arch_dcoen
|
||||||
|
#ifndef CONF_FDPLL0_DCOEN
|
||||||
|
#define CONF_FDPLL0_DCOEN 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Sigma-Delta DCO Filter Selection <0x0-0x7>
|
||||||
|
// <id> fdpll0_clock_dcofilter
|
||||||
|
#ifndef CONF_FDPLL0_DCOFILTER
|
||||||
|
#define CONF_FDPLL0_DCOFILTER 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Lock Bypass
|
||||||
|
// <i> Indicates whether Lock Bypass is enabled or not
|
||||||
|
// <id> fdpll0_arch_lbypass
|
||||||
|
#ifndef CONF_FDPLL0_LBYPASS
|
||||||
|
#define CONF_FDPLL0_LBYPASS 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Lock Time
|
||||||
|
// <0x0=>No time-out, automatic lock
|
||||||
|
// <0x4=>The Time-out if no lock within 800 us
|
||||||
|
// <0x5=>The Time-out if no lock within 900 us
|
||||||
|
// <0x6=>The Time-out if no lock within 1 ms
|
||||||
|
// <0x7=>The Time-out if no lock within 11 ms
|
||||||
|
// <id> fdpll0_arch_ltime
|
||||||
|
#ifndef CONF_FDPLL0_LTIME
|
||||||
|
#define CONF_FDPLL0_LTIME 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Reference Clock Selection
|
||||||
|
// <0x0=>GCLK clock reference
|
||||||
|
// <0x1=>XOSC32K clock reference
|
||||||
|
// <0x2=>XOSC0 clock reference
|
||||||
|
// <0x3=>XOSC1 clock reference
|
||||||
|
// <id> fdpll0_arch_refclk
|
||||||
|
#ifndef CONF_FDPLL0_REFCLK
|
||||||
|
#define CONF_FDPLL0_REFCLK 0x1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Wake Up Fast
|
||||||
|
// <i> Indicates whether Wake Up Fast is enabled or not
|
||||||
|
// <id> fdpll0_arch_wuf
|
||||||
|
#ifndef CONF_FDPLL0_WUF
|
||||||
|
#define CONF_FDPLL0_WUF 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Proportional Integral Filter Selection <0x0-0xF>
|
||||||
|
// <id> fdpll0_arch_filter
|
||||||
|
#ifndef CONF_FDPLL0_FILTER
|
||||||
|
#define CONF_FDPLL0_FILTER 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//</h>
|
||||||
|
//</e>
|
||||||
|
// <e> FDPLL1 Configuration
|
||||||
|
// <i> Indicates whether configuration for FDPLL1 is enabled or not
|
||||||
|
// <id> enable_fdpll1
|
||||||
|
#ifndef CONF_FDPLL1_CONFIG
|
||||||
|
#define CONF_FDPLL1_CONFIG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <y> Reference Clock Source
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC32K"> 32kHz External Crystal Oscillator (XOSC32K)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC0"> External Crystal Oscillator 8-48MHz (XOSC0)
|
||||||
|
// <GCLK_GENCTRL_SRC_XOSC1"> External Crystal Oscillator 8-48MHz (XOSC1)
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK0_Val"> Generic clock generator 0
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK1_Val"> Generic clock generator 1
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK2_Val"> Generic clock generator 2
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK3_Val"> Generic clock generator 3
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK4_Val"> Generic clock generator 4
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK5_Val"> Generic clock generator 5
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK6_Val"> Generic clock generator 6
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK7_Val"> Generic clock generator 7
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK8_Val"> Generic clock generator 8
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK9_Val"> Generic clock generator 9
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK10_Val"> Generic clock generator 10
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK11_Val"> Generic clock generator 11
|
||||||
|
// <i> Select the clock source.
|
||||||
|
// <id> fdpll1_ref_clock
|
||||||
|
#ifndef CONF_FDPLL1_GCLK
|
||||||
|
#define CONF_FDPLL1_GCLK GCLK_GENCTRL_SRC_XOSC32K
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> Digital Phase Locked Loop Control
|
||||||
|
// <q> Enable
|
||||||
|
// <i> Indicates whether Digital Phase Locked Loop is enabled or not
|
||||||
|
// <id> fdpll1_arch_enable
|
||||||
|
#ifndef CONF_FDPLL1_ENABLE
|
||||||
|
#define CONF_FDPLL1_ENABLE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> On Demand Control
|
||||||
|
// <i> Indicates whether On Demand Control is enabled or not
|
||||||
|
// <id> fdpll1_arch_ondemand
|
||||||
|
#ifndef CONF_FDPLL1_ONDEMAND
|
||||||
|
#define CONF_FDPLL1_ONDEMAND 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Run in Standby
|
||||||
|
// <i> Indicates whether Run in Standby is enabled or not
|
||||||
|
// <id> fdpll1_arch_runstdby
|
||||||
|
#ifndef CONF_FDPLL1_RUNSTDBY
|
||||||
|
#define CONF_FDPLL1_RUNSTDBY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Loop Divider Ratio Fractional Part <0x0-0x1F>
|
||||||
|
// <i> Value of LDRFRAC is calculated using Fclk_dpll=Fckr*(LDR+1+LDRFRAC/32) formula as given in datasheet. This value is directly written in to DPLLRATIO register
|
||||||
|
// <id> fdpll1_ldrfrac
|
||||||
|
#ifndef CONF_FDPLL1_LDRFRAC
|
||||||
|
#define CONF_FDPLL1_LDRFRAC 0xd
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Loop Divider Ratio Integer Part <0x0-0x1FFF>
|
||||||
|
// <i> Value of LDR is calculated using Fclk_dpll=Fckr*(LDR+1+LDRFRAC/32) formula as given in datasheet. This value is directly written in to DPLLRATIO register
|
||||||
|
// <id> fdpll1_ldr
|
||||||
|
#ifndef CONF_FDPLL1_LDR
|
||||||
|
#define CONF_FDPLL1_LDR 0x5b7
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Clock Divider <0x0-0x7FF>
|
||||||
|
// <i> This Clock divider is only for XOSC clock input to DPLL
|
||||||
|
// <id> fdpll1_clock_div
|
||||||
|
#ifndef CONF_FDPLL1_DIV
|
||||||
|
#define CONF_FDPLL1_DIV 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> DCO Filter Enable
|
||||||
|
// <i> Indicates whether DCO Filter Enable is enabled or not
|
||||||
|
// <id> fdpll1_arch_dcoen
|
||||||
|
#ifndef CONF_FDPLL1_DCOEN
|
||||||
|
#define CONF_FDPLL1_DCOEN 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Sigma-Delta DCO Filter Selection <0x0-0x7>
|
||||||
|
// <id> fdpll1_clock_dcofilter
|
||||||
|
#ifndef CONF_FDPLL1_DCOFILTER
|
||||||
|
#define CONF_FDPLL1_DCOFILTER 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Lock Bypass
|
||||||
|
// <i> Indicates whether Lock Bypass is enabled or not
|
||||||
|
// <id> fdpll1_arch_lbypass
|
||||||
|
#ifndef CONF_FDPLL1_LBYPASS
|
||||||
|
#define CONF_FDPLL1_LBYPASS 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Lock Time
|
||||||
|
// <0x0=>No time-out, automatic lock
|
||||||
|
// <0x4=>The Time-out if no lock within 800 us
|
||||||
|
// <0x5=>The Time-out if no lock within 900 us
|
||||||
|
// <0x6=>The Time-out if no lock within 1 ms
|
||||||
|
// <0x7=>The Time-out if no lock within 11 ms
|
||||||
|
// <id> fdpll1_arch_ltime
|
||||||
|
#ifndef CONF_FDPLL1_LTIME
|
||||||
|
#define CONF_FDPLL1_LTIME 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Reference Clock Selection
|
||||||
|
// <0x0=>GCLK clock reference
|
||||||
|
// <0x1=>XOSC32K clock reference
|
||||||
|
// <0x2=>XOSC0 clock reference
|
||||||
|
// <0x3=>XOSC1 clock reference
|
||||||
|
// <id> fdpll1_arch_refclk
|
||||||
|
#ifndef CONF_FDPLL1_REFCLK
|
||||||
|
#define CONF_FDPLL1_REFCLK 0x1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Wake Up Fast
|
||||||
|
// <i> Indicates whether Wake Up Fast is enabled or not
|
||||||
|
// <id> fdpll1_arch_wuf
|
||||||
|
#ifndef CONF_FDPLL1_WUF
|
||||||
|
#define CONF_FDPLL1_WUF 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Proportional Integral Filter Selection <0x0-0xF>
|
||||||
|
// <id> fdpll1_arch_filter
|
||||||
|
#ifndef CONF_FDPLL1_FILTER
|
||||||
|
#define CONF_FDPLL1_FILTER 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//</h>
|
||||||
|
//</e>
|
||||||
|
|
||||||
|
// <<< end of configuration section >>>
|
||||||
|
|
||||||
|
#endif // HPL_OSCCTRL_CONFIG_H
|
|
@ -0,0 +1,522 @@
|
||||||
|
/* Auto-generated config file hpl_port_config.h */
|
||||||
|
#ifndef HPL_PORT_CONFIG_H
|
||||||
|
#define HPL_PORT_CONFIG_H
|
||||||
|
|
||||||
|
// <<< Use Configuration Wizard in Context Menu >>>
|
||||||
|
|
||||||
|
// <e> PORT Input Event 0 configuration
|
||||||
|
// <id> enable_port_input_event_0
|
||||||
|
#ifndef CONF_PORT_EVCTRL_PORT_0
|
||||||
|
#define CONF_PORT_EVCTRL_PORT_0 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> PORT Input Event 0 configuration on PORT A
|
||||||
|
|
||||||
|
// <q> PORTA Input Event 0 Enable
|
||||||
|
// <i> The event action will be triggered on any incoming event if PORT A Input Event 0 configuration is enabled
|
||||||
|
// <id> porta_input_event_enable_0
|
||||||
|
#ifndef CONF_PORTA_EVCTRL_PORTEI_0
|
||||||
|
#define CONF_PORTA_EVCTRL_PORTEI_0 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTA Event 0 Pin Identifier <0x00-0x1F>
|
||||||
|
// <i> These bits define the I/O pin from port A on which the event action will be performed
|
||||||
|
// <id> porta_event_pin_identifier_0
|
||||||
|
#ifndef CONF_PORTA_EVCTRL_PID_0
|
||||||
|
#define CONF_PORTA_EVCTRL_PID_0 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTA Event 0 Action
|
||||||
|
// <0=> Output register of pin will be set to level of event
|
||||||
|
// <1=> Set output register of pin on event
|
||||||
|
// <2=> Clear output register of pin on event
|
||||||
|
// <3=> Toggle output register of pin on event
|
||||||
|
// <i> These bits define the event action the PORT A will perform on event input 0
|
||||||
|
// <id> porta_event_action_0
|
||||||
|
#ifndef CONF_PORTA_EVCTRL_EVACT_0
|
||||||
|
#define CONF_PORTA_EVCTRL_EVACT_0 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
// <h> PORT Input Event 0 configuration on PORT B
|
||||||
|
|
||||||
|
// <q> PORTB Input Event 0 Enable
|
||||||
|
// <i> The event action will be triggered on any incoming event if PORT B Input Event 0 configuration is enabled
|
||||||
|
// <id> portb_input_event_enable_0
|
||||||
|
#ifndef CONF_PORTB_EVCTRL_PORTEI_0
|
||||||
|
#define CONF_PORTB_EVCTRL_PORTEI_0 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTB Event 0 Pin Identifier <0x00-0x1F>
|
||||||
|
// <i> These bits define the I/O pin from port B on which the event action will be performed
|
||||||
|
// <id> portb_event_pin_identifier_0
|
||||||
|
#ifndef CONF_PORTB_EVCTRL_PID_0
|
||||||
|
#define CONF_PORTB_EVCTRL_PID_0 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTB Event 0 Action
|
||||||
|
// <0=> Output register of pin will be set to level of event
|
||||||
|
// <1=> Set output register of pin on event
|
||||||
|
// <2=> Clear output register of pin on event
|
||||||
|
// <3=> Toggle output register of pin on event
|
||||||
|
// <i> These bits define the event action the PORT B will perform on event input 0
|
||||||
|
// <id> portb_event_action_0
|
||||||
|
#ifndef CONF_PORTB_EVCTRL_EVACT_0
|
||||||
|
#define CONF_PORTB_EVCTRL_EVACT_0 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
// <h> PORT Input Event 0 configuration on PORT C
|
||||||
|
|
||||||
|
// <q> PORTC Input Event 0 Enable
|
||||||
|
// <i> The event action will be triggered on any incoming event if PORT C Input Event 0 configuration is enabled
|
||||||
|
// <id> portc_input_event_enable_0
|
||||||
|
#ifndef CONF_PORTC_EVCTRL_PORTEI_0
|
||||||
|
#define CONF_PORTC_EVCTRL_PORTEI_0 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTC Event 0 Pin Identifier <0x00-0x1F>
|
||||||
|
// <i> These bits define the I/O pin from port C on which the event action will be performed
|
||||||
|
// <id> portc_event_pin_identifier_0
|
||||||
|
#ifndef CONF_PORTC_EVCTRL_PID_0
|
||||||
|
#define CONF_PORTC_EVCTRL_PID_0 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTC Event 0 Action
|
||||||
|
// <0=> Output register of pin will be set to level of event
|
||||||
|
// <1=> Set output register of pin on event
|
||||||
|
// <2=> Clear output register of pin on event
|
||||||
|
// <3=> Toggle output register of pin on event
|
||||||
|
// <i> These bits define the event action the PORT C will perform on event input 0
|
||||||
|
// <id> portc_event_action_0
|
||||||
|
#ifndef CONF_PORTC_EVCTRL_EVACT_0
|
||||||
|
#define CONF_PORTC_EVCTRL_EVACT_0 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
// <h> PORT Input Event 0 configuration on PORT D
|
||||||
|
|
||||||
|
// <q> PORTD Input Event 0 Enable
|
||||||
|
// <i> The event action will be triggered on any incoming event if PORT D Input Event 0 configuration is enabled
|
||||||
|
// <id> portd_input_event_enable_0
|
||||||
|
#ifndef CONF_PORTD_EVCTRL_PORTEI_0
|
||||||
|
#define CONF_PORTD_EVCTRL_PORTEI_0 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTD Event 0 Pin Identifier <0x00-0x1F>
|
||||||
|
// <i> These bits define the I/O pin from port D on which the event action will be performed
|
||||||
|
// <id> portd_event_pin_identifier_0
|
||||||
|
#ifndef CONF_PORTD_EVCTRL_PID_0
|
||||||
|
#define CONF_PORTD_EVCTRL_PID_0 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTD Event 0 Action
|
||||||
|
// <0=> Output register of pin will be set to level of event
|
||||||
|
// <1=> Set output register of pin on event
|
||||||
|
// <2=> Clear output register of pin on event
|
||||||
|
// <3=> Toggle output register of pin on event
|
||||||
|
// <i> These bits define the event action the PORT D will perform on event input 0
|
||||||
|
// <id> portd_event_action_0
|
||||||
|
#ifndef CONF_PORTD_EVCTRL_EVACT_0
|
||||||
|
#define CONF_PORTD_EVCTRL_EVACT_0 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
// <e> PORT Input Event 1 configuration
|
||||||
|
// <id> enable_port_input_event_1
|
||||||
|
#ifndef CONF_PORT_EVCTRL_PORT_1
|
||||||
|
#define CONF_PORT_EVCTRL_PORT_1 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> PORT Input Event 1 configuration on PORT A
|
||||||
|
|
||||||
|
// <q> PORTA Input Event 1 Enable
|
||||||
|
// <i> The event action will be triggered on any incoming event if PORT A Input Event 1 configuration is enabled
|
||||||
|
// <id> porta_input_event_enable_1
|
||||||
|
#ifndef CONF_PORTA_EVCTRL_PORTEI_1
|
||||||
|
#define CONF_PORTA_EVCTRL_PORTEI_1 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTA Event 1 Pin Identifier <0x00-0x1F>
|
||||||
|
// <i> These bits define the I/O pin from port A on which the event action will be performed
|
||||||
|
// <id> porta_event_pin_identifier_1
|
||||||
|
#ifndef CONF_PORTA_EVCTRL_PID_1
|
||||||
|
#define CONF_PORTA_EVCTRL_PID_1 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTA Event 1 Action
|
||||||
|
// <0=> Output register of pin will be set to level of event
|
||||||
|
// <1=> Set output register of pin on event
|
||||||
|
// <2=> Clear output register of pin on event
|
||||||
|
// <3=> Toggle output register of pin on event
|
||||||
|
// <i> These bits define the event action the PORT A will perform on event input 1
|
||||||
|
// <id> porta_event_action_1
|
||||||
|
#ifndef CONF_PORTA_EVCTRL_EVACT_1
|
||||||
|
#define CONF_PORTA_EVCTRL_EVACT_1 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
// <h> PORT Input Event 1 configuration on PORT B
|
||||||
|
|
||||||
|
// <q> PORTB Input Event 1 Enable
|
||||||
|
// <i> The event action will be triggered on any incoming event if PORT B Input Event 1 configuration is enabled
|
||||||
|
// <id> portb_input_event_enable_1
|
||||||
|
#ifndef CONF_PORTB_EVCTRL_PORTEI_1
|
||||||
|
#define CONF_PORTB_EVCTRL_PORTEI_1 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTB Event 1 Pin Identifier <0x00-0x1F>
|
||||||
|
// <i> These bits define the I/O pin from port B on which the event action will be performed
|
||||||
|
// <id> portb_event_pin_identifier_1
|
||||||
|
#ifndef CONF_PORTB_EVCTRL_PID_1
|
||||||
|
#define CONF_PORTB_EVCTRL_PID_1 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTB Event 1 Action
|
||||||
|
// <0=> Output register of pin will be set to level of event
|
||||||
|
// <1=> Set output register of pin on event
|
||||||
|
// <2=> Clear output register of pin on event
|
||||||
|
// <3=> Toggle output register of pin on event
|
||||||
|
// <i> These bits define the event action the PORT B will perform on event input 1
|
||||||
|
// <id> portb_event_action_1
|
||||||
|
#ifndef CONF_PORTB_EVCTRL_EVACT_1
|
||||||
|
#define CONF_PORTB_EVCTRL_EVACT_1 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
// <h> PORT Input Event 1 configuration on PORT C
|
||||||
|
|
||||||
|
// <q> PORTC Input Event 1 Enable
|
||||||
|
// <i> The event action will be triggered on any incoming event if PORT C Input Event 1 configuration is enabled
|
||||||
|
// <id> portc_input_event_enable_1
|
||||||
|
#ifndef CONF_PORTC_EVCTRL_PORTEI_1
|
||||||
|
#define CONF_PORTC_EVCTRL_PORTEI_1 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTC Event 1 Pin Identifier <0x00-0x1F>
|
||||||
|
// <i> These bits define the I/O pin from port C on which the event action will be performed
|
||||||
|
// <id> portc_event_pin_identifier_1
|
||||||
|
#ifndef CONF_PORTC_EVCTRL_PID_1
|
||||||
|
#define CONF_PORTC_EVCTRL_PID_1 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTC Event 1 Action
|
||||||
|
// <0=> Output register of pin will be set to level of event
|
||||||
|
// <1=> Set output register of pin on event
|
||||||
|
// <2=> Clear output register of pin on event
|
||||||
|
// <3=> Toggle output register of pin on event
|
||||||
|
// <i> These bits define the event action the PORT C will perform on event input 1
|
||||||
|
// <id> portc_event_action_1
|
||||||
|
#ifndef CONF_PORTC_EVCTRL_EVACT_1
|
||||||
|
#define CONF_PORTC_EVCTRL_EVACT_1 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
// <h> PORT Input Event 1 configuration on PORT D
|
||||||
|
|
||||||
|
// <q> PORTD Input Event 1 Enable
|
||||||
|
// <i> The event action will be triggered on any incoming event if PORT D Input Event 1 configuration is enabled
|
||||||
|
// <id> portd_input_event_enable_1
|
||||||
|
#ifndef CONF_PORTD_EVCTRL_PORTEI_1
|
||||||
|
#define CONF_PORTD_EVCTRL_PORTEI_1 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTD Event 1 Pin Identifier <0x00-0x1F>
|
||||||
|
// <i> These bits define the I/O pin from port D on which the event action will be performed
|
||||||
|
// <id> portd_event_pin_identifier_1
|
||||||
|
#ifndef CONF_PORTD_EVCTRL_PID_1
|
||||||
|
#define CONF_PORTD_EVCTRL_PID_1 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTD Event 1 Action
|
||||||
|
// <0=> Output register of pin will be set to level of event
|
||||||
|
// <1=> Set output register of pin on event
|
||||||
|
// <2=> Clear output register of pin on event
|
||||||
|
// <3=> Toggle output register of pin on event
|
||||||
|
// <i> These bits define the event action the PORT D will perform on event input 1
|
||||||
|
// <id> portd_event_action_1
|
||||||
|
#ifndef CONF_PORTD_EVCTRL_EVACT_1
|
||||||
|
#define CONF_PORTD_EVCTRL_EVACT_1 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
// <e> PORT Input Event 2 configuration
|
||||||
|
// <id> enable_port_input_event_2
|
||||||
|
#ifndef CONF_PORT_EVCTRL_PORT_2
|
||||||
|
#define CONF_PORT_EVCTRL_PORT_2 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> PORT Input Event 2 configuration on PORT A
|
||||||
|
|
||||||
|
// <q> PORTA Input Event 2 Enable
|
||||||
|
// <i> The event action will be triggered on any incoming event if PORT A Input Event 2 configuration is enabled
|
||||||
|
// <id> porta_input_event_enable_2
|
||||||
|
#ifndef CONF_PORTA_EVCTRL_PORTEI_2
|
||||||
|
#define CONF_PORTA_EVCTRL_PORTEI_2 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTA Event 2 Pin Identifier <0x00-0x1F>
|
||||||
|
// <i> These bits define the I/O pin from port A on which the event action will be performed
|
||||||
|
// <id> porta_event_pin_identifier_2
|
||||||
|
#ifndef CONF_PORTA_EVCTRL_PID_2
|
||||||
|
#define CONF_PORTA_EVCTRL_PID_2 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTA Event 2 Action
|
||||||
|
// <0=> Output register of pin will be set to level of event
|
||||||
|
// <1=> Set output register of pin on event
|
||||||
|
// <2=> Clear output register of pin on event
|
||||||
|
// <3=> Toggle output register of pin on event
|
||||||
|
// <i> These bits define the event action the PORT A will perform on event input 2
|
||||||
|
// <id> porta_event_action_2
|
||||||
|
#ifndef CONF_PORTA_EVCTRL_EVACT_2
|
||||||
|
#define CONF_PORTA_EVCTRL_EVACT_2 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
// <h> PORT Input Event 2 configuration on PORT B
|
||||||
|
|
||||||
|
// <q> PORTB Input Event 2 Enable
|
||||||
|
// <i> The event action will be triggered on any incoming event if PORT B Input Event 2 configuration is enabled
|
||||||
|
// <id> portb_input_event_enable_2
|
||||||
|
#ifndef CONF_PORTB_EVCTRL_PORTEI_2
|
||||||
|
#define CONF_PORTB_EVCTRL_PORTEI_2 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTB Event 2 Pin Identifier <0x00-0x1F>
|
||||||
|
// <i> These bits define the I/O pin from port B on which the event action will be performed
|
||||||
|
// <id> portb_event_pin_identifier_2
|
||||||
|
#ifndef CONF_PORTB_EVCTRL_PID_2
|
||||||
|
#define CONF_PORTB_EVCTRL_PID_2 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTB Event 2 Action
|
||||||
|
// <0=> Output register of pin will be set to level of event
|
||||||
|
// <1=> Set output register of pin on event
|
||||||
|
// <2=> Clear output register of pin on event
|
||||||
|
// <3=> Toggle output register of pin on event
|
||||||
|
// <i> These bits define the event action the PORT B will perform on event input 2
|
||||||
|
// <id> portb_event_action_2
|
||||||
|
#ifndef CONF_PORTB_EVCTRL_EVACT_2
|
||||||
|
#define CONF_PORTB_EVCTRL_EVACT_2 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
// <h> PORT Input Event 2 configuration on PORT C
|
||||||
|
|
||||||
|
// <q> PORTC Input Event 2 Enable
|
||||||
|
// <i> The event action will be triggered on any incoming event if PORT C Input Event 2 configuration is enabled
|
||||||
|
// <id> portc_input_event_enable_2
|
||||||
|
#ifndef CONF_PORTC_EVCTRL_PORTEI_2
|
||||||
|
#define CONF_PORTC_EVCTRL_PORTEI_2 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTC Event 2 Pin Identifier <0x00-0x1F>
|
||||||
|
// <i> These bits define the I/O pin from port C on which the event action will be performed
|
||||||
|
// <id> portc_event_pin_identifier_2
|
||||||
|
#ifndef CONF_PORTC_EVCTRL_PID_2
|
||||||
|
#define CONF_PORTC_EVCTRL_PID_2 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTC Event 2 Action
|
||||||
|
// <0=> Output register of pin will be set to level of event
|
||||||
|
// <1=> Set output register of pin on event
|
||||||
|
// <2=> Clear output register of pin on event
|
||||||
|
// <3=> Toggle output register of pin on event
|
||||||
|
// <i> These bits define the event action the PORT C will perform on event input 2
|
||||||
|
// <id> portc_event_action_2
|
||||||
|
#ifndef CONF_PORTC_EVCTRL_EVACT_2
|
||||||
|
#define CONF_PORTC_EVCTRL_EVACT_2 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
// <h> PORT Input Event 2 configuration on PORT D
|
||||||
|
|
||||||
|
// <q> PORTD Input Event 2 Enable
|
||||||
|
// <i> The event action will be triggered on any incoming event if PORT D Input Event 2 configuration is enabled
|
||||||
|
// <id> portd_input_event_enable_2
|
||||||
|
#ifndef CONF_PORTD_EVCTRL_PORTEI_2
|
||||||
|
#define CONF_PORTD_EVCTRL_PORTEI_2 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTD Event 2 Pin Identifier <0x00-0x1F>
|
||||||
|
// <i> These bits define the I/O pin from port D on which the event action will be performed
|
||||||
|
// <id> portd_event_pin_identifier_2
|
||||||
|
#ifndef CONF_PORTD_EVCTRL_PID_2
|
||||||
|
#define CONF_PORTD_EVCTRL_PID_2 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTD Event 2 Action
|
||||||
|
// <0=> Output register of pin will be set to level of event
|
||||||
|
// <1=> Set output register of pin on event
|
||||||
|
// <2=> Clear output register of pin on event
|
||||||
|
// <3=> Toggle output register of pin on event
|
||||||
|
// <i> These bits define the event action the PORT D will perform on event input 2
|
||||||
|
// <id> portd_event_action_2
|
||||||
|
#ifndef CONF_PORTD_EVCTRL_EVACT_2
|
||||||
|
#define CONF_PORTD_EVCTRL_EVACT_2 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
// <e> PORT Input Event 3 configuration
|
||||||
|
// <id> enable_port_input_event_3
|
||||||
|
#ifndef CONF_PORT_EVCTRL_PORT_3
|
||||||
|
#define CONF_PORT_EVCTRL_PORT_3 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> PORT Input Event 3 configuration on PORT A
|
||||||
|
|
||||||
|
// <q> PORTA Input Event 3 Enable
|
||||||
|
// <i> The event action will be triggered on any incoming event if PORT A Input Event 3 configuration is enabled
|
||||||
|
// <id> porta_input_event_enable_3
|
||||||
|
#ifndef CONF_PORTA_EVCTRL_PORTEI_3
|
||||||
|
#define CONF_PORTA_EVCTRL_PORTEI_3 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTA Event 3 Pin Identifier <0x00-0x1F>
|
||||||
|
// <i> These bits define the I/O pin from port A on which the event action will be performed
|
||||||
|
// <id> porta_event_pin_identifier_3
|
||||||
|
#ifndef CONF_PORTA_EVCTRL_PID_3
|
||||||
|
#define CONF_PORTA_EVCTRL_PID_3 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTA Event 3 Action
|
||||||
|
// <0=> Output register of pin will be set to level of event
|
||||||
|
// <1=> Set output register of pin on event
|
||||||
|
// <2=> Clear output register of pin on event
|
||||||
|
// <3=> Toggle output register of pin on event
|
||||||
|
// <i> These bits define the event action the PORT A will perform on event input 3
|
||||||
|
// <id> porta_event_action_3
|
||||||
|
#ifndef CONF_PORTA_EVCTRL_EVACT_3
|
||||||
|
#define CONF_PORTA_EVCTRL_EVACT_3 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
// <h> PORT Input Event 3 configuration on PORT B
|
||||||
|
|
||||||
|
// <q> PORTB Input Event 3 Enable
|
||||||
|
// <i> The event action will be triggered on any incoming event if PORT B Input Event 3 configuration is enabled
|
||||||
|
// <id> portb_input_event_enable_3
|
||||||
|
#ifndef CONF_PORTB_EVCTRL_PORTEI_3
|
||||||
|
#define CONF_PORTB_EVCTRL_PORTEI_3 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTB Event 3 Pin Identifier <0x00-0x1F>
|
||||||
|
// <i> These bits define the I/O pin from port B on which the event action will be performed
|
||||||
|
// <id> portb_event_pin_identifier_3
|
||||||
|
#ifndef CONF_PORTB_EVCTRL_PID_3
|
||||||
|
#define CONF_PORTB_EVCTRL_PID_3 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTB Event 3 Action
|
||||||
|
// <0=> Output register of pin will be set to level of event
|
||||||
|
// <1=> Set output register of pin on event
|
||||||
|
// <2=> Clear output register of pin on event
|
||||||
|
// <3=> Toggle output register of pin on event
|
||||||
|
// <i> These bits define the event action the PORT B will perform on event input 3
|
||||||
|
// <id> portb_event_action_3
|
||||||
|
#ifndef CONF_PORTB_EVCTRL_EVACT_3
|
||||||
|
#define CONF_PORTB_EVCTRL_EVACT_3 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
// <h> PORT Input Event 3 configuration on PORT C
|
||||||
|
|
||||||
|
// <q> PORTC Input Event 3 Enable
|
||||||
|
// <i> The event action will be triggered on any incoming event if PORT C Input Event 3 configuration is enabled
|
||||||
|
// <id> portc_input_event_enable_3
|
||||||
|
#ifndef CONF_PORTC_EVCTRL_PORTEI_3
|
||||||
|
#define CONF_PORTC_EVCTRL_PORTEI_3 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTC Event 3 Pin Identifier <0x00-0x1F>
|
||||||
|
// <i> These bits define the I/O pin from port C on which the event action will be performed
|
||||||
|
// <id> portc_event_pin_identifier_3
|
||||||
|
#ifndef CONF_PORTC_EVCTRL_PID_3
|
||||||
|
#define CONF_PORTC_EVCTRL_PID_3 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTC Event 3 Action
|
||||||
|
// <0=> Output register of pin will be set to level of event
|
||||||
|
// <1=> Set output register of pin on event
|
||||||
|
// <2=> Clear output register of pin on event
|
||||||
|
// <3=> Toggle output register of pin on event
|
||||||
|
// <i> These bits define the event action the PORT C will perform on event input 3
|
||||||
|
// <id> portc_event_action_3
|
||||||
|
#ifndef CONF_PORTC_EVCTRL_EVACT_3
|
||||||
|
#define CONF_PORTC_EVCTRL_EVACT_3 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
// <h> PORT Input Event 3 configuration on PORT D
|
||||||
|
|
||||||
|
// <q> PORTD Input Event 3 Enable
|
||||||
|
// <i> The event action will be triggered on any incoming event if PORT D Input Event 3 configuration is enabled
|
||||||
|
// <id> portd_input_event_enable_3
|
||||||
|
#ifndef CONF_PORTD_EVCTRL_PORTEI_3
|
||||||
|
#define CONF_PORTD_EVCTRL_PORTEI_3 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTD Event 3 Pin Identifier <0x00-0x1F>
|
||||||
|
// <i> These bits define the I/O pin from port D on which the event action will be performed
|
||||||
|
// <id> portd_event_pin_identifier_3
|
||||||
|
#ifndef CONF_PORTD_EVCTRL_PID_3
|
||||||
|
#define CONF_PORTD_EVCTRL_PID_3 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> PORTD Event 3 Action
|
||||||
|
// <0=> Output register of pin will be set to level of event
|
||||||
|
// <1=> Set output register of pin on event
|
||||||
|
// <2=> Clear output register of pin on event
|
||||||
|
// <3=> Toggle output register of pin on event
|
||||||
|
// <i> These bits define the event action the PORT D will perform on event input 3
|
||||||
|
// <id> portd_event_action_3
|
||||||
|
#ifndef CONF_PORTD_EVCTRL_EVACT_3
|
||||||
|
#define CONF_PORTD_EVCTRL_EVACT_3 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
#define CONF_PORTA_EVCTRL \
|
||||||
|
(0 | PORT_EVCTRL_EVACT0(CONF_PORTA_EVCTRL_EVACT_0) | CONF_PORTA_EVCTRL_PORTEI_0 << PORT_EVCTRL_PORTEI0_Pos \
|
||||||
|
| PORT_EVCTRL_PID0(CONF_PORTA_EVCTRL_PID_0) | PORT_EVCTRL_EVACT1(CONF_PORTA_EVCTRL_EVACT_1) \
|
||||||
|
| CONF_PORTA_EVCTRL_PORTEI_1 << PORT_EVCTRL_PORTEI1_Pos | PORT_EVCTRL_PID1(CONF_PORTA_EVCTRL_PID_1) \
|
||||||
|
| PORT_EVCTRL_EVACT2(CONF_PORTA_EVCTRL_EVACT_2) | CONF_PORTA_EVCTRL_PORTEI_2 << PORT_EVCTRL_PORTEI2_Pos \
|
||||||
|
| PORT_EVCTRL_PID2(CONF_PORTA_EVCTRL_PID_2) | PORT_EVCTRL_EVACT3(CONF_PORTA_EVCTRL_EVACT_3) \
|
||||||
|
| CONF_PORTA_EVCTRL_PORTEI_3 << PORT_EVCTRL_PORTEI3_Pos | PORT_EVCTRL_PID3(CONF_PORTA_EVCTRL_PID_3))
|
||||||
|
#define CONF_PORTB_EVCTRL \
|
||||||
|
(0 | PORT_EVCTRL_EVACT0(CONF_PORTB_EVCTRL_EVACT_0) | CONF_PORTB_EVCTRL_PORTEI_0 << PORT_EVCTRL_PORTEI0_Pos \
|
||||||
|
| PORT_EVCTRL_PID0(CONF_PORTB_EVCTRL_PID_0) | PORT_EVCTRL_EVACT1(CONF_PORTB_EVCTRL_EVACT_1) \
|
||||||
|
| CONF_PORTB_EVCTRL_PORTEI_1 << PORT_EVCTRL_PORTEI1_Pos | PORT_EVCTRL_PID1(CONF_PORTB_EVCTRL_PID_1) \
|
||||||
|
| PORT_EVCTRL_EVACT2(CONF_PORTB_EVCTRL_EVACT_2) | CONF_PORTB_EVCTRL_PORTEI_2 << PORT_EVCTRL_PORTEI2_Pos \
|
||||||
|
| PORT_EVCTRL_PID2(CONF_PORTB_EVCTRL_PID_2) | PORT_EVCTRL_EVACT3(CONF_PORTB_EVCTRL_EVACT_3) \
|
||||||
|
| CONF_PORTB_EVCTRL_PORTEI_3 << PORT_EVCTRL_PORTEI3_Pos | PORT_EVCTRL_PID3(CONF_PORTB_EVCTRL_PID_3))
|
||||||
|
#define CONF_PORTC_EVCTRL \
|
||||||
|
(0 | PORT_EVCTRL_EVACT0(CONF_PORTC_EVCTRL_EVACT_0) | CONF_PORTC_EVCTRL_PORTEI_0 << PORT_EVCTRL_PORTEI0_Pos \
|
||||||
|
| PORT_EVCTRL_PID0(CONF_PORTC_EVCTRL_PID_0) | PORT_EVCTRL_EVACT1(CONF_PORTC_EVCTRL_EVACT_1) \
|
||||||
|
| CONF_PORTC_EVCTRL_PORTEI_1 << PORT_EVCTRL_PORTEI1_Pos | PORT_EVCTRL_PID1(CONF_PORTC_EVCTRL_PID_1) \
|
||||||
|
| PORT_EVCTRL_EVACT2(CONF_PORTC_EVCTRL_EVACT_2) | CONF_PORTC_EVCTRL_PORTEI_2 << PORT_EVCTRL_PORTEI2_Pos \
|
||||||
|
| PORT_EVCTRL_PID2(CONF_PORTC_EVCTRL_PID_2) | PORT_EVCTRL_EVACT3(CONF_PORTC_EVCTRL_EVACT_3) \
|
||||||
|
| CONF_PORTC_EVCTRL_PORTEI_3 << PORT_EVCTRL_PORTEI3_Pos | PORT_EVCTRL_PID3(CONF_PORTC_EVCTRL_PID_3))
|
||||||
|
#define CONF_PORTD_EVCTRL \
|
||||||
|
(0 | PORT_EVCTRL_EVACT0(CONF_PORTD_EVCTRL_EVACT_0) | CONF_PORTD_EVCTRL_PORTEI_0 << PORT_EVCTRL_PORTEI0_Pos \
|
||||||
|
| PORT_EVCTRL_PID0(CONF_PORTD_EVCTRL_PID_0) | PORT_EVCTRL_EVACT1(CONF_PORTD_EVCTRL_EVACT_1) \
|
||||||
|
| CONF_PORTD_EVCTRL_PORTEI_1 << PORT_EVCTRL_PORTEI1_Pos | PORT_EVCTRL_PID1(CONF_PORTD_EVCTRL_PID_1) \
|
||||||
|
| PORT_EVCTRL_EVACT2(CONF_PORTD_EVCTRL_EVACT_2) | CONF_PORTD_EVCTRL_PORTEI_2 << PORT_EVCTRL_PORTEI2_Pos \
|
||||||
|
| PORT_EVCTRL_PID2(CONF_PORTD_EVCTRL_PID_2) | PORT_EVCTRL_EVACT3(CONF_PORTD_EVCTRL_EVACT_3) \
|
||||||
|
| CONF_PORTD_EVCTRL_PORTEI_3 << PORT_EVCTRL_PORTEI3_Pos | PORT_EVCTRL_PID3(CONF_PORTD_EVCTRL_PID_3))
|
||||||
|
|
||||||
|
// <<< end of configuration section >>>
|
||||||
|
|
||||||
|
#endif // HPL_PORT_CONFIG_H
|
|
@ -0,0 +1,437 @@
|
||||||
|
/* Auto-generated config file hpl_sercom_config.h */
|
||||||
|
#ifndef HPL_SERCOM_CONFIG_H
|
||||||
|
#define HPL_SERCOM_CONFIG_H
|
||||||
|
|
||||||
|
// <<< Use Configuration Wizard in Context Menu >>>
|
||||||
|
|
||||||
|
#include <peripheral_clk_config.h>
|
||||||
|
|
||||||
|
#ifndef CONF_SERCOM_2_USART_ENABLE
|
||||||
|
#define CONF_SERCOM_2_USART_ENABLE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> Basic Configuration
|
||||||
|
|
||||||
|
// <q> Receive buffer enable
|
||||||
|
// <i> Enable input buffer in SERCOM module
|
||||||
|
// <id> usart_rx_enable
|
||||||
|
#ifndef CONF_SERCOM_2_USART_RXEN
|
||||||
|
#define CONF_SERCOM_2_USART_RXEN 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Transmitt buffer enable
|
||||||
|
// <i> Enable output buffer in SERCOM module
|
||||||
|
// <id> usart_tx_enable
|
||||||
|
#ifndef CONF_SERCOM_2_USART_TXEN
|
||||||
|
#define CONF_SERCOM_2_USART_TXEN 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Frame parity
|
||||||
|
// <0x0=>No parity
|
||||||
|
// <0x1=>Even parity
|
||||||
|
// <0x2=>Odd parity
|
||||||
|
// <i> Parity bit mode for USART frame
|
||||||
|
// <id> usart_parity
|
||||||
|
#ifndef CONF_SERCOM_2_USART_PARITY
|
||||||
|
#define CONF_SERCOM_2_USART_PARITY 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Character Size
|
||||||
|
// <0x0=>8 bits
|
||||||
|
// <0x1=>9 bits
|
||||||
|
// <0x5=>5 bits
|
||||||
|
// <0x6=>6 bits
|
||||||
|
// <0x7=>7 bits
|
||||||
|
// <i> Data character size in USART frame
|
||||||
|
// <id> usart_character_size
|
||||||
|
#ifndef CONF_SERCOM_2_USART_CHSIZE
|
||||||
|
#define CONF_SERCOM_2_USART_CHSIZE 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Stop Bit
|
||||||
|
// <0=>One stop bit
|
||||||
|
// <1=>Two stop bits
|
||||||
|
// <i> Number of stop bits in USART frame
|
||||||
|
// <id> usart_stop_bit
|
||||||
|
#ifndef CONF_SERCOM_2_USART_SBMODE
|
||||||
|
#define CONF_SERCOM_2_USART_SBMODE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Baud rate <1-6250000>
|
||||||
|
// <i> USART baud rate setting
|
||||||
|
// <id> usart_baud_rate
|
||||||
|
#ifndef CONF_SERCOM_2_USART_BAUD
|
||||||
|
#define CONF_SERCOM_2_USART_BAUD 9600
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
// <e> Advanced configuration
|
||||||
|
// <id> usart_advanced
|
||||||
|
#ifndef CONF_SERCOM_2_USART_ADVANCED_CONFIG
|
||||||
|
#define CONF_SERCOM_2_USART_ADVANCED_CONFIG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Run in stand-by
|
||||||
|
// <i> Keep the module running in standby sleep mode
|
||||||
|
// <id> usart_arch_runstdby
|
||||||
|
#ifndef CONF_SERCOM_2_USART_RUNSTDBY
|
||||||
|
#define CONF_SERCOM_2_USART_RUNSTDBY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Immediate Buffer Overflow Notification
|
||||||
|
// <i> Controls when the BUFOVF status bit is asserted
|
||||||
|
// <id> usart_arch_ibon
|
||||||
|
#ifndef CONF_SERCOM_2_USART_IBON
|
||||||
|
#define CONF_SERCOM_2_USART_IBON 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Start of Frame Detection Enable
|
||||||
|
// <i> Will wake the device from any sleep mode if usart_init and usart_enable was run priort to going to sleep. (receive buffer must be enabled)
|
||||||
|
// <id> usart_arch_sfde
|
||||||
|
#ifndef CONF_SERCOM_2_USART_SFDE
|
||||||
|
#define CONF_SERCOM_2_USART_SFDE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Collision Detection Enable
|
||||||
|
// <i> Collision detection enable
|
||||||
|
// <id> usart_arch_cloden
|
||||||
|
#ifndef CONF_SERCOM_2_USART_CLODEN
|
||||||
|
#define CONF_SERCOM_2_USART_CLODEN 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Operating Mode
|
||||||
|
// <0x0=>USART with external clock
|
||||||
|
// <0x1=>USART with internal clock
|
||||||
|
// <i> Drive the shift register by an internal clock generated by the baud rate generator or an external clock supplied on the XCK pin.
|
||||||
|
// <id> usart_arch_clock_mode
|
||||||
|
#ifndef CONF_SERCOM_2_USART_MODE
|
||||||
|
#define CONF_SERCOM_2_USART_MODE 0x1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Sample Rate
|
||||||
|
// <0x0=>16x arithmetic
|
||||||
|
// <0x1=>16x fractional
|
||||||
|
// <0x2=>8x arithmetic
|
||||||
|
// <0x3=>8x fractional
|
||||||
|
// <0x4=>3x arithmetic
|
||||||
|
// <i> How many over-sampling bits used when sampling data state
|
||||||
|
// <id> usart_arch_sampr
|
||||||
|
#ifndef CONF_SERCOM_2_USART_SAMPR
|
||||||
|
#define CONF_SERCOM_2_USART_SAMPR 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Sample Adjustment
|
||||||
|
// <0x0=>7-8-9 (3-4-5 8-bit over-sampling)
|
||||||
|
// <0x1=>9-10-11 (4-5-6 8-bit over-sampling)
|
||||||
|
// <0x2=>11-12-13 (5-6-7 8-bit over-sampling)
|
||||||
|
// <0x3=>13-14-15 (6-7-8 8-bit over-sampling)
|
||||||
|
// <i> Adjust which samples to use for data sampling in asynchronous mode
|
||||||
|
// <id> usart_arch_sampa
|
||||||
|
#ifndef CONF_SERCOM_2_USART_SAMPA
|
||||||
|
#define CONF_SERCOM_2_USART_SAMPA 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Fractional Part <0-7>
|
||||||
|
// <i> Fractional part of the baud rate if baud rate generator is in fractional mode
|
||||||
|
// <id> usart_arch_fractional
|
||||||
|
#ifndef CONF_SERCOM_2_USART_FRACTIONAL
|
||||||
|
#define CONF_SERCOM_2_USART_FRACTIONAL 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Data Order
|
||||||
|
// <0=>MSB is transmitted first
|
||||||
|
// <1=>LSB is transmitted first
|
||||||
|
// <i> Data order of the data bits in the frame
|
||||||
|
// <id> usart_arch_dord
|
||||||
|
#ifndef CONF_SERCOM_2_USART_DORD
|
||||||
|
#define CONF_SERCOM_2_USART_DORD 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Does not do anything in UART mode
|
||||||
|
#define CONF_SERCOM_2_USART_CPOL 0
|
||||||
|
|
||||||
|
// <o> Encoding Format
|
||||||
|
// <0=>No encoding
|
||||||
|
// <1=>IrDA encoded
|
||||||
|
// <id> usart_arch_enc
|
||||||
|
#ifndef CONF_SERCOM_2_USART_ENC
|
||||||
|
#define CONF_SERCOM_2_USART_ENC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> LIN Slave Enable
|
||||||
|
// <i> Break Character Detection and Auto-Baud/LIN Slave Enable.
|
||||||
|
// <i> Additional setting needed: 16x sample rate using fractional baud rate generation (CTRLA.SAMPR = 1).
|
||||||
|
// <0=>Disable
|
||||||
|
// <1=>Enable
|
||||||
|
// <id> usart_arch_lin_slave_enable
|
||||||
|
#ifndef CONF_SERCOM_2_USART_LIN_SLAVE_ENABLE
|
||||||
|
#define CONF_SERCOM_2_USART_LIN_SLAVE_ENABLE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Debug Stop Mode
|
||||||
|
// <i> Behavior of the baud-rate generator when CPU is halted by external debugger.
|
||||||
|
// <0=>Keep running
|
||||||
|
// <1=>Halt
|
||||||
|
// <id> usart_arch_dbgstop
|
||||||
|
#ifndef CONF_SERCOM_2_USART_DEBUG_STOP_MODE
|
||||||
|
#define CONF_SERCOM_2_USART_DEBUG_STOP_MODE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
#ifndef CONF_SERCOM_2_USART_INACK
|
||||||
|
#define CONF_SERCOM_2_USART_INACK 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONF_SERCOM_2_USART_DSNACK
|
||||||
|
#define CONF_SERCOM_2_USART_DSNACK 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONF_SERCOM_2_USART_MAXITER
|
||||||
|
#define CONF_SERCOM_2_USART_MAXITER 0x7
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONF_SERCOM_2_USART_GTIME
|
||||||
|
#define CONF_SERCOM_2_USART_GTIME 0x2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define CONF_SERCOM_2_USART_RXINV 0x0
|
||||||
|
#define CONF_SERCOM_2_USART_TXINV 0x0
|
||||||
|
|
||||||
|
#ifndef CONF_SERCOM_2_USART_CMODE
|
||||||
|
#define CONF_SERCOM_2_USART_CMODE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONF_SERCOM_2_USART_RXPO
|
||||||
|
#define CONF_SERCOM_2_USART_RXPO 1 /* RX is on PIN_PB24 */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONF_SERCOM_2_USART_TXPO
|
||||||
|
#define CONF_SERCOM_2_USART_TXPO 0 /* TX is on PIN_PB25 */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Set correct parity settings in register interface based on PARITY setting */
|
||||||
|
#if CONF_SERCOM_2_USART_LIN_SLAVE_ENABLE == 1
|
||||||
|
#if CONF_SERCOM_2_USART_PARITY == 0
|
||||||
|
#define CONF_SERCOM_2_USART_PMODE 0
|
||||||
|
#define CONF_SERCOM_2_USART_FORM 4
|
||||||
|
#else
|
||||||
|
#define CONF_SERCOM_2_USART_PMODE CONF_SERCOM_2_USART_PARITY - 1
|
||||||
|
#define CONF_SERCOM_2_USART_FORM 5
|
||||||
|
#endif
|
||||||
|
#else /* #if CONF_SERCOM_2_USART_LIN_SLAVE_ENABLE == 0 */
|
||||||
|
#if CONF_SERCOM_2_USART_PARITY == 0
|
||||||
|
#define CONF_SERCOM_2_USART_PMODE 0
|
||||||
|
#define CONF_SERCOM_2_USART_FORM 0
|
||||||
|
#else
|
||||||
|
#define CONF_SERCOM_2_USART_PMODE CONF_SERCOM_2_USART_PARITY - 1
|
||||||
|
#define CONF_SERCOM_2_USART_FORM 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Calculate BAUD register value in UART mode
|
||||||
|
#if CONF_SERCOM_2_USART_SAMPR == 0
|
||||||
|
#ifndef CONF_SERCOM_2_USART_BAUD_RATE
|
||||||
|
#define CONF_SERCOM_2_USART_BAUD_RATE \
|
||||||
|
65536 - ((65536 * 16.0f * CONF_SERCOM_2_USART_BAUD) / CONF_GCLK_SERCOM2_CORE_FREQUENCY)
|
||||||
|
#endif
|
||||||
|
#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH
|
||||||
|
#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0
|
||||||
|
#endif
|
||||||
|
#elif CONF_SERCOM_2_USART_SAMPR == 1
|
||||||
|
#ifndef CONF_SERCOM_2_USART_BAUD_RATE
|
||||||
|
#define CONF_SERCOM_2_USART_BAUD_RATE \
|
||||||
|
((CONF_GCLK_SERCOM2_CORE_FREQUENCY) / (CONF_SERCOM_2_USART_BAUD * 16)) - (CONF_SERCOM_2_USART_FRACTIONAL / 8)
|
||||||
|
#endif
|
||||||
|
#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH
|
||||||
|
#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0
|
||||||
|
#endif
|
||||||
|
#elif CONF_SERCOM_2_USART_SAMPR == 2
|
||||||
|
#ifndef CONF_SERCOM_2_USART_BAUD_RATE
|
||||||
|
#define CONF_SERCOM_2_USART_BAUD_RATE \
|
||||||
|
65536 - ((65536 * 8.0f * CONF_SERCOM_2_USART_BAUD) / CONF_GCLK_SERCOM2_CORE_FREQUENCY)
|
||||||
|
#endif
|
||||||
|
#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH
|
||||||
|
#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0
|
||||||
|
#endif
|
||||||
|
#elif CONF_SERCOM_2_USART_SAMPR == 3
|
||||||
|
#ifndef CONF_SERCOM_2_USART_BAUD_RATE
|
||||||
|
#define CONF_SERCOM_2_USART_BAUD_RATE \
|
||||||
|
((CONF_GCLK_SERCOM2_CORE_FREQUENCY) / (CONF_SERCOM_2_USART_BAUD * 8)) - (CONF_SERCOM_2_USART_FRACTIONAL / 8)
|
||||||
|
#endif
|
||||||
|
#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH
|
||||||
|
#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0
|
||||||
|
#endif
|
||||||
|
#elif CONF_SERCOM_2_USART_SAMPR == 4
|
||||||
|
#ifndef CONF_SERCOM_2_USART_BAUD_RATE
|
||||||
|
#define CONF_SERCOM_2_USART_BAUD_RATE \
|
||||||
|
65536 - ((65536 * 3.0f * CONF_SERCOM_2_USART_BAUD) / CONF_GCLK_SERCOM2_CORE_FREQUENCY)
|
||||||
|
#endif
|
||||||
|
#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH
|
||||||
|
#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <peripheral_clk_config.h>
|
||||||
|
|
||||||
|
// Enable configuration of module
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_ENABLE
|
||||||
|
#define CONF_SERCOM_4_SPI_ENABLE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Set module in SPI Master mode
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_MODE
|
||||||
|
#define CONF_SERCOM_4_SPI_MODE 0x03
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <h> Basic Configuration
|
||||||
|
|
||||||
|
// <q> Receive buffer enable
|
||||||
|
// <i> Enable receive buffer to receive data from slave (RXEN)
|
||||||
|
// <id> spi_master_rx_enable
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_RXEN
|
||||||
|
#define CONF_SERCOM_4_SPI_RXEN 0x1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Character Size
|
||||||
|
// <i> Bit size for all characters sent over the SPI bus (CHSIZE)
|
||||||
|
// <0x0=>8 bits
|
||||||
|
// <0x1=>9 bits
|
||||||
|
// <id> spi_master_character_size
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_CHSIZE
|
||||||
|
#define CONF_SERCOM_4_SPI_CHSIZE 0x0
|
||||||
|
#endif
|
||||||
|
// <o> Baud rate <1-18000000>
|
||||||
|
// <i> The SPI data transfer rate
|
||||||
|
// <id> spi_master_baud_rate
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_BAUD
|
||||||
|
#define CONF_SERCOM_4_SPI_BAUD 1000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </h>
|
||||||
|
|
||||||
|
// <e> Advanced Configuration
|
||||||
|
// <id> spi_master_advanced
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_ADVANCED
|
||||||
|
#define CONF_SERCOM_4_SPI_ADVANCED 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Dummy byte <0x00-0x1ff>
|
||||||
|
// <id> spi_master_dummybyte
|
||||||
|
// <i> Dummy byte used when reading data from the slave without sending any data
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_DUMMYBYTE
|
||||||
|
#define CONF_SERCOM_4_SPI_DUMMYBYTE 0x1ff
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Data Order
|
||||||
|
// <0=>MSB first
|
||||||
|
// <1=>LSB first
|
||||||
|
// <i> I least significant or most significant bit is shifted out first (DORD)
|
||||||
|
// <id> spi_master_arch_dord
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_DORD
|
||||||
|
#define CONF_SERCOM_4_SPI_DORD 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Clock Polarity
|
||||||
|
// <0=>SCK is low when idle
|
||||||
|
// <1=>SCK is high when idle
|
||||||
|
// <i> Determines if the leading edge is rising or falling with a corresponding opposite edge at the trailing edge. (CPOL)
|
||||||
|
// <id> spi_master_arch_cpol
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_CPOL
|
||||||
|
#define CONF_SERCOM_4_SPI_CPOL 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Clock Phase
|
||||||
|
// <0x0=>Sample input on leading edge
|
||||||
|
// <0x1=>Sample input on trailing edge
|
||||||
|
// <i> Determines if input data is sampled on leading or trailing SCK edge. (CPHA)
|
||||||
|
// <id> spi_master_arch_cpha
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_CPHA
|
||||||
|
#define CONF_SERCOM_4_SPI_CPHA 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Immediate Buffer Overflow Notification
|
||||||
|
// <i> Controls when OVF is asserted (IBON)
|
||||||
|
// <0x0=>In data stream
|
||||||
|
// <0x1=>On buffer overflow
|
||||||
|
// <id> spi_master_arch_ibon
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_IBON
|
||||||
|
#define CONF_SERCOM_4_SPI_IBON 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <q> Run in stand-by
|
||||||
|
// <i> Module stays active in stand-by sleep mode. (RUNSTDBY)
|
||||||
|
// <id> spi_master_arch_runstdby
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_RUNSTDBY
|
||||||
|
#define CONF_SERCOM_4_SPI_RUNSTDBY 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Debug Stop Mode
|
||||||
|
// <i> Behavior of the baud-rate generator when CPU is halted by external debugger. (DBGSTOP)
|
||||||
|
// <0=>Keep running
|
||||||
|
// <1=>Halt
|
||||||
|
// <id> spi_master_arch_dbgstop
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_DBGSTOP
|
||||||
|
#define CONF_SERCOM_4_SPI_DBGSTOP 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// </e>
|
||||||
|
|
||||||
|
// Address mode disabled in master mode
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_AMODE_EN
|
||||||
|
#define CONF_SERCOM_4_SPI_AMODE_EN 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_AMODE
|
||||||
|
#define CONF_SERCOM_4_SPI_AMODE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_ADDR
|
||||||
|
#define CONF_SERCOM_4_SPI_ADDR 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_ADDRMASK
|
||||||
|
#define CONF_SERCOM_4_SPI_ADDRMASK 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_SSDE
|
||||||
|
#define CONF_SERCOM_4_SPI_SSDE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_MSSEN
|
||||||
|
#define CONF_SERCOM_4_SPI_MSSEN 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_PLOADEN
|
||||||
|
#define CONF_SERCOM_4_SPI_PLOADEN 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Receive Data Pinout
|
||||||
|
// <0x0=>PAD[0]
|
||||||
|
// <0x1=>PAD[1]
|
||||||
|
// <0x2=>PAD[2]
|
||||||
|
// <0x3=>PAD[3]
|
||||||
|
// <id> spi_master_rxpo
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_RXPO
|
||||||
|
#define CONF_SERCOM_4_SPI_RXPO 3
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <o> Transmit Data Pinout
|
||||||
|
// <0x0=>PAD[0,1]_DO_SCK
|
||||||
|
// <0x1=>PAD[2,3]_DO_SCK
|
||||||
|
// <0x2=>PAD[3,1]_DO_SCK
|
||||||
|
// <0x3=>PAD[0,3]_DO_SCK
|
||||||
|
// <id> spi_master_txpo
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_TXPO
|
||||||
|
#define CONF_SERCOM_4_SPI_TXPO 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Calculate baud register value from requested baudrate value
|
||||||
|
#ifndef CONF_SERCOM_4_SPI_BAUD_RATE
|
||||||
|
#define CONF_SERCOM_4_SPI_BAUD_RATE ((float)CONF_GCLK_SERCOM4_CORE_FREQUENCY / (float)(2 * CONF_SERCOM_4_SPI_BAUD)) - 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <<< end of configuration section >>>
|
||||||
|
|
||||||
|
#endif // HPL_SERCOM_CONFIG_H
|
|
@ -0,0 +1,177 @@
|
||||||
|
/* Auto-generated config file peripheral_clk_config.h */
|
||||||
|
#ifndef PERIPHERAL_CLK_CONFIG_H
|
||||||
|
#define PERIPHERAL_CLK_CONFIG_H
|
||||||
|
|
||||||
|
// <<< Use Configuration Wizard in Context Menu >>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \def CONF_CPU_FREQUENCY
|
||||||
|
* \brief CPU's Clock frequency
|
||||||
|
*/
|
||||||
|
#ifndef CONF_CPU_FREQUENCY
|
||||||
|
#define CONF_CPU_FREQUENCY 12000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <y> Core Clock Source
|
||||||
|
// <id> core_gclk_selection
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK0_Val"> Generic clock generator 0
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK1_Val"> Generic clock generator 1
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK2_Val"> Generic clock generator 2
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK3_Val"> Generic clock generator 3
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK4_Val"> Generic clock generator 4
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK5_Val"> Generic clock generator 5
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK6_Val"> Generic clock generator 6
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK7_Val"> Generic clock generator 7
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK8_Val"> Generic clock generator 8
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK9_Val"> Generic clock generator 9
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK10_Val"> Generic clock generator 10
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK11_Val"> Generic clock generator 11
|
||||||
|
|
||||||
|
// <i> Select the clock source for CORE.
|
||||||
|
#ifndef CONF_GCLK_SERCOM2_CORE_SRC
|
||||||
|
#define CONF_GCLK_SERCOM2_CORE_SRC GCLK_PCHCTRL_GEN_GCLK0_Val
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <y> Slow Clock Source
|
||||||
|
// <id> slow_gclk_selection
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK0_Val"> Generic clock generator 0
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK1_Val"> Generic clock generator 1
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK2_Val"> Generic clock generator 2
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK3_Val"> Generic clock generator 3
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK4_Val"> Generic clock generator 4
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK5_Val"> Generic clock generator 5
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK6_Val"> Generic clock generator 6
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK7_Val"> Generic clock generator 7
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK8_Val"> Generic clock generator 8
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK9_Val"> Generic clock generator 9
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK10_Val"> Generic clock generator 10
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK11_Val"> Generic clock generator 11
|
||||||
|
|
||||||
|
// <i> Select the slow clock source.
|
||||||
|
#ifndef CONF_GCLK_SERCOM2_SLOW_SRC
|
||||||
|
#define CONF_GCLK_SERCOM2_SLOW_SRC GCLK_PCHCTRL_GEN_GCLK3_Val
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \def CONF_GCLK_SERCOM2_CORE_FREQUENCY
|
||||||
|
* \brief SERCOM2's Core Clock frequency
|
||||||
|
*/
|
||||||
|
#ifndef CONF_GCLK_SERCOM2_CORE_FREQUENCY
|
||||||
|
#define CONF_GCLK_SERCOM2_CORE_FREQUENCY 12000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \def CONF_GCLK_SERCOM2_SLOW_FREQUENCY
|
||||||
|
* \brief SERCOM2's Slow Clock frequency
|
||||||
|
*/
|
||||||
|
#ifndef CONF_GCLK_SERCOM2_SLOW_FREQUENCY
|
||||||
|
#define CONF_GCLK_SERCOM2_SLOW_FREQUENCY 32768
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <y> Core Clock Source
|
||||||
|
// <id> core_gclk_selection
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK0_Val"> Generic clock generator 0
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK1_Val"> Generic clock generator 1
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK2_Val"> Generic clock generator 2
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK3_Val"> Generic clock generator 3
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK4_Val"> Generic clock generator 4
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK5_Val"> Generic clock generator 5
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK6_Val"> Generic clock generator 6
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK7_Val"> Generic clock generator 7
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK8_Val"> Generic clock generator 8
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK9_Val"> Generic clock generator 9
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK10_Val"> Generic clock generator 10
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK11_Val"> Generic clock generator 11
|
||||||
|
|
||||||
|
// <i> Select the clock source for CORE.
|
||||||
|
#ifndef CONF_GCLK_SERCOM4_CORE_SRC
|
||||||
|
#define CONF_GCLK_SERCOM4_CORE_SRC GCLK_PCHCTRL_GEN_GCLK0_Val
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <y> Slow Clock Source
|
||||||
|
// <id> slow_gclk_selection
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK0_Val"> Generic clock generator 0
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK1_Val"> Generic clock generator 1
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK2_Val"> Generic clock generator 2
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK3_Val"> Generic clock generator 3
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK4_Val"> Generic clock generator 4
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK5_Val"> Generic clock generator 5
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK6_Val"> Generic clock generator 6
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK7_Val"> Generic clock generator 7
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK8_Val"> Generic clock generator 8
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK9_Val"> Generic clock generator 9
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK10_Val"> Generic clock generator 10
|
||||||
|
|
||||||
|
// <GCLK_PCHCTRL_GEN_GCLK11_Val"> Generic clock generator 11
|
||||||
|
|
||||||
|
// <i> Select the slow clock source.
|
||||||
|
#ifndef CONF_GCLK_SERCOM4_SLOW_SRC
|
||||||
|
#define CONF_GCLK_SERCOM4_SLOW_SRC GCLK_PCHCTRL_GEN_GCLK3_Val
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \def CONF_GCLK_SERCOM4_CORE_FREQUENCY
|
||||||
|
* \brief SERCOM4's Core Clock frequency
|
||||||
|
*/
|
||||||
|
#ifndef CONF_GCLK_SERCOM4_CORE_FREQUENCY
|
||||||
|
#define CONF_GCLK_SERCOM4_CORE_FREQUENCY 12000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \def CONF_GCLK_SERCOM4_SLOW_FREQUENCY
|
||||||
|
* \brief SERCOM4's Slow Clock frequency
|
||||||
|
*/
|
||||||
|
#ifndef CONF_GCLK_SERCOM4_SLOW_FREQUENCY
|
||||||
|
#define CONF_GCLK_SERCOM4_SLOW_FREQUENCY 32768
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// <<< end of configuration section >>>
|
||||||
|
|
||||||
|
#endif // PERIPHERAL_CLK_CONFIG_H
|
|
@ -0,0 +1,9 @@
|
||||||
|
/* Auto-generated config file stdio_redirect_config.h */
|
||||||
|
#ifndef STDIO_REDIRECT_CONFIG_H
|
||||||
|
#define STDIO_REDIRECT_CONFIG_H
|
||||||
|
|
||||||
|
// <<< Use Configuration Wizard in Context Menu >>>
|
||||||
|
|
||||||
|
// <<< end of configuration section >>>
|
||||||
|
|
||||||
|
#endif // STDIO_REDIRECT_CONFIG_H
|
|
@ -0,0 +1,475 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Configurations xmlns:i="http://www.w3.org/2001/XMLSchema-instance" z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" xmlns="DefaultValues">
|
||||||
|
<Configurations>
|
||||||
|
<Configuration z:Id="i2">
|
||||||
|
<Compiler_dictionary xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>DebugLevel</d4p1:Key>
|
||||||
|
<d4p1:Value>None</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>IncludePaths</d4p1:Key>
|
||||||
|
<d4p1:Value>NDEBUG</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>MiscellaneousSettings</d4p1:Key>
|
||||||
|
<d4p1:Value>-std=gnu99</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>OptimizationLevel</d4p1:Key>
|
||||||
|
<d4p1:Value>Optimize for size (-Os)</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>SymbolDefines</d4p1:Key>
|
||||||
|
<d4p1:Value>NDEBUG</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>SymbolUndefines</d4p1:Key>
|
||||||
|
<d4p1:Value></d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>Verbose</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>WarningsAsErrors</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.general.CLanguageExp</d4p1:Key>
|
||||||
|
<d4p1:Value>True</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.general.ChangeDefaultCharTypeUnsigned</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.general.ChangeDefaultBitFieldUnsigned</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.general.processormode</d4p1:Key>
|
||||||
|
<d4p1:Value></d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.preprocessor.DoNotSearchSystemDirectories</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.preprocessor.PreprocessOnly</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.symbols.Default</d4p1:Key>
|
||||||
|
<d4p1:Value></d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.directories.DefaultIncludePath</d4p1:Key>
|
||||||
|
<d4p1:Value>True</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.optimization.OtherFlags</d4p1:Key>
|
||||||
|
<d4p1:Value></d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection</d4p1:Key>
|
||||||
|
<d4p1:Value>True</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.optimization.PrepareDataForGarbageCollection</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.optimization.EnableUnsafeMatchOptimizations</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.optimization.EnableFastMath</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.optimization.GeneratePositionIndependentCode</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.optimization.EnableLongCalls</d4p1:Key>
|
||||||
|
<d4p1:Value>True</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.optimization.OtherDebuggingFlags</d4p1:Key>
|
||||||
|
<d4p1:Value></d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.optimization.GenerateGprofInformation</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.optimization.GenerateProfInformation</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.warnings.AllWarnings</d4p1:Key>
|
||||||
|
<d4p1:Value>True</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.warnings.ExtraWarnings</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.warnings.Undefined</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.warnings.CheckSyntaxOnly</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.warnings.Pedantic</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.warnings.PedanticWarningsAsErrors</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.warnings.InhibitAllWarnings</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.miscellaneous.Device</d4p1:Key>
|
||||||
|
<d4p1:Value>True</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.miscellaneous.CompileOnly</d4p1:Key>
|
||||||
|
<d4p1:Value>True</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.miscellaneous.SupportAnsiPrograms</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.miscellaneous.MakeFileDependent</d4p1:Key>
|
||||||
|
<d4p1:Value>True</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
</Compiler_dictionary>
|
||||||
|
<Linker_dictionary xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>Libraries</d4p1:Key>
|
||||||
|
<d4p1:Value>libm</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>LibrarySearchPath</d4p1:Key>
|
||||||
|
<d4p1:Value>$(ProjectDir)\Device_Startup</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>MiscellaneousSettings</d4p1:Key>
|
||||||
|
<d4p1:Value>-Tsame54p20a_flash.ld</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.general.DoNotUseStandardStartFiles</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.general.DoNotUseDefaultLibraries</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.general.NoStartupOrDefaultLibs</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.general.OmitAllSymbolInformation</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.general.NoSharedLibraries</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.general.GenerateMAPFile</d4p1:Key>
|
||||||
|
<d4p1:Value>True</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.general.UseNewlibNano</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.general.AdditionalSpecs</d4p1:Key>
|
||||||
|
<d4p1:Value>None</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.optimization.GarbageCollectUnusedSections</d4p1:Key>
|
||||||
|
<d4p1:Value>True</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.optimization.EnableUnsafeMatchOptimizations</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.optimization.EnableFastMath</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.optimization.GeneratePositionIndependentCode</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.memorysettings.Flash</d4p1:Key>
|
||||||
|
<d4p1:Value></d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.memorysettings.Sram</d4p1:Key>
|
||||||
|
<d4p1:Value></d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.memorysettings.ExternalRAM</d4p1:Key>
|
||||||
|
<d4p1:Value></d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.miscellaneous.OtherOptions</d4p1:Key>
|
||||||
|
<d4p1:Value></d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.miscellaneous.OtherObjects</d4p1:Key>
|
||||||
|
<d4p1:Value></d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
</Linker_dictionary>
|
||||||
|
<Name>Release</Name>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration z:Id="i3">
|
||||||
|
<Compiler_dictionary xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>DebugLevel</d4p1:Key>
|
||||||
|
<d4p1:Value>Maximum (-g3)</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>IncludePaths</d4p1:Key>
|
||||||
|
<d4p1:Value>DEBUG</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>MiscellaneousSettings</d4p1:Key>
|
||||||
|
<d4p1:Value>-std=gnu99</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>OptimizationLevel</d4p1:Key>
|
||||||
|
<d4p1:Value>Optimize debugging experience (-Og)</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>SymbolDefines</d4p1:Key>
|
||||||
|
<d4p1:Value>DEBUG</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>SymbolUndefines</d4p1:Key>
|
||||||
|
<d4p1:Value></d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>Verbose</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>WarningsAsErrors</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.general.CLanguageExp</d4p1:Key>
|
||||||
|
<d4p1:Value>True</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.general.ChangeDefaultCharTypeUnsigned</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.general.ChangeDefaultBitFieldUnsigned</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.general.processormode</d4p1:Key>
|
||||||
|
<d4p1:Value></d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.preprocessor.DoNotSearchSystemDirectories</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.preprocessor.PreprocessOnly</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.symbols.Default</d4p1:Key>
|
||||||
|
<d4p1:Value></d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.directories.DefaultIncludePath</d4p1:Key>
|
||||||
|
<d4p1:Value>True</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.optimization.OtherFlags</d4p1:Key>
|
||||||
|
<d4p1:Value></d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection</d4p1:Key>
|
||||||
|
<d4p1:Value>True</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.optimization.PrepareDataForGarbageCollection</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.optimization.EnableUnsafeMatchOptimizations</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.optimization.EnableFastMath</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.optimization.GeneratePositionIndependentCode</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.optimization.EnableLongCalls</d4p1:Key>
|
||||||
|
<d4p1:Value>True</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.optimization.OtherDebuggingFlags</d4p1:Key>
|
||||||
|
<d4p1:Value></d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.optimization.GenerateGprofInformation</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.optimization.GenerateProfInformation</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.warnings.AllWarnings</d4p1:Key>
|
||||||
|
<d4p1:Value>True</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.warnings.ExtraWarnings</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.warnings.Undefined</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.warnings.CheckSyntaxOnly</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.warnings.Pedantic</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.warnings.PedanticWarningsAsErrors</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.warnings.InhibitAllWarnings</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.miscellaneous.Device</d4p1:Key>
|
||||||
|
<d4p1:Value>True</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.miscellaneous.CompileOnly</d4p1:Key>
|
||||||
|
<d4p1:Value>True</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.miscellaneous.SupportAnsiPrograms</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.compiler.miscellaneous.MakeFileDependent</d4p1:Key>
|
||||||
|
<d4p1:Value>True</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
</Compiler_dictionary>
|
||||||
|
<Linker_dictionary xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>Libraries</d4p1:Key>
|
||||||
|
<d4p1:Value>libm</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>LibrarySearchPath</d4p1:Key>
|
||||||
|
<d4p1:Value>$(ProjectDir)\Device_Startup</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>MiscellaneousSettings</d4p1:Key>
|
||||||
|
<d4p1:Value>-Tsame54p20a_flash.ld</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.general.DoNotUseStandardStartFiles</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.general.DoNotUseDefaultLibraries</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.general.NoStartupOrDefaultLibs</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.general.OmitAllSymbolInformation</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.general.NoSharedLibraries</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.general.GenerateMAPFile</d4p1:Key>
|
||||||
|
<d4p1:Value>True</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.general.UseNewlibNano</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.general.AdditionalSpecs</d4p1:Key>
|
||||||
|
<d4p1:Value>None</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.optimization.GarbageCollectUnusedSections</d4p1:Key>
|
||||||
|
<d4p1:Value>True</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.optimization.EnableUnsafeMatchOptimizations</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.optimization.EnableFastMath</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.optimization.GeneratePositionIndependentCode</d4p1:Key>
|
||||||
|
<d4p1:Value>False</d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.memorysettings.Flash</d4p1:Key>
|
||||||
|
<d4p1:Value></d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.memorysettings.Sram</d4p1:Key>
|
||||||
|
<d4p1:Value></d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.memorysettings.ExternalRAM</d4p1:Key>
|
||||||
|
<d4p1:Value></d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.miscellaneous.OtherOptions</d4p1:Key>
|
||||||
|
<d4p1:Value></d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:KeyValueOfstringstring>
|
||||||
|
<d4p1:Key>armgcc.linker.miscellaneous.OtherObjects</d4p1:Key>
|
||||||
|
<d4p1:Value></d4p1:Value>
|
||||||
|
</d4p1:KeyValueOfstringstring>
|
||||||
|
</Linker_dictionary>
|
||||||
|
<Name>Debug</Name>
|
||||||
|
</Configuration>
|
||||||
|
</Configurations>
|
||||||
|
</Configurations>
|
|
@ -0,0 +1,163 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief Linker script for running in internal FLASH on the SAME54P20A
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 Microchip Technology Inc.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
* not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the Licence at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||||
|
OUTPUT_ARCH(arm)
|
||||||
|
SEARCH_DIR(.)
|
||||||
|
|
||||||
|
/* Memory Spaces Definitions */
|
||||||
|
MEMORY
|
||||||
|
{
|
||||||
|
rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00100000
|
||||||
|
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00040000
|
||||||
|
bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
|
||||||
|
qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
|
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x10000;
|
||||||
|
|
||||||
|
/* Section Definitions */
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
.text :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
_sfixed = .;
|
||||||
|
KEEP(*(.vectors .vectors.*))
|
||||||
|
*(.text .text.* .gnu.linkonce.t.*)
|
||||||
|
*(.glue_7t) *(.glue_7)
|
||||||
|
*(.rodata .rodata* .gnu.linkonce.r.*)
|
||||||
|
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||||
|
|
||||||
|
/* Support C constructors, and C destructors in both user code
|
||||||
|
and the C library. This also provides support for C++ code. */
|
||||||
|
. = ALIGN(4);
|
||||||
|
KEEP(*(.init))
|
||||||
|
. = ALIGN(4);
|
||||||
|
__preinit_array_start = .;
|
||||||
|
KEEP (*(.preinit_array))
|
||||||
|
__preinit_array_end = .;
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
__init_array_start = .;
|
||||||
|
KEEP (*(SORT(.init_array.*)))
|
||||||
|
KEEP (*(.init_array))
|
||||||
|
__init_array_end = .;
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
KEEP (*crtbegin.o(.ctors))
|
||||||
|
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
|
||||||
|
KEEP (*(SORT(.ctors.*)))
|
||||||
|
KEEP (*crtend.o(.ctors))
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
KEEP(*(.fini))
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
__fini_array_start = .;
|
||||||
|
KEEP (*(.fini_array))
|
||||||
|
KEEP (*(SORT(.fini_array.*)))
|
||||||
|
__fini_array_end = .;
|
||||||
|
|
||||||
|
KEEP (*crtbegin.o(.dtors))
|
||||||
|
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
|
||||||
|
KEEP (*(SORT(.dtors.*)))
|
||||||
|
KEEP (*crtend.o(.dtors))
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
_efixed = .; /* End of text section */
|
||||||
|
} > rom
|
||||||
|
|
||||||
|
/* .ARM.exidx is sorted, so has to go in its own output section. */
|
||||||
|
PROVIDE_HIDDEN (__exidx_start = .);
|
||||||
|
.ARM.exidx :
|
||||||
|
{
|
||||||
|
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||||
|
} > rom
|
||||||
|
PROVIDE_HIDDEN (__exidx_end = .);
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
_etext = .;
|
||||||
|
|
||||||
|
.relocate : AT (_etext)
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
_srelocate = .;
|
||||||
|
*(.ramfunc .ramfunc.*);
|
||||||
|
*(.data .data.*);
|
||||||
|
. = ALIGN(4);
|
||||||
|
_erelocate = .;
|
||||||
|
} > ram
|
||||||
|
|
||||||
|
.bkupram (NOLOAD):
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
_sbkupram = .;
|
||||||
|
*(.bkupram .bkupram.*);
|
||||||
|
. = ALIGN(8);
|
||||||
|
_ebkupram = .;
|
||||||
|
} > bkupram
|
||||||
|
|
||||||
|
.qspi (NOLOAD):
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
_sqspi = .;
|
||||||
|
*(.qspi .qspi.*);
|
||||||
|
. = ALIGN(8);
|
||||||
|
_eqspi = .;
|
||||||
|
} > qspi
|
||||||
|
|
||||||
|
/* .bss section which is used for uninitialized data */
|
||||||
|
.bss (NOLOAD) :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
_sbss = . ;
|
||||||
|
_szero = .;
|
||||||
|
*(.bss .bss.*)
|
||||||
|
*(COMMON)
|
||||||
|
. = ALIGN(4);
|
||||||
|
_ebss = . ;
|
||||||
|
_ezero = .;
|
||||||
|
} > ram
|
||||||
|
|
||||||
|
/* stack section */
|
||||||
|
.stack (NOLOAD):
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
_sstack = .;
|
||||||
|
. = . + STACK_SIZE;
|
||||||
|
. = ALIGN(8);
|
||||||
|
_estack = .;
|
||||||
|
} > ram
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
_end = . ;
|
||||||
|
}
|
|
@ -0,0 +1,162 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief Linker script for running in internal SRAM on the SAME54P20A
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 Microchip Technology Inc.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
* not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the Licence at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||||
|
OUTPUT_ARCH(arm)
|
||||||
|
SEARCH_DIR(.)
|
||||||
|
|
||||||
|
/* Memory Spaces Definitions */
|
||||||
|
MEMORY
|
||||||
|
{
|
||||||
|
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00040000
|
||||||
|
bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
|
||||||
|
qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
|
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x10000;
|
||||||
|
|
||||||
|
/* Section Definitions */
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
.text :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
_sfixed = .;
|
||||||
|
KEEP(*(.vectors .vectors.*))
|
||||||
|
*(.text .text.* .gnu.linkonce.t.*)
|
||||||
|
*(.glue_7t) *(.glue_7)
|
||||||
|
*(.rodata .rodata* .gnu.linkonce.r.*)
|
||||||
|
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||||
|
|
||||||
|
/* Support C constructors, and C destructors in both user code
|
||||||
|
and the C library. This also provides support for C++ code. */
|
||||||
|
. = ALIGN(4);
|
||||||
|
KEEP(*(.init))
|
||||||
|
. = ALIGN(4);
|
||||||
|
__preinit_array_start = .;
|
||||||
|
KEEP (*(.preinit_array))
|
||||||
|
__preinit_array_end = .;
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
__init_array_start = .;
|
||||||
|
KEEP (*(SORT(.init_array.*)))
|
||||||
|
KEEP (*(.init_array))
|
||||||
|
__init_array_end = .;
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
KEEP (*crtbegin.o(.ctors))
|
||||||
|
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
|
||||||
|
KEEP (*(SORT(.ctors.*)))
|
||||||
|
KEEP (*crtend.o(.ctors))
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
KEEP(*(.fini))
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
__fini_array_start = .;
|
||||||
|
KEEP (*(.fini_array))
|
||||||
|
KEEP (*(SORT(.fini_array.*)))
|
||||||
|
__fini_array_end = .;
|
||||||
|
|
||||||
|
KEEP (*crtbegin.o(.dtors))
|
||||||
|
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
|
||||||
|
KEEP (*(SORT(.dtors.*)))
|
||||||
|
KEEP (*crtend.o(.dtors))
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
_efixed = .; /* End of text section */
|
||||||
|
} > ram
|
||||||
|
|
||||||
|
/* .ARM.exidx is sorted, so has to go in its own output section. */
|
||||||
|
PROVIDE_HIDDEN (__exidx_start = .);
|
||||||
|
.ARM.exidx :
|
||||||
|
{
|
||||||
|
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||||
|
} > ram
|
||||||
|
PROVIDE_HIDDEN (__exidx_end = .);
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
_etext = .;
|
||||||
|
|
||||||
|
.relocate : AT (_etext)
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
_srelocate = .;
|
||||||
|
*(.ramfunc .ramfunc.*);
|
||||||
|
*(.data .data.*);
|
||||||
|
. = ALIGN(4);
|
||||||
|
_erelocate = .;
|
||||||
|
} > ram
|
||||||
|
|
||||||
|
.bkupram (NOLOAD):
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
_sbkupram = .;
|
||||||
|
*(.bkupram .bkupram.*);
|
||||||
|
. = ALIGN(8);
|
||||||
|
_ebkupram = .;
|
||||||
|
} > bkupram
|
||||||
|
|
||||||
|
.qspi (NOLOAD):
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
_sqspi = .;
|
||||||
|
*(.qspi .qspi.*);
|
||||||
|
. = ALIGN(8);
|
||||||
|
_eqspi = .;
|
||||||
|
} > qspi
|
||||||
|
|
||||||
|
/* .bss section which is used for uninitialized data */
|
||||||
|
.bss (NOLOAD) :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
_sbss = . ;
|
||||||
|
_szero = .;
|
||||||
|
*(.bss .bss.*)
|
||||||
|
*(COMMON)
|
||||||
|
. = ALIGN(4);
|
||||||
|
_ebss = . ;
|
||||||
|
_ezero = .;
|
||||||
|
} > ram
|
||||||
|
|
||||||
|
/* stack section */
|
||||||
|
.stack (NOLOAD):
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
_sstack = .;
|
||||||
|
. = . + STACK_SIZE;
|
||||||
|
. = ALIGN(8);
|
||||||
|
_estack = .;
|
||||||
|
} > ram
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
_end = . ;
|
||||||
|
}
|
|
@ -0,0 +1,546 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief gcc starttup file for SAME54
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 Microchip Technology Inc.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
* not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the Licence at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "same54.h"
|
||||||
|
|
||||||
|
/* Initialize segments */
|
||||||
|
extern uint32_t _sfixed;
|
||||||
|
extern uint32_t _efixed;
|
||||||
|
extern uint32_t _etext;
|
||||||
|
extern uint32_t _srelocate;
|
||||||
|
extern uint32_t _erelocate;
|
||||||
|
extern uint32_t _szero;
|
||||||
|
extern uint32_t _ezero;
|
||||||
|
extern uint32_t _sstack;
|
||||||
|
extern uint32_t _estack;
|
||||||
|
|
||||||
|
/** \cond DOXYGEN_SHOULD_SKIP_THIS */
|
||||||
|
int main(void);
|
||||||
|
/** \endcond */
|
||||||
|
|
||||||
|
void __libc_init_array(void);
|
||||||
|
|
||||||
|
/* Default empty handler */
|
||||||
|
void Dummy_Handler(void);
|
||||||
|
|
||||||
|
/* Cortex-M4 core handlers */
|
||||||
|
void NonMaskableInt_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void HardFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void MemManagement_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void BusFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void UsageFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void SVCall_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void DebugMonitor_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void PendSV_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void SysTick_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
|
||||||
|
/* Peripherals handlers */
|
||||||
|
void PM_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void MCLK_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void OSCCTRL_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* OSCCTRL_XOSCFAIL_0, OSCCTRL_XOSCRDY_0 */
|
||||||
|
void OSCCTRL_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* OSCCTRL_XOSCFAIL_1, OSCCTRL_XOSCRDY_1 */
|
||||||
|
void OSCCTRL_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* OSCCTRL_DFLLLOCKC, OSCCTRL_DFLLLOCKF, OSCCTRL_DFLLOOB, OSCCTRL_DFLLRCS, OSCCTRL_DFLLRDY */
|
||||||
|
void OSCCTRL_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* OSCCTRL_DPLLLCKF_0, OSCCTRL_DPLLLCKR_0, OSCCTRL_DPLLLDRTO_0, OSCCTRL_DPLLLTO_0 */
|
||||||
|
void OSCCTRL_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* OSCCTRL_DPLLLCKF_1, OSCCTRL_DPLLLCKR_1, OSCCTRL_DPLLLDRTO_1, OSCCTRL_DPLLLTO_1 */
|
||||||
|
void OSC32KCTRL_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void SUPC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SUPC_B12SRDY, SUPC_B33SRDY, SUPC_BOD12RDY, SUPC_BOD33RDY, SUPC_VCORERDY, SUPC_VREGRDY */
|
||||||
|
void SUPC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SUPC_BOD12DET, SUPC_BOD33DET */
|
||||||
|
void WDT_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void RTC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void EIC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_0 */
|
||||||
|
void EIC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_1 */
|
||||||
|
void EIC_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_2 */
|
||||||
|
void EIC_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_3 */
|
||||||
|
void EIC_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_4 */
|
||||||
|
void EIC_5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_5 */
|
||||||
|
void EIC_6_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_6 */
|
||||||
|
void EIC_7_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_7 */
|
||||||
|
void EIC_8_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_8 */
|
||||||
|
void EIC_9_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_9 */
|
||||||
|
void EIC_10_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_10 */
|
||||||
|
void EIC_11_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_11 */
|
||||||
|
void EIC_12_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_12 */
|
||||||
|
void EIC_13_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_13 */
|
||||||
|
void EIC_14_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_14 */
|
||||||
|
void EIC_15_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_15 */
|
||||||
|
void FREQM_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void NVMCTRL_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* NVMCTRL_0, NVMCTRL_1, NVMCTRL_2, NVMCTRL_3, NVMCTRL_4, NVMCTRL_5, NVMCTRL_6, NVMCTRL_7 */
|
||||||
|
void NVMCTRL_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* NVMCTRL_10, NVMCTRL_8, NVMCTRL_9 */
|
||||||
|
void DMAC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DMAC_SUSP_0, DMAC_TCMPL_0, DMAC_TERR_0 */
|
||||||
|
void DMAC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DMAC_SUSP_1, DMAC_TCMPL_1, DMAC_TERR_1 */
|
||||||
|
void DMAC_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DMAC_SUSP_2, DMAC_TCMPL_2, DMAC_TERR_2 */
|
||||||
|
void DMAC_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DMAC_SUSP_3, DMAC_TCMPL_3, DMAC_TERR_3 */
|
||||||
|
void DMAC_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DMAC_SUSP_10, DMAC_SUSP_11, DMAC_SUSP_12, DMAC_SUSP_13, DMAC_SUSP_14, DMAC_SUSP_15, DMAC_SUSP_16, DMAC_SUSP_17, DMAC_SUSP_18, DMAC_SUSP_19, DMAC_SUSP_20, DMAC_SUSP_21, DMAC_SUSP_22, DMAC_SUSP_23, DMAC_SUSP_24, DMAC_SUSP_25, DMAC_SUSP_26, DMAC_SUSP_27, DMAC_SUSP_28, DMAC_SUSP_29, DMAC_SUSP_30, DMAC_SUSP_31, DMAC_SUSP_4, DMAC_SUSP_5, DMAC_SUSP_6, DMAC_SUSP_7, DMAC_SUSP_8, DMAC_SUSP_9, DMAC_TCMPL_10, DMAC_TCMPL_11, DMAC_TCMPL_12, DMAC_TCMPL_13, DMAC_TCMPL_14, DMAC_TCMPL_15, DMAC_TCMPL_16, DMAC_TCMPL_17, DMAC_TCMPL_18, DMAC_TCMPL_19, DMAC_TCMPL_20, DMAC_TCMPL_21, DMAC_TCMPL_22, DMAC_TCMPL_23, DMAC_TCMPL_24, DMAC_TCMPL_25, DMAC_TCMPL_26, DMAC_TCMPL_27, DMAC_TCMPL_28, DMAC_TCMPL_29, DMAC_TCMPL_30, DMAC_TCMPL_31, DMAC_TCMPL_4, DMAC_TCMPL_5, DMAC_TCMPL_6, DMAC_TCMPL_7, DMAC_TCMPL_8, DMAC_TCMPL_9, DMAC_TERR_10, DMAC_TERR_11, DMAC_TERR_12, DMAC_TERR_13, DMAC_TERR_14, DMAC_TERR_15, DMAC_TERR_16, DMAC_TERR_17, DMAC_TERR_18, DMAC_TERR_19, DMAC_TERR_20, DMAC_TERR_21, DMAC_TERR_22, DMAC_TERR_23, DMAC_TERR_24, DMAC_TERR_25, DMAC_TERR_26, DMAC_TERR_27, DMAC_TERR_28, DMAC_TERR_29, DMAC_TERR_30, DMAC_TERR_31, DMAC_TERR_4, DMAC_TERR_5, DMAC_TERR_6, DMAC_TERR_7, DMAC_TERR_8, DMAC_TERR_9 */
|
||||||
|
void EVSYS_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EVSYS_EVD_0, EVSYS_OVR_0 */
|
||||||
|
void EVSYS_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EVSYS_EVD_1, EVSYS_OVR_1 */
|
||||||
|
void EVSYS_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EVSYS_EVD_2, EVSYS_OVR_2 */
|
||||||
|
void EVSYS_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EVSYS_EVD_3, EVSYS_OVR_3 */
|
||||||
|
void EVSYS_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EVSYS_EVD_10, EVSYS_EVD_11, EVSYS_EVD_4, EVSYS_EVD_5, EVSYS_EVD_6, EVSYS_EVD_7, EVSYS_EVD_8, EVSYS_EVD_9, EVSYS_OVR_10, EVSYS_OVR_11, EVSYS_OVR_4, EVSYS_OVR_5, EVSYS_OVR_6, EVSYS_OVR_7, EVSYS_OVR_8, EVSYS_OVR_9 */
|
||||||
|
void PAC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void RAMECC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void SERCOM0_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM0_0 */
|
||||||
|
void SERCOM0_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM0_1 */
|
||||||
|
void SERCOM0_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM0_2 */
|
||||||
|
void SERCOM0_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM0_3, SERCOM0_4, SERCOM0_5, SERCOM0_6 */
|
||||||
|
void SERCOM1_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM1_0 */
|
||||||
|
void SERCOM1_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM1_1 */
|
||||||
|
void SERCOM1_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM1_2 */
|
||||||
|
void SERCOM1_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM1_3, SERCOM1_4, SERCOM1_5, SERCOM1_6 */
|
||||||
|
void SERCOM2_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM2_0 */
|
||||||
|
void SERCOM2_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM2_1 */
|
||||||
|
void SERCOM2_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM2_2 */
|
||||||
|
void SERCOM2_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM2_3, SERCOM2_4, SERCOM2_5, SERCOM2_6 */
|
||||||
|
void SERCOM3_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM3_0 */
|
||||||
|
void SERCOM3_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM3_1 */
|
||||||
|
void SERCOM3_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM3_2 */
|
||||||
|
void SERCOM3_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM3_3, SERCOM3_4, SERCOM3_5, SERCOM3_6 */
|
||||||
|
#ifdef ID_SERCOM4
|
||||||
|
void SERCOM4_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM4_0 */
|
||||||
|
void SERCOM4_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM4_1 */
|
||||||
|
void SERCOM4_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM4_2 */
|
||||||
|
void SERCOM4_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM4_3, SERCOM4_4, SERCOM4_5, SERCOM4_6 */
|
||||||
|
#endif
|
||||||
|
#ifdef ID_SERCOM5
|
||||||
|
void SERCOM5_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM5_0 */
|
||||||
|
void SERCOM5_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM5_1 */
|
||||||
|
void SERCOM5_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM5_2 */
|
||||||
|
void SERCOM5_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM5_3, SERCOM5_4, SERCOM5_5, SERCOM5_6 */
|
||||||
|
#endif
|
||||||
|
#ifdef ID_SERCOM6
|
||||||
|
void SERCOM6_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM6_0 */
|
||||||
|
void SERCOM6_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM6_1 */
|
||||||
|
void SERCOM6_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM6_2 */
|
||||||
|
void SERCOM6_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM6_3, SERCOM6_4, SERCOM6_5, SERCOM6_6 */
|
||||||
|
#endif
|
||||||
|
#ifdef ID_SERCOM7
|
||||||
|
void SERCOM7_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM7_0 */
|
||||||
|
void SERCOM7_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM7_1 */
|
||||||
|
void SERCOM7_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM7_2 */
|
||||||
|
void SERCOM7_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM7_3, SERCOM7_4, SERCOM7_5, SERCOM7_6 */
|
||||||
|
#endif
|
||||||
|
#ifdef ID_CAN0
|
||||||
|
void CAN0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
#endif
|
||||||
|
#ifdef ID_CAN1
|
||||||
|
void CAN1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
#endif
|
||||||
|
#ifdef ID_USB
|
||||||
|
void USB_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* USB_EORSM_DNRSM, USB_EORST_RST, USB_LPMSUSP_DDISC, USB_LPM_DCONN, USB_MSOF, USB_RAMACER, USB_RXSTP_TXSTP_0, USB_RXSTP_TXSTP_1, USB_RXSTP_TXSTP_2, USB_RXSTP_TXSTP_3, USB_RXSTP_TXSTP_4, USB_RXSTP_TXSTP_5, USB_RXSTP_TXSTP_6, USB_RXSTP_TXSTP_7, USB_STALL0_STALL_0, USB_STALL0_STALL_1, USB_STALL0_STALL_2, USB_STALL0_STALL_3, USB_STALL0_STALL_4, USB_STALL0_STALL_5, USB_STALL0_STALL_6, USB_STALL0_STALL_7, USB_STALL1_0, USB_STALL1_1, USB_STALL1_2, USB_STALL1_3, USB_STALL1_4, USB_STALL1_5, USB_STALL1_6, USB_STALL1_7, USB_SUSPEND, USB_TRFAIL0_TRFAIL_0, USB_TRFAIL0_TRFAIL_1, USB_TRFAIL0_TRFAIL_2, USB_TRFAIL0_TRFAIL_3, USB_TRFAIL0_TRFAIL_4, USB_TRFAIL0_TRFAIL_5, USB_TRFAIL0_TRFAIL_6, USB_TRFAIL0_TRFAIL_7, USB_TRFAIL1_PERR_0, USB_TRFAIL1_PERR_1, USB_TRFAIL1_PERR_2, USB_TRFAIL1_PERR_3, USB_TRFAIL1_PERR_4, USB_TRFAIL1_PERR_5, USB_TRFAIL1_PERR_6, USB_TRFAIL1_PERR_7, USB_UPRSM, USB_WAKEUP */
|
||||||
|
void USB_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* USB_SOF_HSOF */
|
||||||
|
void USB_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* USB_TRCPT0_0, USB_TRCPT0_1, USB_TRCPT0_2, USB_TRCPT0_3, USB_TRCPT0_4, USB_TRCPT0_5, USB_TRCPT0_6, USB_TRCPT0_7 */
|
||||||
|
void USB_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* USB_TRCPT1_0, USB_TRCPT1_1, USB_TRCPT1_2, USB_TRCPT1_3, USB_TRCPT1_4, USB_TRCPT1_5, USB_TRCPT1_6, USB_TRCPT1_7 */
|
||||||
|
#endif
|
||||||
|
#ifdef ID_GMAC
|
||||||
|
void GMAC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
#endif
|
||||||
|
void TCC0_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_CNT_A, TCC0_DFS_A, TCC0_ERR_A, TCC0_FAULT0_A, TCC0_FAULT1_A, TCC0_FAULTA_A, TCC0_FAULTB_A, TCC0_OVF, TCC0_TRG, TCC0_UFS_A */
|
||||||
|
void TCC0_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_0 */
|
||||||
|
void TCC0_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_1 */
|
||||||
|
void TCC0_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_2 */
|
||||||
|
void TCC0_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_3 */
|
||||||
|
void TCC0_5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_4 */
|
||||||
|
void TCC0_6_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_5 */
|
||||||
|
void TCC1_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC1_CNT_A, TCC1_DFS_A, TCC1_ERR_A, TCC1_FAULT0_A, TCC1_FAULT1_A, TCC1_FAULTA_A, TCC1_FAULTB_A, TCC1_OVF, TCC1_TRG, TCC1_UFS_A */
|
||||||
|
void TCC1_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC1_MC_0 */
|
||||||
|
void TCC1_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC1_MC_1 */
|
||||||
|
void TCC1_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC1_MC_2 */
|
||||||
|
void TCC1_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC1_MC_3 */
|
||||||
|
void TCC2_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC2_CNT_A, TCC2_DFS_A, TCC2_ERR_A, TCC2_FAULT0_A, TCC2_FAULT1_A, TCC2_FAULTA_A, TCC2_FAULTB_A, TCC2_OVF, TCC2_TRG, TCC2_UFS_A */
|
||||||
|
void TCC2_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC2_MC_0 */
|
||||||
|
void TCC2_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC2_MC_1 */
|
||||||
|
void TCC2_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC2_MC_2 */
|
||||||
|
#ifdef ID_TCC3
|
||||||
|
void TCC3_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC3_CNT_A, TCC3_DFS_A, TCC3_ERR_A, TCC3_FAULT0_A, TCC3_FAULT1_A, TCC3_FAULTA_A, TCC3_FAULTB_A, TCC3_OVF, TCC3_TRG, TCC3_UFS_A */
|
||||||
|
void TCC3_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC3_MC_0 */
|
||||||
|
void TCC3_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC3_MC_1 */
|
||||||
|
#endif
|
||||||
|
#ifdef ID_TCC4
|
||||||
|
void TCC4_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC4_CNT_A, TCC4_DFS_A, TCC4_ERR_A, TCC4_FAULT0_A, TCC4_FAULT1_A, TCC4_FAULTA_A, TCC4_FAULTB_A, TCC4_OVF, TCC4_TRG, TCC4_UFS_A */
|
||||||
|
void TCC4_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC4_MC_0 */
|
||||||
|
void TCC4_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC4_MC_1 */
|
||||||
|
#endif
|
||||||
|
void TC0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void TC1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void TC2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void TC3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
#ifdef ID_TC4
|
||||||
|
void TC4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
#endif
|
||||||
|
#ifdef ID_TC5
|
||||||
|
void TC5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
#endif
|
||||||
|
#ifdef ID_TC6
|
||||||
|
void TC6_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
#endif
|
||||||
|
#ifdef ID_TC7
|
||||||
|
void TC7_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
#endif
|
||||||
|
void PDEC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* PDEC_DIR_A, PDEC_ERR_A, PDEC_OVF, PDEC_VLC_A */
|
||||||
|
void PDEC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* PDEC_MC_0 */
|
||||||
|
void PDEC_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* PDEC_MC_1 */
|
||||||
|
void ADC0_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* ADC0_OVERRUN, ADC0_WINMON */
|
||||||
|
void ADC0_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* ADC0_RESRDY */
|
||||||
|
void ADC1_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* ADC1_OVERRUN, ADC1_WINMON */
|
||||||
|
void ADC1_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* ADC1_RESRDY */
|
||||||
|
void AC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void DAC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DAC_OVERRUN_A_0, DAC_OVERRUN_A_1, DAC_UNDERRUN_A_0, DAC_UNDERRUN_A_1 */
|
||||||
|
void DAC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DAC_EMPTY_0 */
|
||||||
|
void DAC_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DAC_EMPTY_1 */
|
||||||
|
void DAC_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DAC_RESRDY_0 */
|
||||||
|
void DAC_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DAC_RESRDY_1 */
|
||||||
|
#ifdef ID_I2S
|
||||||
|
void I2S_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
#endif
|
||||||
|
void PCC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void AES_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
void TRNG_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
#ifdef ID_ICM
|
||||||
|
void ICM_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
#endif
|
||||||
|
#ifdef ID_PUKCC
|
||||||
|
void PUKCC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
#endif
|
||||||
|
void QSPI_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
#ifdef ID_SDHC0
|
||||||
|
void SDHC0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
#endif
|
||||||
|
#ifdef ID_SDHC1
|
||||||
|
void SDHC1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Exception Table */
|
||||||
|
__attribute__ ((section(".vectors")))
|
||||||
|
const DeviceVectors exception_table = {
|
||||||
|
|
||||||
|
/* Configure Initial Stack Pointer, using linker-generated symbols */
|
||||||
|
.pvStack = (void*) (&_estack),
|
||||||
|
|
||||||
|
.pfnReset_Handler = (void*) Reset_Handler,
|
||||||
|
.pfnNonMaskableInt_Handler = (void*) NonMaskableInt_Handler,
|
||||||
|
.pfnHardFault_Handler = (void*) HardFault_Handler,
|
||||||
|
.pfnMemManagement_Handler = (void*) MemManagement_Handler,
|
||||||
|
.pfnBusFault_Handler = (void*) BusFault_Handler,
|
||||||
|
.pfnUsageFault_Handler = (void*) UsageFault_Handler,
|
||||||
|
.pvReservedM9 = (void*) (0UL), /* Reserved */
|
||||||
|
.pvReservedM8 = (void*) (0UL), /* Reserved */
|
||||||
|
.pvReservedM7 = (void*) (0UL), /* Reserved */
|
||||||
|
.pvReservedM6 = (void*) (0UL), /* Reserved */
|
||||||
|
.pfnSVCall_Handler = (void*) SVCall_Handler,
|
||||||
|
.pfnDebugMonitor_Handler = (void*) DebugMonitor_Handler,
|
||||||
|
.pvReservedM3 = (void*) (0UL), /* Reserved */
|
||||||
|
.pfnPendSV_Handler = (void*) PendSV_Handler,
|
||||||
|
.pfnSysTick_Handler = (void*) SysTick_Handler,
|
||||||
|
|
||||||
|
/* Configurable interrupts */
|
||||||
|
.pfnPM_Handler = (void*) PM_Handler, /* 0 Power Manager */
|
||||||
|
.pfnMCLK_Handler = (void*) MCLK_Handler, /* 1 Main Clock */
|
||||||
|
.pfnOSCCTRL_0_Handler = (void*) OSCCTRL_0_Handler, /* 2 OSCCTRL_XOSCFAIL_0, OSCCTRL_XOSCRDY_0 */
|
||||||
|
.pfnOSCCTRL_1_Handler = (void*) OSCCTRL_1_Handler, /* 3 OSCCTRL_XOSCFAIL_1, OSCCTRL_XOSCRDY_1 */
|
||||||
|
.pfnOSCCTRL_2_Handler = (void*) OSCCTRL_2_Handler, /* 4 OSCCTRL_DFLLLOCKC, OSCCTRL_DFLLLOCKF, OSCCTRL_DFLLOOB, OSCCTRL_DFLLRCS, OSCCTRL_DFLLRDY */
|
||||||
|
.pfnOSCCTRL_3_Handler = (void*) OSCCTRL_3_Handler, /* 5 OSCCTRL_DPLLLCKF_0, OSCCTRL_DPLLLCKR_0, OSCCTRL_DPLLLDRTO_0, OSCCTRL_DPLLLTO_0 */
|
||||||
|
.pfnOSCCTRL_4_Handler = (void*) OSCCTRL_4_Handler, /* 6 OSCCTRL_DPLLLCKF_1, OSCCTRL_DPLLLCKR_1, OSCCTRL_DPLLLDRTO_1, OSCCTRL_DPLLLTO_1 */
|
||||||
|
.pfnOSC32KCTRL_Handler = (void*) OSC32KCTRL_Handler, /* 7 32kHz Oscillators Control */
|
||||||
|
.pfnSUPC_0_Handler = (void*) SUPC_0_Handler, /* 8 SUPC_B12SRDY, SUPC_B33SRDY, SUPC_BOD12RDY, SUPC_BOD33RDY, SUPC_VCORERDY, SUPC_VREGRDY */
|
||||||
|
.pfnSUPC_1_Handler = (void*) SUPC_1_Handler, /* 9 SUPC_BOD12DET, SUPC_BOD33DET */
|
||||||
|
.pfnWDT_Handler = (void*) WDT_Handler, /* 10 Watchdog Timer */
|
||||||
|
.pfnRTC_Handler = (void*) RTC_Handler, /* 11 Real-Time Counter */
|
||||||
|
.pfnEIC_0_Handler = (void*) EIC_0_Handler, /* 12 EIC_EXTINT_0 */
|
||||||
|
.pfnEIC_1_Handler = (void*) EIC_1_Handler, /* 13 EIC_EXTINT_1 */
|
||||||
|
.pfnEIC_2_Handler = (void*) EIC_2_Handler, /* 14 EIC_EXTINT_2 */
|
||||||
|
.pfnEIC_3_Handler = (void*) EIC_3_Handler, /* 15 EIC_EXTINT_3 */
|
||||||
|
.pfnEIC_4_Handler = (void*) EIC_4_Handler, /* 16 EIC_EXTINT_4 */
|
||||||
|
.pfnEIC_5_Handler = (void*) EIC_5_Handler, /* 17 EIC_EXTINT_5 */
|
||||||
|
.pfnEIC_6_Handler = (void*) EIC_6_Handler, /* 18 EIC_EXTINT_6 */
|
||||||
|
.pfnEIC_7_Handler = (void*) EIC_7_Handler, /* 19 EIC_EXTINT_7 */
|
||||||
|
.pfnEIC_8_Handler = (void*) EIC_8_Handler, /* 20 EIC_EXTINT_8 */
|
||||||
|
.pfnEIC_9_Handler = (void*) EIC_9_Handler, /* 21 EIC_EXTINT_9 */
|
||||||
|
.pfnEIC_10_Handler = (void*) EIC_10_Handler, /* 22 EIC_EXTINT_10 */
|
||||||
|
.pfnEIC_11_Handler = (void*) EIC_11_Handler, /* 23 EIC_EXTINT_11 */
|
||||||
|
.pfnEIC_12_Handler = (void*) EIC_12_Handler, /* 24 EIC_EXTINT_12 */
|
||||||
|
.pfnEIC_13_Handler = (void*) EIC_13_Handler, /* 25 EIC_EXTINT_13 */
|
||||||
|
.pfnEIC_14_Handler = (void*) EIC_14_Handler, /* 26 EIC_EXTINT_14 */
|
||||||
|
.pfnEIC_15_Handler = (void*) EIC_15_Handler, /* 27 EIC_EXTINT_15 */
|
||||||
|
.pfnFREQM_Handler = (void*) FREQM_Handler, /* 28 Frequency Meter */
|
||||||
|
.pfnNVMCTRL_0_Handler = (void*) NVMCTRL_0_Handler, /* 29 NVMCTRL_0, NVMCTRL_1, NVMCTRL_2, NVMCTRL_3, NVMCTRL_4, NVMCTRL_5, NVMCTRL_6, NVMCTRL_7 */
|
||||||
|
.pfnNVMCTRL_1_Handler = (void*) NVMCTRL_1_Handler, /* 30 NVMCTRL_10, NVMCTRL_8, NVMCTRL_9 */
|
||||||
|
.pfnDMAC_0_Handler = (void*) DMAC_0_Handler, /* 31 DMAC_SUSP_0, DMAC_TCMPL_0, DMAC_TERR_0 */
|
||||||
|
.pfnDMAC_1_Handler = (void*) DMAC_1_Handler, /* 32 DMAC_SUSP_1, DMAC_TCMPL_1, DMAC_TERR_1 */
|
||||||
|
.pfnDMAC_2_Handler = (void*) DMAC_2_Handler, /* 33 DMAC_SUSP_2, DMAC_TCMPL_2, DMAC_TERR_2 */
|
||||||
|
.pfnDMAC_3_Handler = (void*) DMAC_3_Handler, /* 34 DMAC_SUSP_3, DMAC_TCMPL_3, DMAC_TERR_3 */
|
||||||
|
.pfnDMAC_4_Handler = (void*) DMAC_4_Handler, /* 35 DMAC_SUSP_10, DMAC_SUSP_11, DMAC_SUSP_12, DMAC_SUSP_13, DMAC_SUSP_14, DMAC_SUSP_15, DMAC_SUSP_16, DMAC_SUSP_17, DMAC_SUSP_18, DMAC_SUSP_19, DMAC_SUSP_20, DMAC_SUSP_21, DMAC_SUSP_22, DMAC_SUSP_23, DMAC_SUSP_24, DMAC_SUSP_25, DMAC_SUSP_26, DMAC_SUSP_27, DMAC_SUSP_28, DMAC_SUSP_29, DMAC_SUSP_30, DMAC_SUSP_31, DMAC_SUSP_4, DMAC_SUSP_5, DMAC_SUSP_6, DMAC_SUSP_7, DMAC_SUSP_8, DMAC_SUSP_9, DMAC_TCMPL_10, DMAC_TCMPL_11, DMAC_TCMPL_12, DMAC_TCMPL_13, DMAC_TCMPL_14, DMAC_TCMPL_15, DMAC_TCMPL_16, DMAC_TCMPL_17, DMAC_TCMPL_18, DMAC_TCMPL_19, DMAC_TCMPL_20, DMAC_TCMPL_21, DMAC_TCMPL_22, DMAC_TCMPL_23, DMAC_TCMPL_24, DMAC_TCMPL_25, DMAC_TCMPL_26, DMAC_TCMPL_27, DMAC_TCMPL_28, DMAC_TCMPL_29, DMAC_TCMPL_30, DMAC_TCMPL_31, DMAC_TCMPL_4, DMAC_TCMPL_5, DMAC_TCMPL_6, DMAC_TCMPL_7, DMAC_TCMPL_8, DMAC_TCMPL_9, DMAC_TERR_10, DMAC_TERR_11, DMAC_TERR_12, DMAC_TERR_13, DMAC_TERR_14, DMAC_TERR_15, DMAC_TERR_16, DMAC_TERR_17, DMAC_TERR_18, DMAC_TERR_19, DMAC_TERR_20, DMAC_TERR_21, DMAC_TERR_22, DMAC_TERR_23, DMAC_TERR_24, DMAC_TERR_25, DMAC_TERR_26, DMAC_TERR_27, DMAC_TERR_28, DMAC_TERR_29, DMAC_TERR_30, DMAC_TERR_31, DMAC_TERR_4, DMAC_TERR_5, DMAC_TERR_6, DMAC_TERR_7, DMAC_TERR_8, DMAC_TERR_9 */
|
||||||
|
.pfnEVSYS_0_Handler = (void*) EVSYS_0_Handler, /* 36 EVSYS_EVD_0, EVSYS_OVR_0 */
|
||||||
|
.pfnEVSYS_1_Handler = (void*) EVSYS_1_Handler, /* 37 EVSYS_EVD_1, EVSYS_OVR_1 */
|
||||||
|
.pfnEVSYS_2_Handler = (void*) EVSYS_2_Handler, /* 38 EVSYS_EVD_2, EVSYS_OVR_2 */
|
||||||
|
.pfnEVSYS_3_Handler = (void*) EVSYS_3_Handler, /* 39 EVSYS_EVD_3, EVSYS_OVR_3 */
|
||||||
|
.pfnEVSYS_4_Handler = (void*) EVSYS_4_Handler, /* 40 EVSYS_EVD_10, EVSYS_EVD_11, EVSYS_EVD_4, EVSYS_EVD_5, EVSYS_EVD_6, EVSYS_EVD_7, EVSYS_EVD_8, EVSYS_EVD_9, EVSYS_OVR_10, EVSYS_OVR_11, EVSYS_OVR_4, EVSYS_OVR_5, EVSYS_OVR_6, EVSYS_OVR_7, EVSYS_OVR_8, EVSYS_OVR_9 */
|
||||||
|
.pfnPAC_Handler = (void*) PAC_Handler, /* 41 Peripheral Access Controller */
|
||||||
|
.pvReserved42 = (void*) (0UL), /* 42 Reserved */
|
||||||
|
.pvReserved43 = (void*) (0UL), /* 43 Reserved */
|
||||||
|
.pvReserved44 = (void*) (0UL), /* 44 Reserved */
|
||||||
|
.pfnRAMECC_Handler = (void*) RAMECC_Handler, /* 45 RAM ECC */
|
||||||
|
.pfnSERCOM0_0_Handler = (void*) SERCOM0_0_Handler, /* 46 SERCOM0_0 */
|
||||||
|
.pfnSERCOM0_1_Handler = (void*) SERCOM0_1_Handler, /* 47 SERCOM0_1 */
|
||||||
|
.pfnSERCOM0_2_Handler = (void*) SERCOM0_2_Handler, /* 48 SERCOM0_2 */
|
||||||
|
.pfnSERCOM0_3_Handler = (void*) SERCOM0_3_Handler, /* 49 SERCOM0_3, SERCOM0_4, SERCOM0_5, SERCOM0_6 */
|
||||||
|
.pfnSERCOM1_0_Handler = (void*) SERCOM1_0_Handler, /* 50 SERCOM1_0 */
|
||||||
|
.pfnSERCOM1_1_Handler = (void*) SERCOM1_1_Handler, /* 51 SERCOM1_1 */
|
||||||
|
.pfnSERCOM1_2_Handler = (void*) SERCOM1_2_Handler, /* 52 SERCOM1_2 */
|
||||||
|
.pfnSERCOM1_3_Handler = (void*) SERCOM1_3_Handler, /* 53 SERCOM1_3, SERCOM1_4, SERCOM1_5, SERCOM1_6 */
|
||||||
|
.pfnSERCOM2_0_Handler = (void*) SERCOM2_0_Handler, /* 54 SERCOM2_0 */
|
||||||
|
.pfnSERCOM2_1_Handler = (void*) SERCOM2_1_Handler, /* 55 SERCOM2_1 */
|
||||||
|
.pfnSERCOM2_2_Handler = (void*) SERCOM2_2_Handler, /* 56 SERCOM2_2 */
|
||||||
|
.pfnSERCOM2_3_Handler = (void*) SERCOM2_3_Handler, /* 57 SERCOM2_3, SERCOM2_4, SERCOM2_5, SERCOM2_6 */
|
||||||
|
.pfnSERCOM3_0_Handler = (void*) SERCOM3_0_Handler, /* 58 SERCOM3_0 */
|
||||||
|
.pfnSERCOM3_1_Handler = (void*) SERCOM3_1_Handler, /* 59 SERCOM3_1 */
|
||||||
|
.pfnSERCOM3_2_Handler = (void*) SERCOM3_2_Handler, /* 60 SERCOM3_2 */
|
||||||
|
.pfnSERCOM3_3_Handler = (void*) SERCOM3_3_Handler, /* 61 SERCOM3_3, SERCOM3_4, SERCOM3_5, SERCOM3_6 */
|
||||||
|
#ifdef ID_SERCOM4
|
||||||
|
.pfnSERCOM4_0_Handler = (void*) SERCOM4_0_Handler, /* 62 SERCOM4_0 */
|
||||||
|
.pfnSERCOM4_1_Handler = (void*) SERCOM4_1_Handler, /* 63 SERCOM4_1 */
|
||||||
|
.pfnSERCOM4_2_Handler = (void*) SERCOM4_2_Handler, /* 64 SERCOM4_2 */
|
||||||
|
.pfnSERCOM4_3_Handler = (void*) SERCOM4_3_Handler, /* 65 SERCOM4_3, SERCOM4_4, SERCOM4_5, SERCOM4_6 */
|
||||||
|
#else
|
||||||
|
.pvReserved62 = (void*) (0UL), /* 62 Reserved */
|
||||||
|
.pvReserved63 = (void*) (0UL), /* 63 Reserved */
|
||||||
|
.pvReserved64 = (void*) (0UL), /* 64 Reserved */
|
||||||
|
.pvReserved65 = (void*) (0UL), /* 65 Reserved */
|
||||||
|
#endif
|
||||||
|
#ifdef ID_SERCOM5
|
||||||
|
.pfnSERCOM5_0_Handler = (void*) SERCOM5_0_Handler, /* 66 SERCOM5_0 */
|
||||||
|
.pfnSERCOM5_1_Handler = (void*) SERCOM5_1_Handler, /* 67 SERCOM5_1 */
|
||||||
|
.pfnSERCOM5_2_Handler = (void*) SERCOM5_2_Handler, /* 68 SERCOM5_2 */
|
||||||
|
.pfnSERCOM5_3_Handler = (void*) SERCOM5_3_Handler, /* 69 SERCOM5_3, SERCOM5_4, SERCOM5_5, SERCOM5_6 */
|
||||||
|
#else
|
||||||
|
.pvReserved66 = (void*) (0UL), /* 66 Reserved */
|
||||||
|
.pvReserved67 = (void*) (0UL), /* 67 Reserved */
|
||||||
|
.pvReserved68 = (void*) (0UL), /* 68 Reserved */
|
||||||
|
.pvReserved69 = (void*) (0UL), /* 69 Reserved */
|
||||||
|
#endif
|
||||||
|
#ifdef ID_SERCOM6
|
||||||
|
.pfnSERCOM6_0_Handler = (void*) SERCOM6_0_Handler, /* 70 SERCOM6_0 */
|
||||||
|
.pfnSERCOM6_1_Handler = (void*) SERCOM6_1_Handler, /* 71 SERCOM6_1 */
|
||||||
|
.pfnSERCOM6_2_Handler = (void*) SERCOM6_2_Handler, /* 72 SERCOM6_2 */
|
||||||
|
.pfnSERCOM6_3_Handler = (void*) SERCOM6_3_Handler, /* 73 SERCOM6_3, SERCOM6_4, SERCOM6_5, SERCOM6_6 */
|
||||||
|
#else
|
||||||
|
.pvReserved70 = (void*) (0UL), /* 70 Reserved */
|
||||||
|
.pvReserved71 = (void*) (0UL), /* 71 Reserved */
|
||||||
|
.pvReserved72 = (void*) (0UL), /* 72 Reserved */
|
||||||
|
.pvReserved73 = (void*) (0UL), /* 73 Reserved */
|
||||||
|
#endif
|
||||||
|
#ifdef ID_SERCOM7
|
||||||
|
.pfnSERCOM7_0_Handler = (void*) SERCOM7_0_Handler, /* 74 SERCOM7_0 */
|
||||||
|
.pfnSERCOM7_1_Handler = (void*) SERCOM7_1_Handler, /* 75 SERCOM7_1 */
|
||||||
|
.pfnSERCOM7_2_Handler = (void*) SERCOM7_2_Handler, /* 76 SERCOM7_2 */
|
||||||
|
.pfnSERCOM7_3_Handler = (void*) SERCOM7_3_Handler, /* 77 SERCOM7_3, SERCOM7_4, SERCOM7_5, SERCOM7_6 */
|
||||||
|
#else
|
||||||
|
.pvReserved74 = (void*) (0UL), /* 74 Reserved */
|
||||||
|
.pvReserved75 = (void*) (0UL), /* 75 Reserved */
|
||||||
|
.pvReserved76 = (void*) (0UL), /* 76 Reserved */
|
||||||
|
.pvReserved77 = (void*) (0UL), /* 77 Reserved */
|
||||||
|
#endif
|
||||||
|
#ifdef ID_CAN0
|
||||||
|
.pfnCAN0_Handler = (void*) CAN0_Handler, /* 78 Control Area Network 0 */
|
||||||
|
#else
|
||||||
|
.pvReserved78 = (void*) (0UL), /* 78 Reserved */
|
||||||
|
#endif
|
||||||
|
#ifdef ID_CAN1
|
||||||
|
.pfnCAN1_Handler = (void*) CAN1_Handler, /* 79 Control Area Network 1 */
|
||||||
|
#else
|
||||||
|
.pvReserved79 = (void*) (0UL), /* 79 Reserved */
|
||||||
|
#endif
|
||||||
|
#ifdef ID_USB
|
||||||
|
.pfnUSB_0_Handler = (void*) USB_0_Handler, /* 80 USB_EORSM_DNRSM, USB_EORST_RST, USB_LPMSUSP_DDISC, USB_LPM_DCONN, USB_MSOF, USB_RAMACER, USB_RXSTP_TXSTP_0, USB_RXSTP_TXSTP_1, USB_RXSTP_TXSTP_2, USB_RXSTP_TXSTP_3, USB_RXSTP_TXSTP_4, USB_RXSTP_TXSTP_5, USB_RXSTP_TXSTP_6, USB_RXSTP_TXSTP_7, USB_STALL0_STALL_0, USB_STALL0_STALL_1, USB_STALL0_STALL_2, USB_STALL0_STALL_3, USB_STALL0_STALL_4, USB_STALL0_STALL_5, USB_STALL0_STALL_6, USB_STALL0_STALL_7, USB_STALL1_0, USB_STALL1_1, USB_STALL1_2, USB_STALL1_3, USB_STALL1_4, USB_STALL1_5, USB_STALL1_6, USB_STALL1_7, USB_SUSPEND, USB_TRFAIL0_TRFAIL_0, USB_TRFAIL0_TRFAIL_1, USB_TRFAIL0_TRFAIL_2, USB_TRFAIL0_TRFAIL_3, USB_TRFAIL0_TRFAIL_4, USB_TRFAIL0_TRFAIL_5, USB_TRFAIL0_TRFAIL_6, USB_TRFAIL0_TRFAIL_7, USB_TRFAIL1_PERR_0, USB_TRFAIL1_PERR_1, USB_TRFAIL1_PERR_2, USB_TRFAIL1_PERR_3, USB_TRFAIL1_PERR_4, USB_TRFAIL1_PERR_5, USB_TRFAIL1_PERR_6, USB_TRFAIL1_PERR_7, USB_UPRSM, USB_WAKEUP */
|
||||||
|
.pfnUSB_1_Handler = (void*) USB_1_Handler, /* 81 USB_SOF_HSOF */
|
||||||
|
.pfnUSB_2_Handler = (void*) USB_2_Handler, /* 82 USB_TRCPT0_0, USB_TRCPT0_1, USB_TRCPT0_2, USB_TRCPT0_3, USB_TRCPT0_4, USB_TRCPT0_5, USB_TRCPT0_6, USB_TRCPT0_7 */
|
||||||
|
.pfnUSB_3_Handler = (void*) USB_3_Handler, /* 83 USB_TRCPT1_0, USB_TRCPT1_1, USB_TRCPT1_2, USB_TRCPT1_3, USB_TRCPT1_4, USB_TRCPT1_5, USB_TRCPT1_6, USB_TRCPT1_7 */
|
||||||
|
#else
|
||||||
|
.pvReserved80 = (void*) (0UL), /* 80 Reserved */
|
||||||
|
.pvReserved81 = (void*) (0UL), /* 81 Reserved */
|
||||||
|
.pvReserved82 = (void*) (0UL), /* 82 Reserved */
|
||||||
|
.pvReserved83 = (void*) (0UL), /* 83 Reserved */
|
||||||
|
#endif
|
||||||
|
#ifdef ID_GMAC
|
||||||
|
.pfnGMAC_Handler = (void*) GMAC_Handler, /* 84 Ethernet MAC */
|
||||||
|
#else
|
||||||
|
.pvReserved84 = (void*) (0UL), /* 84 Reserved */
|
||||||
|
#endif
|
||||||
|
.pfnTCC0_0_Handler = (void*) TCC0_0_Handler, /* 85 TCC0_CNT_A, TCC0_DFS_A, TCC0_ERR_A, TCC0_FAULT0_A, TCC0_FAULT1_A, TCC0_FAULTA_A, TCC0_FAULTB_A, TCC0_OVF, TCC0_TRG, TCC0_UFS_A */
|
||||||
|
.pfnTCC0_1_Handler = (void*) TCC0_1_Handler, /* 86 TCC0_MC_0 */
|
||||||
|
.pfnTCC0_2_Handler = (void*) TCC0_2_Handler, /* 87 TCC0_MC_1 */
|
||||||
|
.pfnTCC0_3_Handler = (void*) TCC0_3_Handler, /* 88 TCC0_MC_2 */
|
||||||
|
.pfnTCC0_4_Handler = (void*) TCC0_4_Handler, /* 89 TCC0_MC_3 */
|
||||||
|
.pfnTCC0_5_Handler = (void*) TCC0_5_Handler, /* 90 TCC0_MC_4 */
|
||||||
|
.pfnTCC0_6_Handler = (void*) TCC0_6_Handler, /* 91 TCC0_MC_5 */
|
||||||
|
.pfnTCC1_0_Handler = (void*) TCC1_0_Handler, /* 92 TCC1_CNT_A, TCC1_DFS_A, TCC1_ERR_A, TCC1_FAULT0_A, TCC1_FAULT1_A, TCC1_FAULTA_A, TCC1_FAULTB_A, TCC1_OVF, TCC1_TRG, TCC1_UFS_A */
|
||||||
|
.pfnTCC1_1_Handler = (void*) TCC1_1_Handler, /* 93 TCC1_MC_0 */
|
||||||
|
.pfnTCC1_2_Handler = (void*) TCC1_2_Handler, /* 94 TCC1_MC_1 */
|
||||||
|
.pfnTCC1_3_Handler = (void*) TCC1_3_Handler, /* 95 TCC1_MC_2 */
|
||||||
|
.pfnTCC1_4_Handler = (void*) TCC1_4_Handler, /* 96 TCC1_MC_3 */
|
||||||
|
.pfnTCC2_0_Handler = (void*) TCC2_0_Handler, /* 97 TCC2_CNT_A, TCC2_DFS_A, TCC2_ERR_A, TCC2_FAULT0_A, TCC2_FAULT1_A, TCC2_FAULTA_A, TCC2_FAULTB_A, TCC2_OVF, TCC2_TRG, TCC2_UFS_A */
|
||||||
|
.pfnTCC2_1_Handler = (void*) TCC2_1_Handler, /* 98 TCC2_MC_0 */
|
||||||
|
.pfnTCC2_2_Handler = (void*) TCC2_2_Handler, /* 99 TCC2_MC_1 */
|
||||||
|
.pfnTCC2_3_Handler = (void*) TCC2_3_Handler, /* 100 TCC2_MC_2 */
|
||||||
|
#ifdef ID_TCC3
|
||||||
|
.pfnTCC3_0_Handler = (void*) TCC3_0_Handler, /* 101 TCC3_CNT_A, TCC3_DFS_A, TCC3_ERR_A, TCC3_FAULT0_A, TCC3_FAULT1_A, TCC3_FAULTA_A, TCC3_FAULTB_A, TCC3_OVF, TCC3_TRG, TCC3_UFS_A */
|
||||||
|
.pfnTCC3_1_Handler = (void*) TCC3_1_Handler, /* 102 TCC3_MC_0 */
|
||||||
|
.pfnTCC3_2_Handler = (void*) TCC3_2_Handler, /* 103 TCC3_MC_1 */
|
||||||
|
#else
|
||||||
|
.pvReserved101 = (void*) (0UL), /* 101 Reserved */
|
||||||
|
.pvReserved102 = (void*) (0UL), /* 102 Reserved */
|
||||||
|
.pvReserved103 = (void*) (0UL), /* 103 Reserved */
|
||||||
|
#endif
|
||||||
|
#ifdef ID_TCC4
|
||||||
|
.pfnTCC4_0_Handler = (void*) TCC4_0_Handler, /* 104 TCC4_CNT_A, TCC4_DFS_A, TCC4_ERR_A, TCC4_FAULT0_A, TCC4_FAULT1_A, TCC4_FAULTA_A, TCC4_FAULTB_A, TCC4_OVF, TCC4_TRG, TCC4_UFS_A */
|
||||||
|
.pfnTCC4_1_Handler = (void*) TCC4_1_Handler, /* 105 TCC4_MC_0 */
|
||||||
|
.pfnTCC4_2_Handler = (void*) TCC4_2_Handler, /* 106 TCC4_MC_1 */
|
||||||
|
#else
|
||||||
|
.pvReserved104 = (void*) (0UL), /* 104 Reserved */
|
||||||
|
.pvReserved105 = (void*) (0UL), /* 105 Reserved */
|
||||||
|
.pvReserved106 = (void*) (0UL), /* 106 Reserved */
|
||||||
|
#endif
|
||||||
|
.pfnTC0_Handler = (void*) TC0_Handler, /* 107 Basic Timer Counter 0 */
|
||||||
|
.pfnTC1_Handler = (void*) TC1_Handler, /* 108 Basic Timer Counter 1 */
|
||||||
|
.pfnTC2_Handler = (void*) TC2_Handler, /* 109 Basic Timer Counter 2 */
|
||||||
|
.pfnTC3_Handler = (void*) TC3_Handler, /* 110 Basic Timer Counter 3 */
|
||||||
|
#ifdef ID_TC4
|
||||||
|
.pfnTC4_Handler = (void*) TC4_Handler, /* 111 Basic Timer Counter 4 */
|
||||||
|
#else
|
||||||
|
.pvReserved111 = (void*) (0UL), /* 111 Reserved */
|
||||||
|
#endif
|
||||||
|
#ifdef ID_TC5
|
||||||
|
.pfnTC5_Handler = (void*) TC5_Handler, /* 112 Basic Timer Counter 5 */
|
||||||
|
#else
|
||||||
|
.pvReserved112 = (void*) (0UL), /* 112 Reserved */
|
||||||
|
#endif
|
||||||
|
#ifdef ID_TC6
|
||||||
|
.pfnTC6_Handler = (void*) TC6_Handler, /* 113 Basic Timer Counter 6 */
|
||||||
|
#else
|
||||||
|
.pvReserved113 = (void*) (0UL), /* 113 Reserved */
|
||||||
|
#endif
|
||||||
|
#ifdef ID_TC7
|
||||||
|
.pfnTC7_Handler = (void*) TC7_Handler, /* 114 Basic Timer Counter 7 */
|
||||||
|
#else
|
||||||
|
.pvReserved114 = (void*) (0UL), /* 114 Reserved */
|
||||||
|
#endif
|
||||||
|
.pfnPDEC_0_Handler = (void*) PDEC_0_Handler, /* 115 PDEC_DIR_A, PDEC_ERR_A, PDEC_OVF, PDEC_VLC_A */
|
||||||
|
.pfnPDEC_1_Handler = (void*) PDEC_1_Handler, /* 116 PDEC_MC_0 */
|
||||||
|
.pfnPDEC_2_Handler = (void*) PDEC_2_Handler, /* 117 PDEC_MC_1 */
|
||||||
|
.pfnADC0_0_Handler = (void*) ADC0_0_Handler, /* 118 ADC0_OVERRUN, ADC0_WINMON */
|
||||||
|
.pfnADC0_1_Handler = (void*) ADC0_1_Handler, /* 119 ADC0_RESRDY */
|
||||||
|
.pfnADC1_0_Handler = (void*) ADC1_0_Handler, /* 120 ADC1_OVERRUN, ADC1_WINMON */
|
||||||
|
.pfnADC1_1_Handler = (void*) ADC1_1_Handler, /* 121 ADC1_RESRDY */
|
||||||
|
.pfnAC_Handler = (void*) AC_Handler, /* 122 Analog Comparators */
|
||||||
|
.pfnDAC_0_Handler = (void*) DAC_0_Handler, /* 123 DAC_OVERRUN_A_0, DAC_OVERRUN_A_1, DAC_UNDERRUN_A_0, DAC_UNDERRUN_A_1 */
|
||||||
|
.pfnDAC_1_Handler = (void*) DAC_1_Handler, /* 124 DAC_EMPTY_0 */
|
||||||
|
.pfnDAC_2_Handler = (void*) DAC_2_Handler, /* 125 DAC_EMPTY_1 */
|
||||||
|
.pfnDAC_3_Handler = (void*) DAC_3_Handler, /* 126 DAC_RESRDY_0 */
|
||||||
|
.pfnDAC_4_Handler = (void*) DAC_4_Handler, /* 127 DAC_RESRDY_1 */
|
||||||
|
#ifdef ID_I2S
|
||||||
|
.pfnI2S_Handler = (void*) I2S_Handler, /* 128 Inter-IC Sound Interface */
|
||||||
|
#else
|
||||||
|
.pvReserved128 = (void*) (0UL), /* 128 Reserved */
|
||||||
|
#endif
|
||||||
|
.pfnPCC_Handler = (void*) PCC_Handler, /* 129 Parallel Capture Controller */
|
||||||
|
.pfnAES_Handler = (void*) AES_Handler, /* 130 Advanced Encryption Standard */
|
||||||
|
.pfnTRNG_Handler = (void*) TRNG_Handler, /* 131 True Random Generator */
|
||||||
|
#ifdef ID_ICM
|
||||||
|
.pfnICM_Handler = (void*) ICM_Handler, /* 132 Integrity Check Monitor */
|
||||||
|
#else
|
||||||
|
.pvReserved132 = (void*) (0UL), /* 132 Reserved */
|
||||||
|
#endif
|
||||||
|
#ifdef ID_PUKCC
|
||||||
|
.pfnPUKCC_Handler = (void*) PUKCC_Handler, /* 133 PUblic-Key Cryptography Controller */
|
||||||
|
#else
|
||||||
|
.pvReserved133 = (void*) (0UL), /* 133 Reserved */
|
||||||
|
#endif
|
||||||
|
.pfnQSPI_Handler = (void*) QSPI_Handler, /* 134 Quad SPI interface */
|
||||||
|
#ifdef ID_SDHC0
|
||||||
|
.pfnSDHC0_Handler = (void*) SDHC0_Handler, /* 135 SD/MMC Host Controller 0 */
|
||||||
|
#else
|
||||||
|
.pvReserved135 = (void*) (0UL), /* 135 Reserved */
|
||||||
|
#endif
|
||||||
|
#ifdef ID_SDHC1
|
||||||
|
.pfnSDHC1_Handler = (void*) SDHC1_Handler /* 136 SD/MMC Host Controller 1 */
|
||||||
|
#else
|
||||||
|
.pvReserved136 = (void*) (0UL) /* 136 Reserved */
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief This is the code that gets called on processor reset.
|
||||||
|
* To initialize the device, and call the main() routine.
|
||||||
|
*/
|
||||||
|
void Reset_Handler(void)
|
||||||
|
{
|
||||||
|
uint32_t *pSrc, *pDest;
|
||||||
|
|
||||||
|
/* Initialize the relocate segment */
|
||||||
|
pSrc = &_etext;
|
||||||
|
pDest = &_srelocate;
|
||||||
|
|
||||||
|
if (pSrc != pDest) {
|
||||||
|
for (; pDest < &_erelocate;) {
|
||||||
|
*pDest++ = *pSrc++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Clear the zero segment */
|
||||||
|
for (pDest = &_szero; pDest < &_ezero;) {
|
||||||
|
*pDest++ = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set the vector table base address */
|
||||||
|
pSrc = (uint32_t *) & _sfixed;
|
||||||
|
SCB->VTOR = ((uint32_t) pSrc & SCB_VTOR_TBLOFF_Msk);
|
||||||
|
|
||||||
|
#if __FPU_USED
|
||||||
|
/* Enable FPU */
|
||||||
|
SCB->CPACR |= (0xFu << 20);
|
||||||
|
__DSB();
|
||||||
|
__ISB();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Initialize the C library */
|
||||||
|
__libc_init_array();
|
||||||
|
|
||||||
|
/* Branch to main function */
|
||||||
|
main();
|
||||||
|
|
||||||
|
/* Infinite loop */
|
||||||
|
while (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Default interrupt handler for unused IRQs.
|
||||||
|
*/
|
||||||
|
void Dummy_Handler(void)
|
||||||
|
{
|
||||||
|
while (1) {
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,64 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief Low-level initialization functions called upon chip startup.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 Microchip Technology Inc.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
* not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the Licence at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "same54.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initial system clock frequency. The System RC Oscillator (RCSYS) provides
|
||||||
|
* the source for the main clock at chip startup.
|
||||||
|
*/
|
||||||
|
#define __SYSTEM_CLOCK (48000000)
|
||||||
|
|
||||||
|
uint32_t SystemCoreClock = __SYSTEM_CLOCK;/*!< System Clock Frequency (Core Clock)*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the system
|
||||||
|
*
|
||||||
|
* @brief Setup the microcontroller system.
|
||||||
|
* Initialize the System and update the SystemCoreClock variable.
|
||||||
|
*/
|
||||||
|
void SystemInit(void)
|
||||||
|
{
|
||||||
|
// Keep the default device state after reset
|
||||||
|
SystemCoreClock = __SYSTEM_CLOCK;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update SystemCoreClock variable
|
||||||
|
*
|
||||||
|
* @brief Updates the SystemCoreClock with current core Clock
|
||||||
|
* retrieved from cpu registers.
|
||||||
|
*/
|
||||||
|
void SystemCoreClockUpdate(void)
|
||||||
|
{
|
||||||
|
// Not implemented
|
||||||
|
SystemCoreClock = __SYSTEM_CLOCK;
|
||||||
|
return;
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
#include <atmel_start.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes MCU, drivers and middleware in the project
|
||||||
|
**/
|
||||||
|
void atmel_start_init(void)
|
||||||
|
{
|
||||||
|
system_init();
|
||||||
|
stdio_redirect_init();
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
#ifndef ATMEL_START_H_INCLUDED
|
||||||
|
#define ATMEL_START_H_INCLUDED
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "driver_init.h"
|
||||||
|
#include "stdio_start.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes MCU, drivers and middleware in the project
|
||||||
|
**/
|
||||||
|
void atmel_start_init(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
|
@ -0,0 +1,37 @@
|
||||||
|
/*
|
||||||
|
* Code generated from Atmel Start.
|
||||||
|
*
|
||||||
|
* This file will be overwritten when reconfiguring your Atmel Start project.
|
||||||
|
* Please copy examples or other code you want to keep to a separate file
|
||||||
|
* to avoid losing it when reconfiguring.
|
||||||
|
*/
|
||||||
|
#ifndef ATMEL_START_PINS_H_INCLUDED
|
||||||
|
#define ATMEL_START_PINS_H_INCLUDED
|
||||||
|
|
||||||
|
#include <hal_gpio.h>
|
||||||
|
|
||||||
|
// SAME54 has 14 pin functions
|
||||||
|
|
||||||
|
#define GPIO_PIN_FUNCTION_A 0
|
||||||
|
#define GPIO_PIN_FUNCTION_B 1
|
||||||
|
#define GPIO_PIN_FUNCTION_C 2
|
||||||
|
#define GPIO_PIN_FUNCTION_D 3
|
||||||
|
#define GPIO_PIN_FUNCTION_E 4
|
||||||
|
#define GPIO_PIN_FUNCTION_F 5
|
||||||
|
#define GPIO_PIN_FUNCTION_G 6
|
||||||
|
#define GPIO_PIN_FUNCTION_H 7
|
||||||
|
#define GPIO_PIN_FUNCTION_I 8
|
||||||
|
#define GPIO_PIN_FUNCTION_J 9
|
||||||
|
#define GPIO_PIN_FUNCTION_K 10
|
||||||
|
#define GPIO_PIN_FUNCTION_L 11
|
||||||
|
#define GPIO_PIN_FUNCTION_M 12
|
||||||
|
#define GPIO_PIN_FUNCTION_N 13
|
||||||
|
|
||||||
|
#define UART_RX GPIO(GPIO_PORTB, 24)
|
||||||
|
#define UART_TX GPIO(GPIO_PORTB, 25)
|
||||||
|
#define SPI_SCK GPIO(GPIO_PORTB, 26)
|
||||||
|
#define SPI_MOSI GPIO(GPIO_PORTB, 27)
|
||||||
|
#define SPI_SS GPIO(GPIO_PORTB, 28)
|
||||||
|
#define SPI_MISO GPIO(GPIO_PORTB, 29)
|
||||||
|
|
||||||
|
#endif // ATMEL_START_PINS_H_INCLUDED
|
|
@ -0,0 +1,34 @@
|
||||||
|
STDIO redirection
|
||||||
|
=================
|
||||||
|
|
||||||
|
The STDIO redirection provides means to redirect standard input/output to HAL
|
||||||
|
IO.
|
||||||
|
|
||||||
|
On initialization, the HAL IO descriptor is assigned so that all input and
|
||||||
|
output is redirected to access it. The IO descriptor can also be changed
|
||||||
|
through stdio_io_set_io(). All stdin or stdout access is redirected to the
|
||||||
|
IO descriptor. When the IO descriptor is set to NULL, all input and output
|
||||||
|
are discarded.
|
||||||
|
|
||||||
|
For GCC redirection, the stdout and stdin buffer are turned off, the
|
||||||
|
standard _read() and _write() are overridden.
|
||||||
|
|
||||||
|
For IAR redirection, the __read() and __write() are overridden.
|
||||||
|
|
||||||
|
For Keil redirection, the Retarget.c are modified to override fputc(), fgetc(),
|
||||||
|
etc.
|
||||||
|
|
||||||
|
Features
|
||||||
|
--------
|
||||||
|
|
||||||
|
* Standard input/output redirection (e.g., printf to EDBG COM port)
|
||||||
|
|
||||||
|
Dependencies
|
||||||
|
------------
|
||||||
|
|
||||||
|
* HAL IO driver
|
||||||
|
|
||||||
|
Limitations
|
||||||
|
-----------
|
||||||
|
|
||||||
|
* IO read/write operation should be synchronous
|
|
@ -0,0 +1,118 @@
|
||||||
|
/*
|
||||||
|
* Code generated from Atmel Start.
|
||||||
|
*
|
||||||
|
* This file will be overwritten when reconfiguring your Atmel Start project.
|
||||||
|
* Please copy examples or other code you want to keep to a separate file
|
||||||
|
* to avoid losing it when reconfiguring.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "driver_init.h"
|
||||||
|
#include <peripheral_clk_config.h>
|
||||||
|
#include <utils.h>
|
||||||
|
#include <hal_init.h>
|
||||||
|
|
||||||
|
struct spi_m_sync_descriptor SPI_0;
|
||||||
|
|
||||||
|
struct usart_sync_descriptor TARGET_IO;
|
||||||
|
|
||||||
|
void TARGET_IO_PORT_init(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
gpio_set_pin_function(UART_TX, PINMUX_PB25D_SERCOM2_PAD0);
|
||||||
|
|
||||||
|
gpio_set_pin_function(UART_RX, PINMUX_PB24D_SERCOM2_PAD1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TARGET_IO_CLOCK_init(void)
|
||||||
|
{
|
||||||
|
hri_gclk_write_PCHCTRL_reg(GCLK, SERCOM2_GCLK_ID_CORE, CONF_GCLK_SERCOM2_CORE_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos));
|
||||||
|
hri_gclk_write_PCHCTRL_reg(GCLK, SERCOM2_GCLK_ID_SLOW, CONF_GCLK_SERCOM2_SLOW_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos));
|
||||||
|
|
||||||
|
hri_mclk_set_APBBMASK_SERCOM2_bit(MCLK);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TARGET_IO_init(void)
|
||||||
|
{
|
||||||
|
TARGET_IO_CLOCK_init();
|
||||||
|
usart_sync_init(&TARGET_IO, SERCOM2, (void *)NULL);
|
||||||
|
TARGET_IO_PORT_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SPI_0_PORT_init(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
gpio_set_pin_level(SPI_MOSI,
|
||||||
|
// <y> Initial level
|
||||||
|
// <id> pad_initial_level
|
||||||
|
// <false"> Low
|
||||||
|
// <true"> High
|
||||||
|
false);
|
||||||
|
|
||||||
|
// Set pin direction to output
|
||||||
|
gpio_set_pin_direction(SPI_MOSI, GPIO_DIRECTION_OUT);
|
||||||
|
|
||||||
|
gpio_set_pin_function(SPI_MOSI, PINMUX_PB27D_SERCOM4_PAD0);
|
||||||
|
|
||||||
|
gpio_set_pin_level(SPI_SCK,
|
||||||
|
// <y> Initial level
|
||||||
|
// <id> pad_initial_level
|
||||||
|
// <false"> Low
|
||||||
|
// <true"> High
|
||||||
|
false);
|
||||||
|
|
||||||
|
// Set pin direction to output
|
||||||
|
gpio_set_pin_direction(SPI_SCK, GPIO_DIRECTION_OUT);
|
||||||
|
|
||||||
|
gpio_set_pin_function(SPI_SCK, PINMUX_PB26D_SERCOM4_PAD1);
|
||||||
|
|
||||||
|
// Set pin direction to input
|
||||||
|
gpio_set_pin_direction(SPI_MISO, GPIO_DIRECTION_IN);
|
||||||
|
|
||||||
|
gpio_set_pin_pull_mode(SPI_MISO,
|
||||||
|
// <y> Pull configuration
|
||||||
|
// <id> pad_pull_config
|
||||||
|
// <GPIO_PULL_OFF"> Off
|
||||||
|
// <GPIO_PULL_UP"> Pull-up
|
||||||
|
// <GPIO_PULL_DOWN"> Pull-down
|
||||||
|
GPIO_PULL_OFF);
|
||||||
|
|
||||||
|
gpio_set_pin_function(SPI_MISO, PINMUX_PB29D_SERCOM4_PAD3);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SPI_0_CLOCK_init(void)
|
||||||
|
{
|
||||||
|
hri_gclk_write_PCHCTRL_reg(GCLK, SERCOM4_GCLK_ID_CORE, CONF_GCLK_SERCOM4_CORE_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos));
|
||||||
|
hri_gclk_write_PCHCTRL_reg(GCLK, SERCOM4_GCLK_ID_SLOW, CONF_GCLK_SERCOM4_SLOW_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos));
|
||||||
|
|
||||||
|
hri_mclk_set_APBDMASK_SERCOM4_bit(MCLK);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SPI_0_init(void)
|
||||||
|
{
|
||||||
|
SPI_0_CLOCK_init();
|
||||||
|
spi_m_sync_init(&SPI_0, SERCOM4);
|
||||||
|
SPI_0_PORT_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
void system_init(void)
|
||||||
|
{
|
||||||
|
init_mcu();
|
||||||
|
|
||||||
|
// GPIO on PB28
|
||||||
|
|
||||||
|
gpio_set_pin_level(SPI_SS,
|
||||||
|
// <y> Initial level
|
||||||
|
// <id> pad_initial_level
|
||||||
|
// <false"> Low
|
||||||
|
// <true"> High
|
||||||
|
true);
|
||||||
|
|
||||||
|
// Set pin direction to output
|
||||||
|
gpio_set_pin_direction(SPI_SS, GPIO_DIRECTION_OUT);
|
||||||
|
|
||||||
|
gpio_set_pin_function(SPI_SS, GPIO_PIN_FUNCTION_OFF);
|
||||||
|
|
||||||
|
TARGET_IO_init();
|
||||||
|
|
||||||
|
SPI_0_init();
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
/*
|
||||||
|
* Code generated from Atmel Start.
|
||||||
|
*
|
||||||
|
* This file will be overwritten when reconfiguring your Atmel Start project.
|
||||||
|
* Please copy examples or other code you want to keep to a separate file
|
||||||
|
* to avoid losing it when reconfiguring.
|
||||||
|
*/
|
||||||
|
#ifndef DRIVER_INIT_INCLUDED
|
||||||
|
#define DRIVER_INIT_INCLUDED
|
||||||
|
|
||||||
|
#include "atmel_start_pins.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <hal_atomic.h>
|
||||||
|
#include <hal_delay.h>
|
||||||
|
#include <hal_gpio.h>
|
||||||
|
#include <hal_init.h>
|
||||||
|
#include <hal_io.h>
|
||||||
|
#include <hal_sleep.h>
|
||||||
|
|
||||||
|
#include <hal_usart_sync.h>
|
||||||
|
#include <hal_spi_m_sync.h>
|
||||||
|
|
||||||
|
extern struct usart_sync_descriptor TARGET_IO;
|
||||||
|
extern struct spi_m_sync_descriptor SPI_0;
|
||||||
|
|
||||||
|
void TARGET_IO_PORT_init(void);
|
||||||
|
void TARGET_IO_CLOCK_init(void);
|
||||||
|
void TARGET_IO_init(void);
|
||||||
|
|
||||||
|
void SPI_0_PORT_init(void);
|
||||||
|
void SPI_0_CLOCK_init(void);
|
||||||
|
void SPI_0_init(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Perform system initialization, initialize pins and clocks for
|
||||||
|
* peripherals
|
||||||
|
*/
|
||||||
|
void system_init(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif // DRIVER_INIT_INCLUDED
|
|
@ -0,0 +1,37 @@
|
||||||
|
/*
|
||||||
|
* Code generated from Atmel Start.
|
||||||
|
*
|
||||||
|
* This file will be overwritten when reconfiguring your Atmel Start project.
|
||||||
|
* Please copy examples or other code you want to keep to a separate file
|
||||||
|
* to avoid losing it when reconfiguring.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "driver_examples.h"
|
||||||
|
#include "driver_init.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Example of using TARGET_IO to write "Hello World" using the IO abstraction.
|
||||||
|
*/
|
||||||
|
void TARGET_IO_example(void)
|
||||||
|
{
|
||||||
|
struct io_descriptor *io;
|
||||||
|
usart_sync_get_io_descriptor(&TARGET_IO, &io);
|
||||||
|
usart_sync_enable(&TARGET_IO);
|
||||||
|
|
||||||
|
io_write(io, (uint8_t *)"Hello World!", 12);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Example of using SPI_0 to write "Hello World" using the IO abstraction.
|
||||||
|
*/
|
||||||
|
static uint8_t example_SPI_0[12] = "Hello World!";
|
||||||
|
|
||||||
|
void SPI_0_example(void)
|
||||||
|
{
|
||||||
|
struct io_descriptor *io;
|
||||||
|
spi_m_sync_get_io_descriptor(&SPI_0, &io);
|
||||||
|
|
||||||
|
spi_m_sync_enable(&SPI_0);
|
||||||
|
io_write(io, example_SPI_0, 12);
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
/*
|
||||||
|
* Code generated from Atmel Start.
|
||||||
|
*
|
||||||
|
* This file will be overwritten when reconfiguring your Atmel Start project.
|
||||||
|
* Please copy examples or other code you want to keep to a separate file
|
||||||
|
* to avoid losing it when reconfiguring.
|
||||||
|
*/
|
||||||
|
#ifndef DRIVER_EXAMPLES_H_INCLUDED
|
||||||
|
#define DRIVER_EXAMPLES_H_INCLUDED
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void TARGET_IO_example(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif // DRIVER_EXAMPLES_H_INCLUDED
|
|
@ -0,0 +1,51 @@
|
||||||
|
The SPI Master Synchronous Driver
|
||||||
|
=================================
|
||||||
|
|
||||||
|
The serial peripheral interface (SPI) is a synchronous serial communication
|
||||||
|
interface.
|
||||||
|
|
||||||
|
SPI devices communicate in full duplex mode using a master-slave
|
||||||
|
architecture with a single master. The master device originates the frame for
|
||||||
|
reading and writing. Multiple slave devices are supported through selection
|
||||||
|
with individual slave select (SS) lines.
|
||||||
|
|
||||||
|
Features
|
||||||
|
--------
|
||||||
|
|
||||||
|
* Initialization/de-initialization
|
||||||
|
* Enabling/disabling
|
||||||
|
* Control of the following settings:
|
||||||
|
|
||||||
|
* Baudrate
|
||||||
|
* SPI mode
|
||||||
|
* Character size
|
||||||
|
* Data order
|
||||||
|
* Data transfer: transmission, reception and full-duplex
|
||||||
|
|
||||||
|
Applications
|
||||||
|
------------
|
||||||
|
|
||||||
|
Send/receive/exchange data with a SPI slave device. E.g., serial flash, SD card,
|
||||||
|
LCD controller, etc.
|
||||||
|
|
||||||
|
Dependencies
|
||||||
|
------------
|
||||||
|
|
||||||
|
SPI master capable hardware
|
||||||
|
|
||||||
|
Concurrency
|
||||||
|
-----------
|
||||||
|
|
||||||
|
N/A
|
||||||
|
|
||||||
|
Limitations
|
||||||
|
-----------
|
||||||
|
|
||||||
|
The slave select (SS) is not automatically inserted during read/write/transfer,
|
||||||
|
user must use I/O to control the devices' SS.
|
||||||
|
|
||||||
|
Known issues and workarounds
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
N/A
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
The USART Synchronous Driver
|
||||||
|
============================
|
||||||
|
|
||||||
|
The universal synchronous and asynchronous receiver and transmitter
|
||||||
|
(USART) is usually used to transfer data from one device to the other.
|
||||||
|
|
||||||
|
User can set action for flow control pins by function usart_set_flow_control,
|
||||||
|
if the flow control is enabled. All the available states are defined in union
|
||||||
|
usart_flow_control_state.
|
||||||
|
|
||||||
|
Note that user can set state of flow control pins only if automatic support of
|
||||||
|
the flow control is not supported by the hardware.
|
||||||
|
|
||||||
|
Features
|
||||||
|
--------
|
||||||
|
|
||||||
|
* Initialization/de-initialization
|
||||||
|
* Enabling/disabling
|
||||||
|
* Control of the following settings:
|
||||||
|
|
||||||
|
* Baudrate
|
||||||
|
* UART or USRT communication mode
|
||||||
|
* Character size
|
||||||
|
* Data order
|
||||||
|
* Flow control
|
||||||
|
* Data transfer: transmission, reception
|
||||||
|
|
||||||
|
Applications
|
||||||
|
------------
|
||||||
|
|
||||||
|
They are commonly used in a terminal application or low-speed communication
|
||||||
|
between devices.
|
||||||
|
|
||||||
|
Dependencies
|
||||||
|
------------
|
||||||
|
|
||||||
|
USART capable hardware.
|
||||||
|
|
||||||
|
Concurrency
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Write buffer should not be changed while data is being sent.
|
||||||
|
|
||||||
|
|
||||||
|
Limitations
|
||||||
|
-----------
|
||||||
|
|
||||||
|
* The driver does not support 9-bit character size.
|
||||||
|
* The "USART with ISO7816" mode can be only used in ISO7816 capable devices.
|
||||||
|
And the SCK pin can't be set directly. Application can use a GCLK output PIN
|
||||||
|
to generate SCK. For example to communicate with a SMARTCARD with ISO7816
|
||||||
|
(F = 372 ; D = 1), and baudrate=9600, the SCK pin output frequency should be
|
||||||
|
config as 372*9600=3571200Hz. More information can be refer to ISO7816 Specification.
|
||||||
|
|
||||||
|
Known issues and workarounds
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
N/A
|
|
@ -0,0 +1,120 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief Critical sections related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HAL_ATOMIC_H_INCLUDED
|
||||||
|
#define _HAL_ATOMIC_H_INCLUDED
|
||||||
|
|
||||||
|
#include <compiler.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup doc_driver_hal_helper_atomic
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Type for the register holding global interrupt enable flag
|
||||||
|
*/
|
||||||
|
typedef uint32_t hal_atomic_t;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Helper macro for entering critical sections
|
||||||
|
*
|
||||||
|
* This macro is recommended to be used instead of a direct call
|
||||||
|
* hal_enterCritical() function to enter critical
|
||||||
|
* sections. No semicolon is required after the macro.
|
||||||
|
*
|
||||||
|
* \section atomic_usage Usage Example
|
||||||
|
* \code
|
||||||
|
* CRITICAL_SECTION_ENTER()
|
||||||
|
* Critical code
|
||||||
|
* CRITICAL_SECTION_LEAVE()
|
||||||
|
* \endcode
|
||||||
|
*/
|
||||||
|
#define CRITICAL_SECTION_ENTER() \
|
||||||
|
{ \
|
||||||
|
volatile hal_atomic_t __atomic; \
|
||||||
|
atomic_enter_critical(&__atomic);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Helper macro for leaving critical sections
|
||||||
|
*
|
||||||
|
* This macro is recommended to be used instead of a direct call
|
||||||
|
* hal_leaveCritical() function to leave critical
|
||||||
|
* sections. No semicolon is required after the macro.
|
||||||
|
*/
|
||||||
|
#define CRITICAL_SECTION_LEAVE() \
|
||||||
|
atomic_leave_critical(&__atomic); \
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Disable interrupts, enter critical section
|
||||||
|
*
|
||||||
|
* Disables global interrupts. Supports nested critical sections,
|
||||||
|
* so that global interrupts are only re-enabled
|
||||||
|
* upon leaving the outermost nested critical section.
|
||||||
|
*
|
||||||
|
* \param[out] atomic The pointer to a variable to store the value of global
|
||||||
|
* interrupt enable flag
|
||||||
|
*/
|
||||||
|
void atomic_enter_critical(hal_atomic_t volatile *atomic);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Exit atomic section
|
||||||
|
*
|
||||||
|
* Enables global interrupts. Supports nested critical sections,
|
||||||
|
* so that global interrupts are only re-enabled
|
||||||
|
* upon leaving the outermost nested critical section.
|
||||||
|
*
|
||||||
|
* \param[in] atomic The pointer to a variable, which stores the latest stored
|
||||||
|
* value of the global interrupt enable flag
|
||||||
|
*/
|
||||||
|
void atomic_leave_critical(hal_atomic_t volatile *atomic);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieve the current driver version
|
||||||
|
*
|
||||||
|
* \return Current driver version.
|
||||||
|
*/
|
||||||
|
uint32_t atomic_get_version(void);
|
||||||
|
/**@}*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _HAL_ATOMIC_H_INCLUDED */
|
|
@ -0,0 +1,96 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief HAL cache functionality implementation.
|
||||||
|
*
|
||||||
|
* Copyright (c)2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef HAL_CACHE_H_
|
||||||
|
#define HAL_CACHE_H_
|
||||||
|
|
||||||
|
#include <hpl_cmcc.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable cache module
|
||||||
|
*
|
||||||
|
* \param[in] pointer pointing to the starting address of cache module
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t cache_enable(const void *hw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Disable cache module
|
||||||
|
*
|
||||||
|
* \param[in] pointer pointing to the starting address of cache module
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t cache_disable(const void *hw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize cache module
|
||||||
|
*
|
||||||
|
* This function initialize cache module configuration.
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t cache_init(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Configure cache module
|
||||||
|
*
|
||||||
|
* \param[in] pointer pointing to the starting address of cache module
|
||||||
|
* \param[in] cache configuration structure pointer
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t cache_configure(const void *hw, struct _cache_cfg *cache);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Invalidate entire cache entries
|
||||||
|
*
|
||||||
|
* \param[in] pointer pointing to the starting address of cache module
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t cache_invalidate_all(const void *hw);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* HAL_CACHE_H_ */
|
|
@ -0,0 +1,89 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief HAL delay related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <hpl_irq.h>
|
||||||
|
#include <hpl_reset.h>
|
||||||
|
#include <hpl_sleep.h>
|
||||||
|
|
||||||
|
#ifndef _HAL_DELAY_H_INCLUDED
|
||||||
|
#define _HAL_DELAY_H_INCLUDED
|
||||||
|
|
||||||
|
#include <compiler.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup doc_driver_hal_delay Delay Driver
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize Delay driver
|
||||||
|
*
|
||||||
|
* \param[in] hw The pointer to hardware instance
|
||||||
|
*/
|
||||||
|
void delay_init(void *const hw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Perform delay in us
|
||||||
|
*
|
||||||
|
* This function performs delay for the given amount of microseconds.
|
||||||
|
*
|
||||||
|
* \param[in] us The amount delay in us
|
||||||
|
*/
|
||||||
|
void delay_us(const uint16_t us);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Perform delay in ms
|
||||||
|
*
|
||||||
|
* This function performs delay for the given amount of milliseconds.
|
||||||
|
*
|
||||||
|
* \param[in] ms The amount delay in ms
|
||||||
|
*/
|
||||||
|
void delay_ms(const uint16_t ms);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieve the current driver version
|
||||||
|
*
|
||||||
|
* \return Current driver version.
|
||||||
|
*/
|
||||||
|
uint32_t delay_get_version(void);
|
||||||
|
|
||||||
|
/**@}*/
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif /* _HAL_DELAY_H_INCLUDED */
|
|
@ -0,0 +1,201 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief Port
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*/
|
||||||
|
#ifndef _HAL_GPIO_INCLUDED_
|
||||||
|
#define _HAL_GPIO_INCLUDED_
|
||||||
|
|
||||||
|
#include <hpl_gpio.h>
|
||||||
|
#include <utils_assert.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set gpio pull mode
|
||||||
|
*
|
||||||
|
* Set pin pull mode, non existing pull modes throws an fatal assert
|
||||||
|
*
|
||||||
|
* \param[in] pin The pin number for device
|
||||||
|
* \param[in] pull_mode GPIO_PULL_DOWN = Pull pin low with internal resistor
|
||||||
|
* GPIO_PULL_UP = Pull pin high with internal resistor
|
||||||
|
* GPIO_PULL_OFF = Disable pin pull mode
|
||||||
|
*/
|
||||||
|
static inline void gpio_set_pin_pull_mode(const uint8_t pin, const enum gpio_pull_mode pull_mode)
|
||||||
|
{
|
||||||
|
_gpio_set_pin_pull_mode((enum gpio_port)GPIO_PORT(pin), pin & 0x1F, pull_mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set pin function
|
||||||
|
*
|
||||||
|
* Select which function a pin will be used for
|
||||||
|
*
|
||||||
|
* \param[in] pin The pin number for device
|
||||||
|
* \param[in] function The pin function is given by a 32-bit wide bitfield
|
||||||
|
* found in the header files for the device
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
static inline void gpio_set_pin_function(const uint32_t pin, uint32_t function)
|
||||||
|
{
|
||||||
|
_gpio_set_pin_function(pin, function);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set port data direction
|
||||||
|
*
|
||||||
|
* Select if the pin data direction is input, output or disabled.
|
||||||
|
* If disabled state is not possible, this function throws an assert.
|
||||||
|
*
|
||||||
|
* \param[in] port Ports are grouped into groups of maximum 32 pins,
|
||||||
|
* GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
|
||||||
|
* \param[in] mask Bit mask where 1 means apply direction setting to the
|
||||||
|
* corresponding pin
|
||||||
|
* \param[in] direction GPIO_DIRECTION_IN = Data direction in
|
||||||
|
* GPIO_DIRECTION_OUT = Data direction out
|
||||||
|
* GPIO_DIRECTION_OFF = Disables the pin
|
||||||
|
* (low power state)
|
||||||
|
*/
|
||||||
|
static inline void gpio_set_port_direction(const enum gpio_port port, const uint32_t mask,
|
||||||
|
const enum gpio_direction direction)
|
||||||
|
{
|
||||||
|
_gpio_set_direction(port, mask, direction);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set gpio data direction
|
||||||
|
*
|
||||||
|
* Select if the pin data direction is input, output or disabled.
|
||||||
|
* If disabled state is not possible, this function throws an assert.
|
||||||
|
*
|
||||||
|
* \param[in] pin The pin number for device
|
||||||
|
* \param[in] direction GPIO_DIRECTION_IN = Data direction in
|
||||||
|
* GPIO_DIRECTION_OUT = Data direction out
|
||||||
|
* GPIO_DIRECTION_OFF = Disables the pin
|
||||||
|
* (low power state)
|
||||||
|
*/
|
||||||
|
static inline void gpio_set_pin_direction(const uint8_t pin, const enum gpio_direction direction)
|
||||||
|
{
|
||||||
|
_gpio_set_direction((enum gpio_port)GPIO_PORT(pin), 1U << GPIO_PIN(pin), direction);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set port level
|
||||||
|
*
|
||||||
|
* Sets output level on the pins defined by the bit mask
|
||||||
|
*
|
||||||
|
* \param[in] port Ports are grouped into groups of maximum 32 pins,
|
||||||
|
* GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
|
||||||
|
* \param[in] mask Bit mask where 1 means apply port level to the corresponding
|
||||||
|
* pin
|
||||||
|
* \param[in] level true = Pin levels set to "high" state
|
||||||
|
* false = Pin levels set to "low" state
|
||||||
|
*/
|
||||||
|
static inline void gpio_set_port_level(const enum gpio_port port, const uint32_t mask, const bool level)
|
||||||
|
{
|
||||||
|
_gpio_set_level(port, mask, level);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set gpio level
|
||||||
|
*
|
||||||
|
* Sets output level on a pin
|
||||||
|
*
|
||||||
|
* \param[in] pin The pin number for device
|
||||||
|
* \param[in] level true = Pin level set to "high" state
|
||||||
|
* false = Pin level set to "low" state
|
||||||
|
*/
|
||||||
|
static inline void gpio_set_pin_level(const uint8_t pin, const bool level)
|
||||||
|
{
|
||||||
|
_gpio_set_level((enum gpio_port)GPIO_PORT(pin), 1U << GPIO_PIN(pin), level);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Toggle out level on pins
|
||||||
|
*
|
||||||
|
* Toggle the pin levels on pins defined by bit mask
|
||||||
|
*
|
||||||
|
* \param[in] port Ports are grouped into groups of maximum 32 pins,
|
||||||
|
* GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
|
||||||
|
* \param[in] mask Bit mask where 1 means toggle pin level to the corresponding
|
||||||
|
* pin
|
||||||
|
*/
|
||||||
|
static inline void gpio_toggle_port_level(const enum gpio_port port, const uint32_t mask)
|
||||||
|
{
|
||||||
|
_gpio_toggle_level(port, mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Toggle output level on pin
|
||||||
|
*
|
||||||
|
* Toggle the pin levels on pins defined by bit mask
|
||||||
|
*
|
||||||
|
* \param[in] pin The pin number for device
|
||||||
|
*/
|
||||||
|
static inline void gpio_toggle_pin_level(const uint8_t pin)
|
||||||
|
{
|
||||||
|
_gpio_toggle_level((enum gpio_port)GPIO_PORT(pin), 1U << GPIO_PIN(pin));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Get input level on pins
|
||||||
|
*
|
||||||
|
* Read the input level on pins connected to a port
|
||||||
|
*
|
||||||
|
* \param[in] port Ports are grouped into groups of maximum 32 pins,
|
||||||
|
* GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
|
||||||
|
*/
|
||||||
|
static inline uint32_t gpio_get_port_level(const enum gpio_port port)
|
||||||
|
{
|
||||||
|
return _gpio_get_level(port);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Get level on pin
|
||||||
|
*
|
||||||
|
* Reads the level on pins connected to a port
|
||||||
|
*
|
||||||
|
* \param[in] pin The pin number for device
|
||||||
|
*/
|
||||||
|
static inline bool gpio_get_pin_level(const uint8_t pin)
|
||||||
|
{
|
||||||
|
return (bool)(_gpio_get_level((enum gpio_port)GPIO_PORT(pin)) & (0x01U << GPIO_PIN(pin)));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* \brief Get current driver version
|
||||||
|
*/
|
||||||
|
uint32_t gpio_get_version(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,72 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief HAL initialization related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HAL_INIT_H_INCLUDED
|
||||||
|
#define _HAL_INIT_H_INCLUDED
|
||||||
|
|
||||||
|
#include <hpl_init.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup doc_driver_hal_helper_init Init Driver
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize the hardware abstraction layer
|
||||||
|
*
|
||||||
|
* This function calls the various initialization functions.
|
||||||
|
* Currently the following initialization functions are supported:
|
||||||
|
* - System clock initialization
|
||||||
|
*/
|
||||||
|
static inline void init_mcu(void)
|
||||||
|
{
|
||||||
|
_init_chip();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieve the current driver version
|
||||||
|
*
|
||||||
|
* \return Current driver version.
|
||||||
|
*/
|
||||||
|
uint32_t init_get_version(void);
|
||||||
|
|
||||||
|
/**@}*/
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif /* _HAL_INIT_H_INCLUDED */
|
|
@ -0,0 +1,110 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief I/O related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HAL_IO_INCLUDED
|
||||||
|
#define _HAL_IO_INCLUDED
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup doc_driver_hal_helper_io I/O Driver
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <compiler.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief I/O descriptor
|
||||||
|
*
|
||||||
|
* The I/O descriptor forward declaration.
|
||||||
|
*/
|
||||||
|
struct io_descriptor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief I/O write function pointer type
|
||||||
|
*/
|
||||||
|
typedef int32_t (*io_write_t)(struct io_descriptor *const io_descr, const uint8_t *const buf, const uint16_t length);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief I/O read function pointer type
|
||||||
|
*/
|
||||||
|
typedef int32_t (*io_read_t)(struct io_descriptor *const io_descr, uint8_t *const buf, const uint16_t length);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief I/O descriptor
|
||||||
|
*/
|
||||||
|
struct io_descriptor {
|
||||||
|
io_write_t write; /*! The write function pointer. */
|
||||||
|
io_read_t read; /*! The read function pointer. */
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief I/O write interface
|
||||||
|
*
|
||||||
|
* This function writes up to \p length of bytes to a given I/O descriptor.
|
||||||
|
* It returns the number of bytes actually write.
|
||||||
|
*
|
||||||
|
* \param[in] descr An I/O descriptor to write
|
||||||
|
* \param[in] buf The buffer pointer to story the write data
|
||||||
|
* \param[in] length The number of bytes to write
|
||||||
|
*
|
||||||
|
* \return The number of bytes written
|
||||||
|
*/
|
||||||
|
int32_t io_write(struct io_descriptor *const io_descr, const uint8_t *const buf, const uint16_t length);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief I/O read interface
|
||||||
|
*
|
||||||
|
* This function reads up to \p length bytes from a given I/O descriptor, and
|
||||||
|
* stores it in the buffer pointed to by \p buf. It returns the number of bytes
|
||||||
|
* actually read.
|
||||||
|
*
|
||||||
|
* \param[in] descr An I/O descriptor to read
|
||||||
|
* \param[in] buf The buffer pointer to story the read data
|
||||||
|
* \param[in] length The number of bytes to read
|
||||||
|
*
|
||||||
|
* \return The number of bytes actually read. This number can be less than the
|
||||||
|
* requested length. E.g., in a driver that uses ring buffer for
|
||||||
|
* reception, it may depend on the availability of data in the
|
||||||
|
* ring buffer.
|
||||||
|
*/
|
||||||
|
int32_t io_read(struct io_descriptor *const io_descr, uint8_t *const buf, const uint16_t length);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/**@}*/
|
||||||
|
#endif /* _HAL_IO_INCLUDED */
|
|
@ -0,0 +1,74 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief Sleep related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HAL_SLEEP_H_INCLUDED
|
||||||
|
#define _HAL_SLEEP_H_INCLUDED
|
||||||
|
|
||||||
|
#include <hpl_sleep.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup doc_driver_hal_helper_sleep
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set the sleep mode of the device and put the MCU to sleep
|
||||||
|
*
|
||||||
|
* For an overview of which systems are disabled in sleep for the different
|
||||||
|
* sleep modes, see the data sheet.
|
||||||
|
*
|
||||||
|
* \param[in] mode Sleep mode to use
|
||||||
|
*
|
||||||
|
* \return The status of a sleep request
|
||||||
|
* \retval -1 The requested sleep mode was invalid or not available
|
||||||
|
* \retval 0 The operation completed successfully, returned after leaving the
|
||||||
|
* sleep
|
||||||
|
*/
|
||||||
|
int sleep(const uint8_t mode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieve the current driver version
|
||||||
|
*
|
||||||
|
* \return Current driver version.
|
||||||
|
*/
|
||||||
|
uint32_t sleep_get_version(void);
|
||||||
|
/**@}*/
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif /* _HAL_SLEEP_H_INCLUDED */
|
|
@ -0,0 +1,221 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief SPI related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HAL_SPI_M_SYNC_H_INCLUDED
|
||||||
|
#define _HAL_SPI_M_SYNC_H_INCLUDED
|
||||||
|
|
||||||
|
#include <hal_io.h>
|
||||||
|
#include <hpl_spi_m_sync.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup doc_driver_hal_spi_master_sync
|
||||||
|
*
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** \brief SPI HAL driver struct for polling mode
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
struct spi_m_sync_descriptor {
|
||||||
|
struct _spi_m_sync_hpl_interface *func;
|
||||||
|
/** SPI device instance */
|
||||||
|
struct _spi_sync_dev dev;
|
||||||
|
/** I/O read/write */
|
||||||
|
struct io_descriptor io;
|
||||||
|
/** Flags for HAL driver */
|
||||||
|
uint16_t flags;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** \brief Set the SPI HAL instance function pointer for HPL APIs.
|
||||||
|
*
|
||||||
|
* Set SPI HAL instance function pointer for HPL APIs.
|
||||||
|
*
|
||||||
|
* \param[in] spi Pointer to the HAL SPI instance.
|
||||||
|
* \param[in] func Pointer to the HPL api structure.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void spi_m_sync_set_func_ptr(struct spi_m_sync_descriptor *spi, void *const func);
|
||||||
|
|
||||||
|
/** \brief Initialize SPI HAL instance and hardware for polling mode
|
||||||
|
*
|
||||||
|
* Initialize SPI HAL with polling mode.
|
||||||
|
*
|
||||||
|
* \param[in] spi Pointer to the HAL SPI instance.
|
||||||
|
* \param[in] hw Pointer to the hardware base.
|
||||||
|
*
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_NONE Success.
|
||||||
|
* \retval ERR_INVALID_DATA Error, initialized.
|
||||||
|
*/
|
||||||
|
int32_t spi_m_sync_init(struct spi_m_sync_descriptor *spi, void *const hw);
|
||||||
|
|
||||||
|
/** \brief Deinitialize the SPI HAL instance and hardware
|
||||||
|
*
|
||||||
|
* Abort transfer, disable and reset SPI, deinit software.
|
||||||
|
*
|
||||||
|
* \param[in] spi Pointer to the HAL SPI instance.
|
||||||
|
*
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_NONE Success.
|
||||||
|
* \retval <0 Error code.
|
||||||
|
*/
|
||||||
|
void spi_m_sync_deinit(struct spi_m_sync_descriptor *spi);
|
||||||
|
|
||||||
|
/** \brief Enable SPI
|
||||||
|
*
|
||||||
|
* \param[in] spi Pointer to the HAL SPI instance.
|
||||||
|
*
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_NONE Success.
|
||||||
|
* \retval <0 Error code.
|
||||||
|
*/
|
||||||
|
void spi_m_sync_enable(struct spi_m_sync_descriptor *spi);
|
||||||
|
|
||||||
|
/** \brief Disable SPI
|
||||||
|
*
|
||||||
|
* \param[in] spi Pointer to the HAL SPI instance.
|
||||||
|
*
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_NONE Success.
|
||||||
|
* \retval <0 Error code.
|
||||||
|
*/
|
||||||
|
void spi_m_sync_disable(struct spi_m_sync_descriptor *spi);
|
||||||
|
|
||||||
|
/** \brief Set SPI baudrate
|
||||||
|
*
|
||||||
|
* Works if SPI is initialized as master, it sets the baudrate.
|
||||||
|
*
|
||||||
|
* \param[in] spi Pointer to the HAL SPI instance.
|
||||||
|
* \param[in] baud_val The target baudrate value
|
||||||
|
* (see "baudrate calculation" for calculating the value).
|
||||||
|
*
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_NONE Success.
|
||||||
|
* \retval ERR_BUSY Busy
|
||||||
|
* \retval ERR_INVALID_ARG The baudrate is not supported.
|
||||||
|
*/
|
||||||
|
int32_t spi_m_sync_set_baudrate(struct spi_m_sync_descriptor *spi, const uint32_t baud_val);
|
||||||
|
|
||||||
|
/** \brief Set SPI mode
|
||||||
|
*
|
||||||
|
* Set the SPI transfer mode (\ref spi_transfer_mode),
|
||||||
|
* which controls the clock polarity and clock phase:
|
||||||
|
* - Mode 0: leading edge is rising edge, data sample on leading edge.
|
||||||
|
* - Mode 1: leading edge is rising edge, data sample on trailing edge.
|
||||||
|
* - Mode 2: leading edge is falling edge, data sample on leading edge.
|
||||||
|
* - Mode 3: leading edge is falling edge, data sample on trailing edge.
|
||||||
|
*
|
||||||
|
* \param[in] spi Pointer to the HAL SPI instance.
|
||||||
|
* \param[in] mode The mode (0~3).
|
||||||
|
*
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_NONE Success.
|
||||||
|
* \retval ERR_BUSY Busy
|
||||||
|
* \retval ERR_INVALID_ARG The mode is not supported.
|
||||||
|
*/
|
||||||
|
int32_t spi_m_sync_set_mode(struct spi_m_sync_descriptor *spi, const enum spi_transfer_mode mode);
|
||||||
|
|
||||||
|
/** \brief Set SPI transfer character size in number of bits
|
||||||
|
*
|
||||||
|
* The character size (\ref spi_char_size) influence the way the data is
|
||||||
|
* sent/received.
|
||||||
|
* For char size <= 8-bit, data is stored byte by byte.
|
||||||
|
* For char size between 9-bit ~ 16-bit, data is stored in 2-byte length.
|
||||||
|
* Note that the default and recommended char size is 8-bit since it's
|
||||||
|
* supported by all system.
|
||||||
|
*
|
||||||
|
* \param[in] spi Pointer to the HAL SPI instance.
|
||||||
|
* \param[in] char_size The char size (~16, recommended 8).
|
||||||
|
*
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_NONE Success.
|
||||||
|
* \retval ERR_BUSY Busy
|
||||||
|
* \retval ERR_INVALID_ARG The char size is not supported.
|
||||||
|
*/
|
||||||
|
int32_t spi_m_sync_set_char_size(struct spi_m_sync_descriptor *spi, const enum spi_char_size char_size);
|
||||||
|
|
||||||
|
/** \brief Set SPI transfer data order
|
||||||
|
*
|
||||||
|
* \param[in] spi Pointer to the HAL SPI instance.
|
||||||
|
* \param[in] dord The data order: send LSB/MSB first.
|
||||||
|
*
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_NONE Success.
|
||||||
|
* \retval ERR_BUSY Busy
|
||||||
|
* \retval ERR_INVALID_ARG The data order is not supported.
|
||||||
|
*/
|
||||||
|
int32_t spi_m_sync_set_data_order(struct spi_m_sync_descriptor *spi, const enum spi_data_order dord);
|
||||||
|
|
||||||
|
/** \brief Perform the SPI data transfer (TX and RX) in polling way
|
||||||
|
*
|
||||||
|
* Activate CS, do TX and RX and deactivate CS. It blocks.
|
||||||
|
*
|
||||||
|
* \param[in, out] spi Pointer to the HAL SPI instance.
|
||||||
|
* \param[in] xfer Pointer to the transfer information (\ref spi_xfer).
|
||||||
|
*
|
||||||
|
* \retval size Success.
|
||||||
|
* \retval >=0 Timeout, with number of characters transferred.
|
||||||
|
* \retval ERR_BUSY SPI is busy
|
||||||
|
*/
|
||||||
|
int32_t spi_m_sync_transfer(struct spi_m_sync_descriptor *spi, const struct spi_xfer *xfer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Return the I/O descriptor for this SPI instance
|
||||||
|
*
|
||||||
|
* This function will return an I/O instance for this SPI driver instance.
|
||||||
|
*
|
||||||
|
* \param[in] spi An SPI master descriptor, which is used to communicate through
|
||||||
|
* SPI
|
||||||
|
* \param[in, out] io A pointer to an I/O descriptor pointer type
|
||||||
|
*
|
||||||
|
* \retval ERR_NONE
|
||||||
|
*/
|
||||||
|
int32_t spi_m_sync_get_io_descriptor(struct spi_m_sync_descriptor *const spi, struct io_descriptor **io);
|
||||||
|
|
||||||
|
/** \brief Retrieve the current driver version
|
||||||
|
*
|
||||||
|
* \return Current driver version.
|
||||||
|
*/
|
||||||
|
uint32_t spi_m_sync_get_version(void);
|
||||||
|
|
||||||
|
/**@}*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* ifndef _HAL_SPI_M_SYNC_H_INCLUDED */
|
|
@ -0,0 +1,247 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief USART related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HAL_SYNC_USART_H_INCLUDED
|
||||||
|
#define _HAL_SYNC_USART_H_INCLUDED
|
||||||
|
|
||||||
|
#include "hal_io.h"
|
||||||
|
#include <hpl_usart_sync.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup doc_driver_hal_usart_sync
|
||||||
|
*
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Synchronous USART descriptor
|
||||||
|
*/
|
||||||
|
struct usart_sync_descriptor {
|
||||||
|
struct io_descriptor io;
|
||||||
|
struct _usart_sync_device device;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize USART interface
|
||||||
|
*
|
||||||
|
* This function initializes the given I/O descriptor to be used
|
||||||
|
* as USART interface descriptor.
|
||||||
|
* It checks if the given hardware is not initialized and
|
||||||
|
* if the given hardware is permitted to be initialized.
|
||||||
|
*
|
||||||
|
* \param[out] descr A USART descriptor which is used to communicate via USART
|
||||||
|
* \param[in] hw The pointer to hardware instance
|
||||||
|
* \param[in] func The pointer to as set of functions pointers
|
||||||
|
*
|
||||||
|
* \return Initialization status.
|
||||||
|
*/
|
||||||
|
int32_t usart_sync_init(struct usart_sync_descriptor *const descr, void *const hw, void *const func);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Deinitialize USART interface
|
||||||
|
*
|
||||||
|
* This function deinitializes the given I/O descriptor.
|
||||||
|
* It checks if the given hardware is initialized and
|
||||||
|
* if the given hardware is permitted to be deinitialized.
|
||||||
|
*
|
||||||
|
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||||
|
*
|
||||||
|
* \return De-initialization status.
|
||||||
|
*/
|
||||||
|
int32_t usart_sync_deinit(struct usart_sync_descriptor *const descr);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable USART interface
|
||||||
|
*
|
||||||
|
* Enables the USART interface
|
||||||
|
*
|
||||||
|
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||||
|
*
|
||||||
|
* \return Enabling status.
|
||||||
|
*/
|
||||||
|
int32_t usart_sync_enable(struct usart_sync_descriptor *const descr);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Disable USART interface
|
||||||
|
*
|
||||||
|
* Disables the USART interface
|
||||||
|
*
|
||||||
|
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||||
|
*
|
||||||
|
* \return Disabling status.
|
||||||
|
*/
|
||||||
|
int32_t usart_sync_disable(struct usart_sync_descriptor *const descr);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieve I/O descriptor
|
||||||
|
*
|
||||||
|
* This function retrieves the I/O descriptor of the given USART descriptor.
|
||||||
|
*
|
||||||
|
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||||
|
* \param[out] io An I/O descriptor to retrieve
|
||||||
|
*
|
||||||
|
* \return The status of the I/O descriptor retrieving.
|
||||||
|
*/
|
||||||
|
int32_t usart_sync_get_io_descriptor(struct usart_sync_descriptor *const descr, struct io_descriptor **io);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Specify action for flow control pins
|
||||||
|
*
|
||||||
|
* This function sets the action (or state) for the flow control pins
|
||||||
|
* if the flow control is enabled.
|
||||||
|
* It sets the state of flow control pins only if the automatic support of
|
||||||
|
* the flow control is not supported by the hardware.
|
||||||
|
*
|
||||||
|
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||||
|
* \param[in] state A state to set the flow control pins
|
||||||
|
*
|
||||||
|
* \return The status of flow control action setup.
|
||||||
|
*/
|
||||||
|
int32_t usart_sync_set_flow_control(struct usart_sync_descriptor *const descr,
|
||||||
|
const union usart_flow_control_state state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set USART baud rate
|
||||||
|
*
|
||||||
|
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||||
|
* \param[in] baud_rate A baud rate to set
|
||||||
|
*
|
||||||
|
* \return The status of baud rate setting.
|
||||||
|
*/
|
||||||
|
int32_t usart_sync_set_baud_rate(struct usart_sync_descriptor *const descr, const uint32_t baud_rate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set USART data order
|
||||||
|
*
|
||||||
|
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||||
|
* \param[in] data_order A data order to set
|
||||||
|
*
|
||||||
|
* \return The status of data order setting.
|
||||||
|
*/
|
||||||
|
int32_t usart_sync_set_data_order(struct usart_sync_descriptor *const descr, const enum usart_data_order data_order);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set USART mode
|
||||||
|
*
|
||||||
|
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||||
|
* \param[in] mode A mode to set
|
||||||
|
*
|
||||||
|
* \return The status of mode setting.
|
||||||
|
*/
|
||||||
|
int32_t usart_sync_set_mode(struct usart_sync_descriptor *const descr, const enum usart_mode mode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set USART parity
|
||||||
|
*
|
||||||
|
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||||
|
* \param[in] parity A parity to set
|
||||||
|
*
|
||||||
|
* \return The status of parity setting.
|
||||||
|
*/
|
||||||
|
int32_t usart_sync_set_parity(struct usart_sync_descriptor *const descr, const enum usart_parity parity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set USART stop bits
|
||||||
|
*
|
||||||
|
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||||
|
* \param[in] stop_bits Stop bits to set
|
||||||
|
*
|
||||||
|
* \return The status of stop bits setting.
|
||||||
|
*/
|
||||||
|
int32_t usart_sync_set_stopbits(struct usart_sync_descriptor *const descr, const enum usart_stop_bits stop_bits);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set USART character size
|
||||||
|
*
|
||||||
|
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||||
|
* \param[in] size A character size to set
|
||||||
|
*
|
||||||
|
* \return The status of character size setting.
|
||||||
|
*/
|
||||||
|
int32_t usart_sync_set_character_size(struct usart_sync_descriptor *const descr, const enum usart_character_size size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieve the state of flow control pins
|
||||||
|
*
|
||||||
|
* This function retrieves the of flow control pins
|
||||||
|
* if the flow control is enabled.
|
||||||
|
* Function can return USART_FLOW_CONTROL_STATE_UNAVAILABLE in case
|
||||||
|
* if the flow control is done by the hardware
|
||||||
|
* and the pins state cannot be read out.
|
||||||
|
*
|
||||||
|
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||||
|
* \param[out] state The state of flow control pins
|
||||||
|
*
|
||||||
|
* \return The status of flow control state reading.
|
||||||
|
*/
|
||||||
|
int32_t usart_sync_flow_control_status(const struct usart_sync_descriptor *const descr,
|
||||||
|
union usart_flow_control_state *const state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Check if the USART transmitter is empty
|
||||||
|
*
|
||||||
|
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||||
|
*
|
||||||
|
* \return The status of USART TX empty checking.
|
||||||
|
* \retval 0 The USART transmitter is not empty
|
||||||
|
* \retval 1 The USART transmitter is empty
|
||||||
|
*/
|
||||||
|
int32_t usart_sync_is_tx_empty(const struct usart_sync_descriptor *const descr);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Check if the USART receiver is not empty
|
||||||
|
*
|
||||||
|
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||||
|
*
|
||||||
|
* \return The status of USART RX empty checking.
|
||||||
|
* \retval 1 The USART receiver is not empty
|
||||||
|
* \retval 0 The USART receiver is empty
|
||||||
|
*/
|
||||||
|
int32_t usart_sync_is_rx_not_empty(const struct usart_sync_descriptor *const descr);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieve the current driver version
|
||||||
|
*
|
||||||
|
* \return Current driver version.
|
||||||
|
*/
|
||||||
|
uint32_t usart_sync_get_version(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/**@}*/
|
||||||
|
#endif /* _HAL_SYNC_USART_H_INCLUDED */
|
|
@ -0,0 +1,277 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief Generic CMCC(Cortex M Cache Controller) related functionality.
|
||||||
|
*
|
||||||
|
* Copyright (c)2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef HPL_CMCC_H_
|
||||||
|
#define HPL_CMCC_H_
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \Cache driver MACROS
|
||||||
|
*/
|
||||||
|
#define CMCC_DISABLE 0U
|
||||||
|
#define CMCC_ENABLE 1U
|
||||||
|
#define IS_CMCC_DISABLED 0U
|
||||||
|
#define IS_CMCC_ENABLED 1U
|
||||||
|
#define CMCC_WAY_NOS 4U
|
||||||
|
#define CMCC_LINE_NOS 64U
|
||||||
|
#define CMCC_MONITOR_DISABLE 0U
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Cache size configurations
|
||||||
|
*/
|
||||||
|
enum conf_cache_size { CONF_CSIZE_1KB = 0u, CONF_CSIZE_2KB, CONF_CSIZE_4KB };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Way Numbers
|
||||||
|
*/
|
||||||
|
enum way_num_index { WAY0 = 1u, WAY1 = 2u, WAY2 = 4u, WAY3 = 8 };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Cache monitor configurations
|
||||||
|
*/
|
||||||
|
enum conf_cache_monitor { CYCLE_COUNT = 0u, IHIT_COUNT, DHIT_COUNT };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Cache configuration structure
|
||||||
|
*/
|
||||||
|
struct _cache_cfg {
|
||||||
|
enum conf_cache_size cache_size;
|
||||||
|
bool data_cache_disable;
|
||||||
|
bool inst_cache_disable;
|
||||||
|
bool gclk_gate_disable;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Cache enable status
|
||||||
|
*/
|
||||||
|
static inline bool _is_cache_enabled(const void *hw)
|
||||||
|
{
|
||||||
|
return (hri_cmcc_get_SR_CSTS_bit(hw) == IS_CMCC_ENABLED ? true : false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Cache disable status
|
||||||
|
*/
|
||||||
|
static inline bool _is_cache_disabled(const void *hw)
|
||||||
|
{
|
||||||
|
return (hri_cmcc_get_SR_CSTS_bit(hw) == IS_CMCC_DISABLED ? true : false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Cache enable
|
||||||
|
*/
|
||||||
|
static inline int32_t _cmcc_enable(const void *hw)
|
||||||
|
{
|
||||||
|
int32_t return_value;
|
||||||
|
|
||||||
|
if (_is_cache_disabled(hw)) {
|
||||||
|
hri_cmcc_write_CTRL_reg(hw, CMCC_CTRL_CEN);
|
||||||
|
return_value = _is_cache_enabled(hw) == true ? ERR_NONE : ERR_FAILURE;
|
||||||
|
} else {
|
||||||
|
return_value = ERR_NO_CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return return_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Cache disable
|
||||||
|
*/
|
||||||
|
static inline int32_t _cmcc_disable(const void *hw)
|
||||||
|
{
|
||||||
|
hri_cmcc_write_CTRL_reg(hw, (CMCC_DISABLE << CMCC_CTRL_CEN_Pos));
|
||||||
|
while (!(_is_cache_disabled(hw)))
|
||||||
|
;
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize Cache Module
|
||||||
|
*
|
||||||
|
* This function initialize low level cmcc module configuration.
|
||||||
|
*
|
||||||
|
* \return initialize status
|
||||||
|
*/
|
||||||
|
int32_t _cmcc_init(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Configure CMCC module
|
||||||
|
*
|
||||||
|
* \param[in] pointer pointing to the starting address of CMCC module
|
||||||
|
* \param[in] cache configuration structure pointer
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t _cmcc_configure(const void *hw, struct _cache_cfg *cache_ctrl);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable data cache in CMCC module
|
||||||
|
*
|
||||||
|
* \param[in] pointer pointing to the starting address of CMCC module
|
||||||
|
* \param[in] boolean 1 -> Enable the data cache, 0 -> disable the data cache
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t _cmcc_enable_data_cache(const void *hw, bool value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable instruction cache in CMCC module
|
||||||
|
*
|
||||||
|
* \param[in] pointer pointing to the starting address of CMCC module
|
||||||
|
* \param[in] boolean 1 -> Enable the inst cache, 0 -> disable the inst cache
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t _cmcc_enable_inst_cache(const void *hw, bool value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable clock gating in CMCC module
|
||||||
|
*
|
||||||
|
* \param[in] pointer pointing to the starting address of CMCC module
|
||||||
|
* \param[in] boolean 1 -> Enable the clock gate, 0 -> disable the clock gate
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t _cmcc_enable_clock_gating(const void *hw, bool value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Configure the cache size in CMCC module
|
||||||
|
*
|
||||||
|
* \param[in] pointer pointing to the starting address of CMCC module
|
||||||
|
* \param[in] element from cache size configuration enumerator
|
||||||
|
* 0->1K, 1->2K, 2->4K(default)
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t _cmcc_configure_cache_size(const void *hw, enum conf_cache_size size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Lock the mentioned WAY in CMCC module
|
||||||
|
*
|
||||||
|
* \param[in] pointer pointing to the starting address of CMCC module
|
||||||
|
* \param[in] element from "way_num_index" enumerator
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t _cmcc_lock_way(const void *hw, enum way_num_index);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Unlock the mentioned WAY in CMCC module
|
||||||
|
*
|
||||||
|
* \param[in] pointer pointing to the starting address of CMCC module
|
||||||
|
* \param[in] element from "way_num_index" enumerator
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t _cmcc_unlock_way(const void *hw, enum way_num_index);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Invalidate the mentioned cache line in CMCC module
|
||||||
|
*
|
||||||
|
* \param[in] pointer pointing to the starting address of CMCC module
|
||||||
|
* \param[in] element from "way_num" enumerator (valid arg is 0-3)
|
||||||
|
* \param[in] line number (valid arg is 0-63 as each way will have 64 lines)
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t _cmcc_invalidate_by_line(const void *hw, uint8_t way_num, uint8_t line_num);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Invalidate entire cache entries in CMCC module
|
||||||
|
*
|
||||||
|
* \param[in] pointer pointing to the starting address of CMCC module
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t _cmcc_invalidate_all(const void *hw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Configure cache monitor in CMCC module
|
||||||
|
*
|
||||||
|
* \param[in] pointer pointing to the starting address of CMCC module
|
||||||
|
* \param[in] element from cache monitor configurations enumerator
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t _cmcc_configure_monitor(const void *hw, enum conf_cache_monitor monitor_cfg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable cache monitor in CMCC module
|
||||||
|
*
|
||||||
|
* \param[in] pointer pointing to the starting address of CMCC module
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t _cmcc_enable_monitor(const void *hw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Disable cache monitor in CMCC module
|
||||||
|
*
|
||||||
|
* \param[in] pointer pointing to the starting address of CMCC module
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t _cmcc_disable_monitor(const void *hw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Reset cache monitor in CMCC module
|
||||||
|
*
|
||||||
|
* \param[in] pointer pointing to the starting address of CMCC module
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t _cmcc_reset_monitor(const void *hw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Get cache monitor event counter value from CMCC module
|
||||||
|
*
|
||||||
|
* \param[in] pointer pointing to the starting address of CMCC module
|
||||||
|
*
|
||||||
|
* \return event counter value
|
||||||
|
*/
|
||||||
|
uint32_t _cmcc_get_monitor_event_count(const void *hw);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif /* HPL_CMCC_H_ */
|
|
@ -0,0 +1,56 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief CPU core related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_CORE_H_INCLUDED
|
||||||
|
#define _HPL_CORE_H_INCLUDED
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup HPL Core
|
||||||
|
*
|
||||||
|
* \section hpl_core_rev Revision History
|
||||||
|
* - v1.0.0 Initial Release
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "hpl_core_port.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/**@}*/
|
||||||
|
#endif /* _HPL_CORE_H_INCLUDED */
|
|
@ -0,0 +1,97 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief Delay related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_DELAY_H_INCLUDED
|
||||||
|
#define _HPL_DELAY_H_INCLUDED
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup HPL Delay
|
||||||
|
*
|
||||||
|
* \section hpl_delay_rev Revision History
|
||||||
|
* - v1.0.0 Initial Release
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _UNIT_TEST_
|
||||||
|
#include <compiler.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \name HPL functions
|
||||||
|
*/
|
||||||
|
//@{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize delay functionality
|
||||||
|
*
|
||||||
|
* \param[in] hw The pointer to hardware instance
|
||||||
|
*/
|
||||||
|
void _delay_init(void *const hw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieve the amount of cycles to delay for the given amount of us
|
||||||
|
*
|
||||||
|
* \param[in] us The amount of us to delay for
|
||||||
|
*
|
||||||
|
* \return The amount of cycles
|
||||||
|
*/
|
||||||
|
uint32_t _get_cycles_for_us(const uint16_t us);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieve the amount of cycles to delay for the given amount of ms
|
||||||
|
*
|
||||||
|
* \param[in] ms The amount of ms to delay for
|
||||||
|
*
|
||||||
|
* \return The amount of cycles
|
||||||
|
*/
|
||||||
|
uint32_t _get_cycles_for_ms(const uint16_t ms);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Delay loop to delay n number of cycles
|
||||||
|
*
|
||||||
|
* \param[in] hw The pointer to hardware instance
|
||||||
|
* \param[in] cycles The amount of cycles to delay for
|
||||||
|
*/
|
||||||
|
void _delay_cycles(void *const hw, uint32_t cycles);
|
||||||
|
//@}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/**@}*/
|
||||||
|
#endif /* _HPL_DELAY_H_INCLUDED */
|
|
@ -0,0 +1,176 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief DMA related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_DMA_H_INCLUDED
|
||||||
|
#define _HPL_DMA_H_INCLUDED
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup HPL DMA
|
||||||
|
*
|
||||||
|
* \section hpl_dma_rev Revision History
|
||||||
|
* - v1.0.0 Initial Release
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <compiler.h>
|
||||||
|
#include <hpl_irq.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct _dma_resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief DMA callback types
|
||||||
|
*/
|
||||||
|
enum _dma_callback_type { DMA_TRANSFER_COMPLETE_CB, DMA_TRANSFER_ERROR_CB };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief DMA interrupt callbacks
|
||||||
|
*/
|
||||||
|
struct _dma_callbacks {
|
||||||
|
void (*transfer_done)(struct _dma_resource *resource);
|
||||||
|
void (*error)(struct _dma_resource *resource);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief DMA resource structure
|
||||||
|
*/
|
||||||
|
struct _dma_resource {
|
||||||
|
struct _dma_callbacks dma_cb;
|
||||||
|
void * back;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize DMA
|
||||||
|
*
|
||||||
|
* This function does low level DMA configuration.
|
||||||
|
*
|
||||||
|
* \return initialize status
|
||||||
|
*/
|
||||||
|
int32_t _dma_init(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set destination address
|
||||||
|
*
|
||||||
|
* \param[in] channel DMA channel to set destination address for
|
||||||
|
* \param[in] dst Destination address
|
||||||
|
*
|
||||||
|
* \return setting status
|
||||||
|
*/
|
||||||
|
int32_t _dma_set_destination_address(const uint8_t channel, const void *const dst);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set source address
|
||||||
|
*
|
||||||
|
* \param[in] channel DMA channel to set source address for
|
||||||
|
* \param[in] src Source address
|
||||||
|
*
|
||||||
|
* \return setting status
|
||||||
|
*/
|
||||||
|
int32_t _dma_set_source_address(const uint8_t channel, const void *const src);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set next descriptor address
|
||||||
|
*
|
||||||
|
* \param[in] current_channel Current DMA channel to set next descriptor address
|
||||||
|
* \param[in] next_channel Next DMA channel used as next descriptor
|
||||||
|
*
|
||||||
|
* \return setting status
|
||||||
|
*/
|
||||||
|
int32_t _dma_set_next_descriptor(const uint8_t current_channel, const uint8_t next_channel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable/disable source address incrementation during DMA transaction
|
||||||
|
*
|
||||||
|
* \param[in] channel DMA channel to set source address for
|
||||||
|
* \param[in] enable True to enable, false to disable
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t _dma_srcinc_enable(const uint8_t channel, const bool enable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable/disable Destination address incrementation during DMA transaction
|
||||||
|
*
|
||||||
|
* \param[in] channel DMA channel to set destination address for
|
||||||
|
* \param[in] enable True to enable, false to disable
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t _dma_dstinc_enable(const uint8_t channel, const bool enable);
|
||||||
|
/**
|
||||||
|
* \brief Set the amount of data to be transfered per transaction
|
||||||
|
*
|
||||||
|
* \param[in] channel DMA channel to set data amount for
|
||||||
|
* \param[in] amount Data amount
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t _dma_set_data_amount(const uint8_t channel, const uint32_t amount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Trigger DMA transaction on the given channel
|
||||||
|
*
|
||||||
|
* \param[in] channel DMA channel to trigger transaction on
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t _dma_enable_transaction(const uint8_t channel, const bool software_trigger);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieves DMA resource structure
|
||||||
|
*
|
||||||
|
* \param[out] resource The resource to be retrieved
|
||||||
|
* \param[in] channel DMA channel to retrieve structure for
|
||||||
|
*
|
||||||
|
* \return status of operation
|
||||||
|
*/
|
||||||
|
int32_t _dma_get_channel_resource(struct _dma_resource **resource, const uint8_t channel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable/disable DMA interrupt
|
||||||
|
*
|
||||||
|
* \param[in] channel DMA channel to enable/disable interrupt for
|
||||||
|
* \param[in] type The type of interrupt to disable/enable if applicable
|
||||||
|
* \param[in] state Enable or disable
|
||||||
|
*/
|
||||||
|
void _dma_set_irq_state(const uint8_t channel, const enum _dma_callback_type type, const bool state);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* HPL_DMA_H_INCLUDED */
|
|
@ -0,0 +1,185 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief Port related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_GPIO_H_INCLUDED
|
||||||
|
#define _HPL_GPIO_H_INCLUDED
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup HPL Port
|
||||||
|
*
|
||||||
|
* \section hpl_port_rev Revision History
|
||||||
|
* - v1.0.0 Initial Release
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <compiler.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
/**
|
||||||
|
* \brief Macros for the pin and port group, lower 5
|
||||||
|
* bits stands for pin number in the group, higher 3
|
||||||
|
* bits stands for port group
|
||||||
|
*/
|
||||||
|
#define GPIO_PIN(n) (((n)&0x1Fu) << 0)
|
||||||
|
#define GPIO_PORT(n) ((n) >> 5)
|
||||||
|
#define GPIO(port, pin) ((((port)&0x7u) << 5) + ((pin)&0x1Fu))
|
||||||
|
#define GPIO_PIN_FUNCTION_OFF 0xffffffff
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief PORT pull mode settings
|
||||||
|
*/
|
||||||
|
enum gpio_pull_mode { GPIO_PULL_OFF, GPIO_PULL_UP, GPIO_PULL_DOWN };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief PORT direction settins
|
||||||
|
*/
|
||||||
|
enum gpio_direction { GPIO_DIRECTION_OFF, GPIO_DIRECTION_IN, GPIO_DIRECTION_OUT };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief PORT group abstraction
|
||||||
|
*/
|
||||||
|
|
||||||
|
enum gpio_port { GPIO_PORTA, GPIO_PORTB, GPIO_PORTC, GPIO_PORTD, GPIO_PORTE };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \name HPL functions
|
||||||
|
*/
|
||||||
|
//@{
|
||||||
|
/**
|
||||||
|
* \brief Port initialization function
|
||||||
|
*
|
||||||
|
* Port initialization function should setup the port module based
|
||||||
|
* on a static configuration file, this function should normally
|
||||||
|
* not be called directly, but is a part of hal_init()
|
||||||
|
*/
|
||||||
|
void _gpio_init(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set direction on port with mask
|
||||||
|
*
|
||||||
|
* Set data direction for each pin, or disable the pin
|
||||||
|
*
|
||||||
|
* \param[in] port Ports are grouped into groups of maximum 32 pins,
|
||||||
|
* GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
|
||||||
|
* \param[in] mask Bit mask where 1 means apply direction setting to the
|
||||||
|
* corresponding pin
|
||||||
|
* \param[in] direction GPIO_DIRECTION_OFF = set pin direction to input
|
||||||
|
* and disable input buffer to disable the pin
|
||||||
|
* GPIO_DIRECTION_IN = set pin direction to input
|
||||||
|
* and enable input buffer to enable the pin
|
||||||
|
* GPIO_DIRECTION_OUT = set pin direction to output
|
||||||
|
* and disable input buffer
|
||||||
|
*/
|
||||||
|
static inline void _gpio_set_direction(const enum gpio_port port, const uint32_t mask,
|
||||||
|
const enum gpio_direction direction);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set output level on port with mask
|
||||||
|
*
|
||||||
|
* Sets output state on pin to high or low with pin masking
|
||||||
|
*
|
||||||
|
* \param[in] port Ports are grouped into groups of maximum 32 pins,
|
||||||
|
* GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
|
||||||
|
* \param[in] mask Bit mask where 1 means apply direction setting to
|
||||||
|
* the corresponding pin
|
||||||
|
* \param[in] level true = pin level is set to 1
|
||||||
|
* false = pin level is set to 0
|
||||||
|
*/
|
||||||
|
static inline void _gpio_set_level(const enum gpio_port port, const uint32_t mask, const bool level);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Change output level to the opposite with mask
|
||||||
|
*
|
||||||
|
* Change pin output level to the opposite with pin masking
|
||||||
|
*
|
||||||
|
* \param[in] port Ports are grouped into groups of maximum 32 pins,
|
||||||
|
* GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
|
||||||
|
* \param[in] mask Bit mask where 1 means apply direction setting to
|
||||||
|
* the corresponding pin
|
||||||
|
*/
|
||||||
|
static inline void _gpio_toggle_level(const enum gpio_port port, const uint32_t mask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Get input levels on all port pins
|
||||||
|
*
|
||||||
|
* Get input level on all port pins, will read IN register if configured to
|
||||||
|
* input and OUT register if configured as output
|
||||||
|
*
|
||||||
|
* \param[in] port Ports are grouped into groups of maximum 32 pins,
|
||||||
|
* GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
|
||||||
|
*/
|
||||||
|
static inline uint32_t _gpio_get_level(const enum gpio_port port);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set pin pull mode
|
||||||
|
*
|
||||||
|
* Set pull mode on a single pin
|
||||||
|
*
|
||||||
|
* \notice This function will automatically change pin direction to input
|
||||||
|
*
|
||||||
|
* \param[in] port Ports are grouped into groups of maximum 32 pins,
|
||||||
|
* GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
|
||||||
|
* \param[in] pin The pin in the group that pull mode should be selected
|
||||||
|
* for
|
||||||
|
* \param[in] pull_mode GPIO_PULL_OFF = pull resistor on pin is disabled
|
||||||
|
* GPIO_PULL_DOWN = pull resistor on pin will pull pin
|
||||||
|
* level to ground level
|
||||||
|
* GPIO_PULL_UP = pull resistor on pin will pull pin
|
||||||
|
* level to VCC
|
||||||
|
*/
|
||||||
|
static inline void _gpio_set_pin_pull_mode(const enum gpio_port port, const uint8_t pin,
|
||||||
|
const enum gpio_pull_mode pull_mode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set gpio function
|
||||||
|
*
|
||||||
|
* Select which function a gpio is used for
|
||||||
|
*
|
||||||
|
* \param[in] gpio The gpio to set function for
|
||||||
|
* \param[in] function The gpio function is given by a 32-bit wide bitfield
|
||||||
|
* found in the header files for the device
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
static inline void _gpio_set_pin_function(const uint32_t gpio, const uint32_t function);
|
||||||
|
|
||||||
|
#include <hpl_gpio_base.h>
|
||||||
|
//@}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/**@}*/
|
||||||
|
#endif /* _HPL_GPIO_H_INCLUDED */
|
|
@ -0,0 +1,205 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief I2C Master Hardware Proxy Layer(HPL) declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#ifndef _HPL_I2C_M_ASYNC_H_INCLUDED
|
||||||
|
#define _HPL_I2C_M_ASYNC_H_INCLUDED
|
||||||
|
|
||||||
|
#include "hpl_i2c_m_sync.h"
|
||||||
|
#include "hpl_irq.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief i2c master callback names
|
||||||
|
*/
|
||||||
|
enum _i2c_m_async_callback_type {
|
||||||
|
I2C_M_ASYNC_DEVICE_ERROR,
|
||||||
|
I2C_M_ASYNC_DEVICE_TX_COMPLETE,
|
||||||
|
I2C_M_ASYNC_DEVICE_RX_COMPLETE
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _i2c_m_async_device;
|
||||||
|
|
||||||
|
typedef void (*_i2c_complete_cb_t)(struct _i2c_m_async_device *i2c_dev);
|
||||||
|
typedef void (*_i2c_error_cb_t)(struct _i2c_m_async_device *i2c_dev, int32_t errcode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief i2c callback pointers structure
|
||||||
|
*/
|
||||||
|
struct _i2c_m_async_callback {
|
||||||
|
_i2c_error_cb_t error;
|
||||||
|
_i2c_complete_cb_t tx_complete;
|
||||||
|
_i2c_complete_cb_t rx_complete;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief i2c device structure
|
||||||
|
*/
|
||||||
|
struct _i2c_m_async_device {
|
||||||
|
struct _i2c_m_service service;
|
||||||
|
void * hw;
|
||||||
|
struct _i2c_m_async_callback cb;
|
||||||
|
struct _irq_descriptor irq;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \name HPL functions
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize I2C in interrupt mode
|
||||||
|
*
|
||||||
|
* This function does low level I2C configuration.
|
||||||
|
*
|
||||||
|
* \param[in] i2c_dev The pointer to i2c interrupt device structure
|
||||||
|
* \param[in] hw The pointer to hardware instance
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_m_async_init(struct _i2c_m_async_device *const i2c_dev, void *const hw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Deinitialize I2C in interrupt mode
|
||||||
|
*
|
||||||
|
* \param[in] i2c_dev The pointer to i2c device structure
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_m_async_deinit(struct _i2c_m_async_device *const i2c_dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable I2C module
|
||||||
|
*
|
||||||
|
* This function does low level I2C enable.
|
||||||
|
*
|
||||||
|
* \param[in] i2c_dev The pointer to i2c device structure
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_m_async_enable(struct _i2c_m_async_device *const i2c_dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Disable I2C module
|
||||||
|
*
|
||||||
|
* This function does low level I2C disable.
|
||||||
|
*
|
||||||
|
* \param[in] i2c_dev The pointer to i2c device structure
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_m_async_disable(struct _i2c_m_async_device *const i2c_dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Transfer data by I2C
|
||||||
|
*
|
||||||
|
* This function does low level I2C data transfer.
|
||||||
|
*
|
||||||
|
* \param[in] i2c_dev The pointer to i2c device structure
|
||||||
|
* \param[in] msg The pointer to i2c msg structure
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_m_async_transfer(struct _i2c_m_async_device *const i2c_dev, struct _i2c_m_msg *msg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set baud rate of I2C
|
||||||
|
*
|
||||||
|
* This function does low level I2C set baud rate.
|
||||||
|
*
|
||||||
|
* \param[in] i2c_dev The pointer to i2c device structure
|
||||||
|
* \param[in] clkrate The clock rate(KHz) input to i2c module
|
||||||
|
* \param[in] baudrate The demand baud rate(KHz) of i2c module
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_m_async_set_baudrate(struct _i2c_m_async_device *const i2c_dev, uint32_t clkrate, uint32_t baudrate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Register callback to I2C
|
||||||
|
*
|
||||||
|
* This function does low level I2C callback register.
|
||||||
|
*
|
||||||
|
* \param[in] i2c_dev The pointer to i2c device structure
|
||||||
|
* \param[in] cb_type The callback type request
|
||||||
|
* \param[in] func The callback function pointer
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_m_async_register_callback(struct _i2c_m_async_device *i2c_dev, enum _i2c_m_async_callback_type cb_type,
|
||||||
|
FUNC_PTR func);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Generate stop condition on the I2C bus
|
||||||
|
*
|
||||||
|
* This function will generate a stop condition on the I2C bus
|
||||||
|
*
|
||||||
|
* \param[in] i2c_m_async_descriptor An i2c descriptor which is used to communicate through I2C
|
||||||
|
*
|
||||||
|
* \return Operation status
|
||||||
|
* \retval 0 Operation executed successfully
|
||||||
|
* \retval <0 Operation failed
|
||||||
|
*/
|
||||||
|
int32_t _i2c_m_async_send_stop(struct _i2c_m_async_device *const i2c_dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Returns the number of bytes left or not used in the I2C message buffer
|
||||||
|
*
|
||||||
|
* This function will return the number of bytes left (not written to the bus) or still free
|
||||||
|
* (not received from the bus) in the message buffer, depending on direction of transmission.
|
||||||
|
*
|
||||||
|
* \param[in] i2c_m_async_descriptor An i2c descriptor which is used to communicate through I2C
|
||||||
|
*
|
||||||
|
* \return Number of bytes or error code
|
||||||
|
* \retval >0 Positive number indicating bytes left
|
||||||
|
* \retval 0 Buffer is full/empty depending on direction
|
||||||
|
* \retval <0 Error code
|
||||||
|
*/
|
||||||
|
int32_t _i2c_m_async_get_bytes_left(struct _i2c_m_async_device *const i2c_dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable/disable I2C master interrupt
|
||||||
|
*
|
||||||
|
* param[in] device The pointer to I2C master device instance
|
||||||
|
* param[in] type The type of interrupt to disable/enable if applicable
|
||||||
|
* param[in] state Enable or disable
|
||||||
|
*/
|
||||||
|
void _i2c_m_async_set_irq_state(struct _i2c_m_async_device *const device, const enum _i2c_m_async_callback_type type,
|
||||||
|
const bool state);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,185 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief I2C Master Hardware Proxy Layer(HPL) declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#ifndef _HPL_I2C_M_SYNC_H_INCLUDED
|
||||||
|
#define _HPL_I2C_M_SYNC_H_INCLUDED
|
||||||
|
|
||||||
|
#include <compiler.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief i2c flags
|
||||||
|
*/
|
||||||
|
#define I2C_M_RD 0x0001 /* read data, from slave to master */
|
||||||
|
#define I2C_M_BUSY 0x0100
|
||||||
|
#define I2C_M_TEN 0x0400 /* this is a ten bit chip address */
|
||||||
|
#define I2C_M_SEVEN 0x0800 /* this is a seven bit chip address */
|
||||||
|
#define I2C_M_FAIL 0x1000
|
||||||
|
#define I2C_M_STOP 0x8000 /* if I2C_FUNC_PROTOCOL_MANGLING */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief i2c Return codes
|
||||||
|
*/
|
||||||
|
#define I2C_OK 0 /* Operation successful */
|
||||||
|
#define I2C_ACK -1 /* Received ACK from device on I2C bus */
|
||||||
|
#define I2C_NACK -2 /* Received NACK from device on I2C bus */
|
||||||
|
#define I2C_ERR_ARBLOST -3 /* Arbitration lost */
|
||||||
|
#define I2C_ERR_BAD_ADDRESS -4 /* Bad address */
|
||||||
|
#define I2C_ERR_BUS -5 /* Bus error */
|
||||||
|
#define I2C_ERR_BUSY -6 /* Device busy */
|
||||||
|
#define I2c_ERR_PACKAGE_COLLISION -7 /* Package collision */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief i2c I2C Modes
|
||||||
|
*/
|
||||||
|
#define I2C_STANDARD_MODE 0x00
|
||||||
|
#define I2C_FASTMODE 0x01
|
||||||
|
#define I2C_HIGHSPEED_MODE 0x02
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief i2c master message structure
|
||||||
|
*/
|
||||||
|
struct _i2c_m_msg {
|
||||||
|
uint16_t addr;
|
||||||
|
volatile uint16_t flags;
|
||||||
|
int32_t len;
|
||||||
|
uint8_t * buffer;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief i2c master service
|
||||||
|
*/
|
||||||
|
struct _i2c_m_service {
|
||||||
|
struct _i2c_m_msg msg;
|
||||||
|
uint16_t mode;
|
||||||
|
uint16_t trise;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief i2c sync master device structure
|
||||||
|
*/
|
||||||
|
struct _i2c_m_sync_device {
|
||||||
|
struct _i2c_m_service service;
|
||||||
|
void * hw;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \name HPL functions
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize I2C
|
||||||
|
*
|
||||||
|
* This function does low level I2C configuration.
|
||||||
|
*
|
||||||
|
* \param[in] i2c_dev The pointer to i2c device structure
|
||||||
|
* \param[in] hw The pointer to hardware instance
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_m_sync_init(struct _i2c_m_sync_device *const i2c_dev, void *const hw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Deinitialize I2C
|
||||||
|
*
|
||||||
|
* \param[in] i2c_dev The pointer to i2c device structure
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_m_sync_deinit(struct _i2c_m_sync_device *const i2c_dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable I2C module
|
||||||
|
*
|
||||||
|
* This function does low level I2C enable.
|
||||||
|
*
|
||||||
|
* \param[in] i2c_dev The pointer to i2c device structure
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_m_sync_enable(struct _i2c_m_sync_device *const i2c_dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Disable I2C module
|
||||||
|
*
|
||||||
|
* This function does low level I2C disable.
|
||||||
|
*
|
||||||
|
* \param[in] i2c_dev The pointer to i2c device structure
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_m_sync_disable(struct _i2c_m_sync_device *const i2c_dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Transfer data by I2C
|
||||||
|
*
|
||||||
|
* This function does low level I2C data transfer.
|
||||||
|
*
|
||||||
|
* \param[in] i2c_dev The pointer to i2c device structure
|
||||||
|
* \param[in] msg The pointer to i2c msg structure
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_m_sync_transfer(struct _i2c_m_sync_device *const i2c_dev, struct _i2c_m_msg *msg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set baud rate of I2C
|
||||||
|
*
|
||||||
|
* This function does low level I2C set baud rate.
|
||||||
|
*
|
||||||
|
* \param[in] i2c_dev The pointer to i2c device structure
|
||||||
|
* \param[in] clkrate The clock rate(KHz) input to i2c module
|
||||||
|
* \param[in] baudrate The demand baud rate(KHz) of i2c module
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_m_sync_set_baudrate(struct _i2c_m_sync_device *const i2c_dev, uint32_t clkrate, uint32_t baudrate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Send send condition on the I2C bus
|
||||||
|
*
|
||||||
|
* This function will generate a stop condition on the I2C bus
|
||||||
|
*
|
||||||
|
* \param[in] i2c_dev The pointer to i2c device struct
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_m_sync_send_stop(struct _i2c_m_sync_device *const i2c_dev);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,184 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief I2C Slave Hardware Proxy Layer(HPL) declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#ifndef _HPL_I2C_S_ASYNC_H_INCLUDED
|
||||||
|
#define _HPL_I2C_S_ASYNC_H_INCLUDED
|
||||||
|
|
||||||
|
#include "hpl_i2c_s_sync.h"
|
||||||
|
#include "hpl_irq.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief i2c callback types
|
||||||
|
*/
|
||||||
|
enum _i2c_s_async_callback_type { I2C_S_DEVICE_ERROR, I2C_S_DEVICE_TX, I2C_S_DEVICE_RX_COMPLETE };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Forward declaration of I2C Slave device
|
||||||
|
*/
|
||||||
|
struct _i2c_s_async_device;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief i2c slave callback function type
|
||||||
|
*/
|
||||||
|
typedef void (*_i2c_s_async_cb_t)(struct _i2c_s_async_device *device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief i2c slave callback pointers structure
|
||||||
|
*/
|
||||||
|
struct _i2c_s_async_callback {
|
||||||
|
void (*error)(struct _i2c_s_async_device *const device);
|
||||||
|
void (*tx)(struct _i2c_s_async_device *const device);
|
||||||
|
void (*rx_done)(struct _i2c_s_async_device *const device, const uint8_t data);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief i2c slave device structure
|
||||||
|
*/
|
||||||
|
struct _i2c_s_async_device {
|
||||||
|
void * hw;
|
||||||
|
struct _i2c_s_async_callback cb;
|
||||||
|
struct _irq_descriptor irq;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \name HPL functions
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize asynchronous I2C slave
|
||||||
|
*
|
||||||
|
* This function does low level I2C configuration.
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c interrupt device structure
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_s_async_init(struct _i2c_s_async_device *const device, void *const hw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Deinitialize asynchronous I2C in interrupt mode
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c device structure
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_s_async_deinit(struct _i2c_s_async_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable I2C module
|
||||||
|
*
|
||||||
|
* This function does low level I2C enable.
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c slave device structure
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_s_async_enable(struct _i2c_s_async_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Disable I2C module
|
||||||
|
*
|
||||||
|
* This function does low level I2C disable.
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c slave device structure
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_s_async_disable(struct _i2c_s_async_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Check if 10-bit addressing mode is on
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c slave device structure
|
||||||
|
*
|
||||||
|
* \return Cheking status
|
||||||
|
* \retval 1 10-bit addressing mode is on
|
||||||
|
* \retval 0 10-bit addressing mode is off
|
||||||
|
*/
|
||||||
|
int32_t _i2c_s_async_is_10bit_addressing_on(const struct _i2c_s_async_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set I2C slave address
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c slave device structure
|
||||||
|
* \param[in] address Address to set
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_s_async_set_address(struct _i2c_s_async_device *const device, const uint16_t address);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Write a byte to the given I2C instance
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c slave device structure
|
||||||
|
* \param[in] data Data to write
|
||||||
|
*/
|
||||||
|
void _i2c_s_async_write_byte(struct _i2c_s_async_device *const device, const uint8_t data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieve I2C slave status
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c slave device structure
|
||||||
|
*
|
||||||
|
*\return I2C slave status
|
||||||
|
*/
|
||||||
|
i2c_s_status_t _i2c_s_async_get_status(const struct _i2c_s_async_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Abort data transmission
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c device structure
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_s_async_abort_transmission(const struct _i2c_s_async_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable/disable I2C slave interrupt
|
||||||
|
*
|
||||||
|
* param[in] device The pointer to I2C slave device instance
|
||||||
|
* param[in] type The type of interrupt to disable/enable if applicable
|
||||||
|
* param[in] disable Enable or disable
|
||||||
|
*/
|
||||||
|
int32_t _i2c_s_async_set_irq_state(struct _i2c_s_async_device *const device, const enum _i2c_s_async_callback_type type,
|
||||||
|
const bool disable);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _HPL_I2C_S_ASYNC_H_INCLUDED */
|
|
@ -0,0 +1,184 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief I2C Slave Hardware Proxy Layer(HPL) declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#ifndef _HPL_I2C_S_SYNC_H_INCLUDED
|
||||||
|
#define _HPL_I2C_S_SYNC_H_INCLUDED
|
||||||
|
|
||||||
|
#include <compiler.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief I2C Slave status type
|
||||||
|
*/
|
||||||
|
typedef uint32_t i2c_s_status_t;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief i2c slave device structure
|
||||||
|
*/
|
||||||
|
struct _i2c_s_sync_device {
|
||||||
|
void *hw;
|
||||||
|
};
|
||||||
|
|
||||||
|
#include <compiler.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \name HPL functions
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize synchronous I2C slave
|
||||||
|
*
|
||||||
|
* This function does low level I2C configuration.
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c slave device structure
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_s_sync_init(struct _i2c_s_sync_device *const device, void *const hw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Deinitialize synchronous I2C slave
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c slave device structure
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_s_sync_deinit(struct _i2c_s_sync_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable I2C module
|
||||||
|
*
|
||||||
|
* This function does low level I2C enable.
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c slave device structure
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_s_sync_enable(struct _i2c_s_sync_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Disable I2C module
|
||||||
|
*
|
||||||
|
* This function does low level I2C disable.
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c slave device structure
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_s_sync_disable(struct _i2c_s_sync_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Check if 10-bit addressing mode is on
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c slave device structure
|
||||||
|
*
|
||||||
|
* \return Cheking status
|
||||||
|
* \retval 1 10-bit addressing mode is on
|
||||||
|
* \retval 0 10-bit addressing mode is off
|
||||||
|
*/
|
||||||
|
int32_t _i2c_s_sync_is_10bit_addressing_on(const struct _i2c_s_sync_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set I2C slave address
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c slave device structure
|
||||||
|
* \param[in] address Address to set
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_s_sync_set_address(struct _i2c_s_sync_device *const device, const uint16_t address);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Write a byte to the given I2C instance
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c slave device structure
|
||||||
|
* \param[in] data Data to write
|
||||||
|
*/
|
||||||
|
void _i2c_s_sync_write_byte(struct _i2c_s_sync_device *const device, const uint8_t data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieve I2C slave status
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c slave device structure
|
||||||
|
*
|
||||||
|
*\return I2C slave status
|
||||||
|
*/
|
||||||
|
i2c_s_status_t _i2c_s_sync_get_status(const struct _i2c_s_sync_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Clear the Data Ready interrupt flag
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c slave device structure
|
||||||
|
*
|
||||||
|
* \return Return 0 for success and negative value for error
|
||||||
|
*/
|
||||||
|
int32_t _i2c_s_sync_clear_data_ready_flag(const struct _i2c_s_sync_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Read a byte from the given I2C instance
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c slave device structure
|
||||||
|
*
|
||||||
|
* \return Data received via I2C interface.
|
||||||
|
*/
|
||||||
|
uint8_t _i2c_s_sync_read_byte(const struct _i2c_s_sync_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Check if I2C is ready to send next byte
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c slave device structure
|
||||||
|
*
|
||||||
|
* \return Status of the ready check.
|
||||||
|
* \retval true if the I2C is ready to send next byte
|
||||||
|
* \retval false if the I2C is not ready to send next byte
|
||||||
|
*/
|
||||||
|
bool _i2c_s_sync_is_byte_sent(const struct _i2c_s_sync_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Check if there is data received by I2C
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to i2c slave device structure
|
||||||
|
*
|
||||||
|
* \return Status of the data received check.
|
||||||
|
* \retval true if the I2C has received a byte
|
||||||
|
* \retval false if the I2C has not received a byte
|
||||||
|
*/
|
||||||
|
bool _i2c_s_sync_is_byte_received(const struct _i2c_s_sync_device *const device);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _HPL_I2C_S_SYNC_H_INCLUDED */
|
|
@ -0,0 +1,124 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief Init related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_INIT_H_INCLUDED
|
||||||
|
#define _HPL_INIT_H_INCLUDED
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup HPL Init
|
||||||
|
*
|
||||||
|
* \section hpl_init_rev Revision History
|
||||||
|
* - v1.0.0 Initial Release
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <compiler.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \name HPL functions
|
||||||
|
*/
|
||||||
|
//@{
|
||||||
|
/**
|
||||||
|
* \brief Initializes clock sources
|
||||||
|
*/
|
||||||
|
void _sysctrl_init_sources(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initializes Power Manager
|
||||||
|
*/
|
||||||
|
void _pm_init(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize generators
|
||||||
|
*/
|
||||||
|
void _gclk_init_generators(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize 32 kHz clock sources
|
||||||
|
*/
|
||||||
|
void _osc32kctrl_init_sources(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize clock sources
|
||||||
|
*/
|
||||||
|
void _oscctrl_init_sources(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize clock sources that need input reference clocks
|
||||||
|
*/
|
||||||
|
void _sysctrl_init_referenced_generators(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize clock sources that need input reference clocks
|
||||||
|
*/
|
||||||
|
void _oscctrl_init_referenced_generators(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize master clock generator
|
||||||
|
*/
|
||||||
|
void _mclk_init(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize clock generator
|
||||||
|
*/
|
||||||
|
void _lpmcu_misc_regs_init(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize clock generator
|
||||||
|
*/
|
||||||
|
void _pmc_init(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set performance level
|
||||||
|
*
|
||||||
|
* \param[in] level The performance level to set
|
||||||
|
*/
|
||||||
|
void _set_performance_level(const uint8_t level);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize the chip
|
||||||
|
*/
|
||||||
|
void _init_chip(void);
|
||||||
|
|
||||||
|
//@}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/**@}*/
|
||||||
|
#endif /* _HPL_INIT_H_INCLUDED */
|
|
@ -0,0 +1,116 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief IRQ related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_IRQ_H_INCLUDED
|
||||||
|
#define _HPL_IRQ_H_INCLUDED
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup HPL IRQ
|
||||||
|
*
|
||||||
|
* \section hpl_irq_rev Revision History
|
||||||
|
* - v1.0.0 Initial Release
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <compiler.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief IRQ descriptor
|
||||||
|
*/
|
||||||
|
struct _irq_descriptor {
|
||||||
|
void (*handler)(void *parameter);
|
||||||
|
void *parameter;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \name HPL functions
|
||||||
|
*/
|
||||||
|
//@{
|
||||||
|
/**
|
||||||
|
* \brief Retrieve current IRQ number
|
||||||
|
*
|
||||||
|
* \return The current IRQ number
|
||||||
|
*/
|
||||||
|
uint8_t _irq_get_current(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Disable the given IRQ
|
||||||
|
*
|
||||||
|
* \param[in] n The number of IRQ to disable
|
||||||
|
*/
|
||||||
|
void _irq_disable(uint8_t n);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set the given IRQ
|
||||||
|
*
|
||||||
|
* \param[in] n The number of IRQ to set
|
||||||
|
*/
|
||||||
|
void _irq_set(uint8_t n);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Clear the given IRQ
|
||||||
|
*
|
||||||
|
* \param[in] n The number of IRQ to clear
|
||||||
|
*/
|
||||||
|
void _irq_clear(uint8_t n);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable the given IRQ
|
||||||
|
*
|
||||||
|
* \param[in] n The number of IRQ to enable
|
||||||
|
*/
|
||||||
|
void _irq_enable(uint8_t n);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Register IRQ handler
|
||||||
|
*
|
||||||
|
* \param[in] number The number registered IRQ
|
||||||
|
* \param[in] irq The pointer to irq handler to register
|
||||||
|
*
|
||||||
|
* \return The status of IRQ handler registering
|
||||||
|
* \retval -1 Passed parameters were invalid
|
||||||
|
* \retval 0 The registering is completed successfully
|
||||||
|
*/
|
||||||
|
void _irq_register(const uint8_t number, struct _irq_descriptor *const irq);
|
||||||
|
//@}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/**@}*/
|
||||||
|
#endif /* _HPL_IRQ_H_INCLUDED */
|
|
@ -0,0 +1,37 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief Family-dependent missing features expected by HAL
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_MISSING_FEATURES
|
||||||
|
#define _HPL_MISSING_FEATURES
|
||||||
|
|
||||||
|
#endif /* _HPL_MISSING_FEATURES */
|
|
@ -0,0 +1,100 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief RAMECC related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_RAMECC_H_INCLUDED
|
||||||
|
#define _HPL_RAMECC_H_INCLUDED
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup HPL RAMECC
|
||||||
|
*
|
||||||
|
* \section hpl_ramecc_rev Revision History
|
||||||
|
* - v1.0.0 Initial Release
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <compiler.h>
|
||||||
|
#include <hpl_irq.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief RAMECC callback type
|
||||||
|
*/
|
||||||
|
typedef void (*ramecc_cb_t)(const uint32_t data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief RAMECC callback types
|
||||||
|
*/
|
||||||
|
enum _ramecc_callback_type { RAMECC_DUAL_ERROR_CB, RAMECC_SINGLE_ERROR_CB };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief RAMECC interrupt callbacks
|
||||||
|
*/
|
||||||
|
struct _ramecc_callbacks {
|
||||||
|
ramecc_cb_t dual_bit_err;
|
||||||
|
ramecc_cb_t single_bit_err;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief RAMECC device structure
|
||||||
|
*/
|
||||||
|
struct _ramecc_device {
|
||||||
|
struct _ramecc_callbacks ramecc_cb;
|
||||||
|
struct _irq_descriptor irq;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize RAMECC
|
||||||
|
*
|
||||||
|
* This function does low level RAMECC configuration.
|
||||||
|
*
|
||||||
|
* \return initialize status
|
||||||
|
*/
|
||||||
|
int32_t _ramecc_init(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Register RAMECC callback
|
||||||
|
*
|
||||||
|
* \param[in] type The type of callback
|
||||||
|
* \param[in] cb A callback function
|
||||||
|
*/
|
||||||
|
void _ramecc_register_callback(const enum _ramecc_callback_type type, ramecc_cb_t cb);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _HPL_RAMECC_H_INCLUDED */
|
|
@ -0,0 +1,93 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief Reset related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_RESET_H_INCLUDED
|
||||||
|
#define _HPL_RESET_H_INCLUDED
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup HPL Reset
|
||||||
|
*
|
||||||
|
* \section hpl_reset_rev Revision History
|
||||||
|
* - v1.0.0 Initial Release
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _UNIT_TEST_
|
||||||
|
#include <compiler.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Reset reason enumeration
|
||||||
|
*
|
||||||
|
* The list of possible reset reasons.
|
||||||
|
*/
|
||||||
|
enum reset_reason {
|
||||||
|
RESET_REASON_POR = 1,
|
||||||
|
RESET_REASON_BOD12 = 2,
|
||||||
|
RESET_REASON_BOD33 = 4,
|
||||||
|
RESET_REASON_NVM = 8,
|
||||||
|
RESET_REASON_EXT = 16,
|
||||||
|
RESET_REASON_WDT = 32,
|
||||||
|
RESET_REASON_SYST = 64,
|
||||||
|
RESET_REASON_BACKUP = 128
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \name HPL functions
|
||||||
|
*/
|
||||||
|
//@{
|
||||||
|
/**
|
||||||
|
* \brief Retrieve the reset reason
|
||||||
|
*
|
||||||
|
* Retrieves the reset reason of the last MCU reset.
|
||||||
|
*
|
||||||
|
*\return An enum value indicating the reason of the last reset.
|
||||||
|
*/
|
||||||
|
enum reset_reason _get_reset_reason(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Reset MCU
|
||||||
|
*/
|
||||||
|
void _reset_mcu(void);
|
||||||
|
//@}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/**@}*/
|
||||||
|
#endif /* _HPL_RESET_H_INCLUDED */
|
|
@ -0,0 +1,88 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief Sleep related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_SLEEP_H_INCLUDED
|
||||||
|
#define _HPL_SLEEP_H_INCLUDED
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup HPL Sleep
|
||||||
|
*
|
||||||
|
* \section hpl_sleep_rev Revision History
|
||||||
|
* - v1.0.0 Initial Release
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _UNIT_TEST_
|
||||||
|
#include <compiler.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \name HPL functions
|
||||||
|
*/
|
||||||
|
//@{
|
||||||
|
/**
|
||||||
|
* \brief Set the sleep mode for the device
|
||||||
|
*
|
||||||
|
* This function sets the sleep mode for the device.
|
||||||
|
* For an overview of which systems are disabled in sleep for the different
|
||||||
|
* sleep modes see datasheet.
|
||||||
|
*
|
||||||
|
* \param[in] mode Sleep mode to use
|
||||||
|
*
|
||||||
|
* \return the status of a sleep request
|
||||||
|
* \retval -1 The requested sleep mode was invalid
|
||||||
|
* \retval 0 The operation completed successfully, sleep mode is set
|
||||||
|
*/
|
||||||
|
int32_t _set_sleep_mode(const uint8_t mode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Reset MCU
|
||||||
|
*/
|
||||||
|
void _reset_mcu(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Put MCU to sleep
|
||||||
|
*/
|
||||||
|
void _go_to_sleep(void);
|
||||||
|
//@}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/**@}*/
|
||||||
|
#endif /* _HPL_SLEEP_H_INCLUDED */
|
|
@ -0,0 +1,163 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief SPI related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_SPI_H_INCLUDED
|
||||||
|
#define _HPL_SPI_H_INCLUDED
|
||||||
|
|
||||||
|
#include <compiler.h>
|
||||||
|
#include <utils.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup hpl_spi HPL SPI
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief SPI Dummy char is used when reading data from the SPI slave
|
||||||
|
*/
|
||||||
|
#define SPI_DUMMY_CHAR 0x1ff
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief SPI message to let driver to process
|
||||||
|
*/
|
||||||
|
//@{
|
||||||
|
struct spi_msg {
|
||||||
|
/** Pointer to the output data buffer */
|
||||||
|
uint8_t *txbuf;
|
||||||
|
/** Pointer to the input data buffer */
|
||||||
|
uint8_t *rxbuf;
|
||||||
|
/** Size of the message data in SPI characters */
|
||||||
|
uint32_t size;
|
||||||
|
};
|
||||||
|
//@}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief SPI transfer modes
|
||||||
|
* SPI transfer mode controls clock polarity and clock phase.
|
||||||
|
* Mode 0: leading edge is rising edge, data sample on leading edge.
|
||||||
|
* Mode 1: leading edge is rising edge, data sample on trailing edge.
|
||||||
|
* Mode 2: leading edge is falling edge, data sample on leading edge.
|
||||||
|
* Mode 3: leading edge is falling edge, data sample on trailing edge.
|
||||||
|
*/
|
||||||
|
enum spi_transfer_mode {
|
||||||
|
/** Leading edge is rising edge, data sample on leading edge. */
|
||||||
|
SPI_MODE_0,
|
||||||
|
/** Leading edge is rising edge, data sample on trailing edge. */
|
||||||
|
SPI_MODE_1,
|
||||||
|
/** Leading edge is falling edge, data sample on leading edge. */
|
||||||
|
SPI_MODE_2,
|
||||||
|
/** Leading edge is falling edge, data sample on trailing edge. */
|
||||||
|
SPI_MODE_3
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief SPI character sizes
|
||||||
|
* The character size influence the way the data is sent/received.
|
||||||
|
* For char size <= 8 data is stored byte by byte.
|
||||||
|
* For char size between 9 ~ 16 data is stored in 2-byte length.
|
||||||
|
* Note that the default and recommended char size is 8 bit since it's
|
||||||
|
* supported by all system.
|
||||||
|
*/
|
||||||
|
enum spi_char_size {
|
||||||
|
/** Character size is 8 bit. */
|
||||||
|
SPI_CHAR_SIZE_8 = 0,
|
||||||
|
/** Character size is 9 bit. */
|
||||||
|
SPI_CHAR_SIZE_9 = 1,
|
||||||
|
/** Character size is 10 bit. */
|
||||||
|
SPI_CHAR_SIZE_10 = 2,
|
||||||
|
/** Character size is 11 bit. */
|
||||||
|
SPI_CHAR_SIZE_11 = 3,
|
||||||
|
/** Character size is 12 bit. */
|
||||||
|
SPI_CHAR_SIZE_12 = 4,
|
||||||
|
/** Character size is 13 bit. */
|
||||||
|
SPI_CHAR_SIZE_13 = 5,
|
||||||
|
/** Character size is 14 bit. */
|
||||||
|
SPI_CHAR_SIZE_14 = 6,
|
||||||
|
/** Character size is 15 bit. */
|
||||||
|
SPI_CHAR_SIZE_15 = 7,
|
||||||
|
/** Character size is 16 bit. */
|
||||||
|
SPI_CHAR_SIZE_16 = 8
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief SPI data order
|
||||||
|
*/
|
||||||
|
enum spi_data_order {
|
||||||
|
/** MSB goes first. */
|
||||||
|
SPI_DATA_ORDER_MSB_1ST = 0,
|
||||||
|
/** LSB goes first. */
|
||||||
|
SPI_DATA_ORDER_LSB_1ST = 1
|
||||||
|
};
|
||||||
|
|
||||||
|
/** \brief Transfer descriptor for SPI
|
||||||
|
* Transfer descriptor holds TX and RX buffers
|
||||||
|
*/
|
||||||
|
struct spi_xfer {
|
||||||
|
/** Pointer to data buffer to TX */
|
||||||
|
uint8_t *txbuf;
|
||||||
|
/** Pointer to data buffer to RX */
|
||||||
|
uint8_t *rxbuf;
|
||||||
|
/** Size of data characters to TX & RX */
|
||||||
|
uint32_t size;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** SPI generic driver. */
|
||||||
|
struct spi_dev {
|
||||||
|
/** Pointer to the hardware base or private data for special device. */
|
||||||
|
void *prvt;
|
||||||
|
/** Reference start of sync/async variables */
|
||||||
|
uint32_t sync_async_misc[1];
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Calculate the baudrate value for hardware to use to set baudrate
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] clk Clock frequency (Hz) for baudrate generation.
|
||||||
|
* \param[in] baud Target baudrate (bps).
|
||||||
|
* \return Error or baudrate value.
|
||||||
|
* \retval >0 Baudrate value.
|
||||||
|
* \retval ERR_INVALID_ARG Calculation fail.
|
||||||
|
*/
|
||||||
|
int32_t _spi_calc_baud_val(struct spi_dev *dev, const uint32_t clk, const uint32_t baud);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**@}*/
|
||||||
|
#endif /* ifndef _HPL_SPI_H_INCLUDED */
|
|
@ -0,0 +1,131 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief Common SPI related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_SPI_ASYNC_H_INCLUDED
|
||||||
|
#define _HPL_SPI_ASYNC_H_INCLUDED
|
||||||
|
|
||||||
|
#include <hpl_spi.h>
|
||||||
|
#include <hpl_irq.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup hpl_spi HPL SPI
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Callbacks the SPI driver must offer in async mode
|
||||||
|
*/
|
||||||
|
//@{
|
||||||
|
/** The callback types */
|
||||||
|
enum _spi_async_dev_cb_type {
|
||||||
|
/** Callback type for transmit, see \ref _spi_async_dev_cb_xfer_t. */
|
||||||
|
SPI_DEV_CB_TX,
|
||||||
|
/** Callback type for receive, see \ref _spi_async_dev_cb_xfer_t. */
|
||||||
|
SPI_DEV_CB_RX,
|
||||||
|
/** Callback type for \ref _spi_async_dev_cb_complete_t. */
|
||||||
|
SPI_DEV_CB_COMPLETE,
|
||||||
|
/** Callback type for error */
|
||||||
|
SPI_DEV_CB_ERROR,
|
||||||
|
/** Number of callbacks. */
|
||||||
|
SPI_DEV_CB_N
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _spi_async_dev;
|
||||||
|
|
||||||
|
/** \brief The prototype for callback on SPI transfer error.
|
||||||
|
* If status code is zero, it indicates the normal completion, that is,
|
||||||
|
* SS deactivation.
|
||||||
|
* If status code belows zero, it indicates complete.
|
||||||
|
*/
|
||||||
|
typedef void (*_spi_async_dev_cb_error_t)(struct _spi_async_dev *dev, int32_t status);
|
||||||
|
|
||||||
|
/** \brief The prototype for callback on SPI transmit/receive event
|
||||||
|
* For TX, the callback is invoked when transmit is done or ready to start
|
||||||
|
* transmit.
|
||||||
|
* For RX, the callback is invoked when receive is done or ready to read data,
|
||||||
|
* see \ref _spi_async_dev_read_one_t on data reading.
|
||||||
|
* Without DMA enabled, the callback is invoked on each character event.
|
||||||
|
* With DMA enabled, the callback is invoked on DMA buffer done.
|
||||||
|
*/
|
||||||
|
typedef void (*_spi_async_dev_cb_xfer_t)(struct _spi_async_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief The callbacks offered by SPI driver
|
||||||
|
*/
|
||||||
|
struct _spi_async_dev_callbacks {
|
||||||
|
/** TX callback, see \ref _spi_async_dev_cb_xfer_t. */
|
||||||
|
_spi_async_dev_cb_xfer_t tx;
|
||||||
|
/** RX callback, see \ref _spi_async_dev_cb_xfer_t. */
|
||||||
|
_spi_async_dev_cb_xfer_t rx;
|
||||||
|
/** Complete or complete callback, see \ref _spi_async_dev_cb_complete_t. */
|
||||||
|
_spi_async_dev_cb_xfer_t complete;
|
||||||
|
/** Error callback, see \ref */
|
||||||
|
_spi_async_dev_cb_error_t err;
|
||||||
|
};
|
||||||
|
//@}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief SPI async driver
|
||||||
|
*/
|
||||||
|
//@{
|
||||||
|
|
||||||
|
/** SPI driver to support async HAL */
|
||||||
|
struct _spi_async_dev {
|
||||||
|
/** Pointer to the hardware base or private data for special device. */
|
||||||
|
void *prvt;
|
||||||
|
/** Data size, number of bytes for each character */
|
||||||
|
uint8_t char_size;
|
||||||
|
/** Dummy byte used in master mode when reading the slave */
|
||||||
|
uint16_t dummy_byte;
|
||||||
|
|
||||||
|
/** \brief Pointer to callback functions, ignored for polling mode
|
||||||
|
* Pointer to the callback functions so that initialize the driver to
|
||||||
|
* handle interrupts.
|
||||||
|
*/
|
||||||
|
struct _spi_async_dev_callbacks callbacks;
|
||||||
|
/** IRQ instance for SPI device. */
|
||||||
|
struct _irq_descriptor irq;
|
||||||
|
};
|
||||||
|
//@}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**@}*/
|
||||||
|
#endif /* ifndef _HPL_SPI_ASYNC_H_INCLUDED */
|
|
@ -0,0 +1,88 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief Common SPI DMA related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_SPI_DMA_H_INCLUDED
|
||||||
|
#define _HPL_SPI_DMA_H_INCLUDED
|
||||||
|
|
||||||
|
#include <hpl_irq.h>
|
||||||
|
#include <hpl_dma.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** The callback types */
|
||||||
|
enum _spi_dma_dev_cb_type {
|
||||||
|
/** Callback type for DMA transmit. */
|
||||||
|
SPI_DEV_CB_DMA_TX,
|
||||||
|
/** Callback type for DMA receive. */
|
||||||
|
SPI_DEV_CB_DMA_RX,
|
||||||
|
/** Callback type for DMA error. */
|
||||||
|
SPI_DEV_CB_DMA_ERROR,
|
||||||
|
/** Number of callbacks. */
|
||||||
|
SPI_DEV_CB_DMA_N
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _spi_dma_dev;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief The prototype for callback on SPI DMA.
|
||||||
|
*/
|
||||||
|
typedef void (*_spi_dma_cb_t)(struct _dma_resource *resource);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief The callbacks offered by SPI driver
|
||||||
|
*/
|
||||||
|
struct _spi_dma_dev_callbacks {
|
||||||
|
_spi_dma_cb_t tx;
|
||||||
|
_spi_dma_cb_t rx;
|
||||||
|
_spi_dma_cb_t error;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** SPI driver to support DMA HAL */
|
||||||
|
struct _spi_dma_dev {
|
||||||
|
/** Pointer to the hardware base or private data for special device. */
|
||||||
|
void *prvt;
|
||||||
|
/** Pointer to callback functions */
|
||||||
|
struct _spi_dma_dev_callbacks callbacks;
|
||||||
|
/** IRQ instance for SPI device. */
|
||||||
|
struct _irq_descriptor irq;
|
||||||
|
/** DMA resource */
|
||||||
|
struct _dma_resource *resource;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* ifndef _HPL_SPI_DMA_H_INCLUDED */
|
|
@ -0,0 +1,243 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief SPI Slave Async related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_SPI_M_ASYNC_H_INCLUDED
|
||||||
|
#define _HPL_SPI_M_ASYNC_H_INCLUDED
|
||||||
|
|
||||||
|
#include <hpl_spi.h>
|
||||||
|
#include <hpl_spi_async.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup hpl_spi HPL SPI
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** Uses common SPI async device driver. */
|
||||||
|
#define _spi_m_async_dev _spi_async_dev
|
||||||
|
|
||||||
|
#define _spi_m_async_dev_cb_type _spi_async_dev_cb_type
|
||||||
|
|
||||||
|
/** Uses common SPI async device driver complete callback type. */
|
||||||
|
#define _spi_m_async_dev_cb_error_t _spi_async_dev_cb_error_t
|
||||||
|
|
||||||
|
/** Uses common SPI async device driver transfer callback type. */
|
||||||
|
#define _spi_m_async_dev_cb_xfer_t _spi_async_dev_cb_xfer_t
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \name HPL functions
|
||||||
|
*/
|
||||||
|
//@{
|
||||||
|
/**
|
||||||
|
* \brief Initialize SPI for access with interrupts
|
||||||
|
* It will load default hardware configuration and software struct.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] hw Pointer to the hardware base.
|
||||||
|
* \retval ERR_INVALID_ARG Input parameter problem.
|
||||||
|
* \retval ERR_BUSY SPI hardware not ready (resetting).
|
||||||
|
* \retval ERR_DENIED SPI has been enabled.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_async_init(struct _spi_m_async_dev *dev, void *const hw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize SPI for access with interrupts
|
||||||
|
* Disable, reset the hardware and the software struct.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_async_deinit(struct _spi_m_async_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable SPI for access with interrupts
|
||||||
|
* Enable the SPI and enable callback generation of receive and error
|
||||||
|
* interrupts.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_INVALID_ARG Input parameter problem.
|
||||||
|
* \retval ERR_BUSY SPI hardware not ready (resetting).
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_async_enable(struct _spi_m_async_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Disable SPI for access without interrupts
|
||||||
|
* Disable SPI and interrupts. Deactivate all CS pins if works as master.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_async_disable(struct _spi_m_async_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set SPI transfer mode
|
||||||
|
* Set SPI transfer mode (\ref spi_transfer_mode),
|
||||||
|
* which controls clock polarity and clock phase.
|
||||||
|
* Mode 0: leading edge is rising edge, data sample on leading edge.
|
||||||
|
* Mode 1: leading edge is rising edge, data sample on trailing edge.
|
||||||
|
* Mode 2: leading edge is falling edge, data sample on leading edge.
|
||||||
|
* Mode 3: leading edge is falling edge, data sample on trailing edge.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] mode The SPI transfer mode.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_BUSY SPI is not ready to accept new setting.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_async_set_mode(struct _spi_m_async_dev *dev, const enum spi_transfer_mode mode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set SPI baudrate
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] baud_val The SPI baudrate value, see \ref _spi_calc_baud_val() on
|
||||||
|
* how it's generated.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_BUSY SPI is not ready to accept new setting.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_async_set_baudrate(struct _spi_m_async_dev *dev, const uint32_t baud_val);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set SPI baudrate
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] char_size The character size, see \ref spi_char_size.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_INVALID_ARG The character size is not supported.
|
||||||
|
* \retval ERR_BUSY SPI is not ready to accept new setting.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_async_set_char_size(struct _spi_m_async_dev *dev, const enum spi_char_size char_size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set SPI data order
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] dord SPI data order (LSB/MSB first).
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_INVALID_ARG The character size is not supported.
|
||||||
|
* \retval ERR_BUSY SPI is not ready to accept new setting.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_async_set_data_order(struct _spi_m_async_dev *dev, const enum spi_data_order dord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable interrupt on character output
|
||||||
|
*
|
||||||
|
* Enable interrupt when a new character can be written
|
||||||
|
* to the SPI device.
|
||||||
|
*
|
||||||
|
* \param[in] dev Pointer to the SPI device instance
|
||||||
|
* \param[in] state true = enable output interrupt
|
||||||
|
* false = disable output interrupt
|
||||||
|
*
|
||||||
|
* \return Status code
|
||||||
|
* \retval 0 Ok status
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_async_enable_tx(struct _spi_m_async_dev *dev, bool state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable interrupt on character input
|
||||||
|
*
|
||||||
|
* Enable interrupt when a new character is ready to be
|
||||||
|
* read from the SPI device.
|
||||||
|
*
|
||||||
|
* \param[in] dev Pointer to the SPI device instance
|
||||||
|
* \param[in] state true = enable input interrupts
|
||||||
|
* false = disable input interrupt
|
||||||
|
*
|
||||||
|
* \return Status code
|
||||||
|
* \retvat 0 OK Status
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_async_enable_rx(struct _spi_m_async_dev *dev, bool state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable interrupt on after data transmission complate
|
||||||
|
*
|
||||||
|
* \param[in] dev Pointer to the SPI device instance
|
||||||
|
* \param[in] state true = enable input interrupts
|
||||||
|
* false = disable input interrupt
|
||||||
|
*
|
||||||
|
* \return Status code
|
||||||
|
* \retvat 0 OK Status
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_async_enable_tx_complete(struct _spi_m_async_dev *dev, bool state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Read one character to SPI device instance
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
*
|
||||||
|
* \return Character read from SPI module
|
||||||
|
*/
|
||||||
|
uint16_t _spi_m_async_read_one(struct _spi_m_async_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Write one character to assigned buffer
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] data
|
||||||
|
*
|
||||||
|
* \return Status code of write operation
|
||||||
|
* \retval 0 Write operation OK
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_async_write_one(struct _spi_m_async_dev *dev, uint16_t data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Register the SPI device callback
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] cb_type The callback type.
|
||||||
|
* \param[in] func The callback function to register. NULL to disable callback.
|
||||||
|
* \return Always 0.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_async_register_callback(struct _spi_m_async_dev *dev, const enum _spi_m_async_dev_cb_type cb_type,
|
||||||
|
const FUNC_PTR func);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable/disable SPI master interrupt
|
||||||
|
*
|
||||||
|
* param[in] device The pointer to SPI master device instance
|
||||||
|
* param[in] type The type of interrupt to disable/enable if applicable
|
||||||
|
* param[in] state Enable or disable
|
||||||
|
*/
|
||||||
|
void _spi_m_async_set_irq_state(struct _spi_m_async_dev *const device, const enum _spi_m_async_dev_cb_type type,
|
||||||
|
const bool state);
|
||||||
|
//@}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**@}*/
|
||||||
|
#endif /* ifndef _HPL_SPI_M_ASYNC_H_INCLUDED */
|
|
@ -0,0 +1,182 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief SPI Master DMA related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_SPI_M_DMA_H_INCLUDED
|
||||||
|
#define _HPL_SPI_M_DMA_H_INCLUDED
|
||||||
|
|
||||||
|
#include <hpl_spi.h>
|
||||||
|
#include <hpl_spi_dma.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup hpl_spi HPL SPI
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** Uses common SPI dma device driver. */
|
||||||
|
#define _spi_m_dma_dev _spi_dma_dev
|
||||||
|
|
||||||
|
#define _spi_m_dma_dev_cb_type _spi_dma_dev_cb_type
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \name HPL functions
|
||||||
|
*/
|
||||||
|
//@{
|
||||||
|
/**
|
||||||
|
* \brief Initialize SPI for access with interrupts
|
||||||
|
* It will load default hardware configuration and software struct.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] hw Pointer to the hardware base.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_INVALID_ARG Input parameter problem.
|
||||||
|
* \retval ERR_BUSY SPI hardware not ready (resetting).
|
||||||
|
* \retval ERR_DENIED SPI has been enabled.
|
||||||
|
* \retval 0 ERR_NONE is operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_dma_init(struct _spi_m_dma_dev *dev, void *const hw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize SPI for access with interrupts
|
||||||
|
* Disable, reset the hardware and the software struct.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval 0 ERR_NONE is operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_dma_deinit(struct _spi_m_dma_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable SPI for access with interrupts
|
||||||
|
* Enable the SPI and enable callback generation of receive and error
|
||||||
|
* interrupts.
|
||||||
|
* \param[in] dev Pointer to the SPI device instance.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_INVALID_ARG Input parameter problem.
|
||||||
|
* \retval ERR_BUSY SPI hardware not ready (resetting).
|
||||||
|
* \retval 0 ERR_NONE is operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_dma_enable(struct _spi_m_dma_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Disable SPI for access without interrupts
|
||||||
|
* Disable SPI and interrupts. Deactivate all CS pins if works as master.
|
||||||
|
* \param[in] dev Pointer to the SPI device instance.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval 0 ERR_NONE is operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_dma_disable(struct _spi_m_dma_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set SPI transfer mode
|
||||||
|
* Set SPI transfer mode (\ref spi_transfer_mode),
|
||||||
|
* which controls clock polarity and clock phase.
|
||||||
|
* Mode 0: leading edge is rising edge, data sample on leading edge.
|
||||||
|
* Mode 1: leading edge is rising edge, data sample on trailing edge.
|
||||||
|
* Mode 2: leading edge is falling edge, data sample on leading edge.
|
||||||
|
* Mode 3: leading edge is falling edge, data sample on trailing edge.
|
||||||
|
* \param[in] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] mode The SPI transfer mode.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_BUSY SPI is not ready to accept new setting.
|
||||||
|
* \retval 0 ERR_NONE is operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_dma_set_mode(struct _spi_m_dma_dev *dev, const enum spi_transfer_mode mode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set SPI baudrate
|
||||||
|
* \param[in] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] baud_val The SPI baudrate value, see \ref _spi_calc_baud_val() on
|
||||||
|
* how it's generated.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_BUSY SPI is not ready to accept new setting.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_dma_set_baudrate(struct _spi_m_dma_dev *dev, const uint32_t baud_val);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set SPI baudrate
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] char_size The character size, see \ref spi_char_size.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_INVALID_ARG The character size is not supported.
|
||||||
|
* \retval ERR_BUSY SPI is not ready to accept new setting.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_dma_set_char_size(struct _spi_m_dma_dev *dev, const enum spi_char_size char_size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set SPI data order
|
||||||
|
* \param[in] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] dord SPI data order (LSB/MSB first).
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_INVALID_ARG The character size is not supported.
|
||||||
|
* \retval ERR_BUSY SPI is not ready to accept new setting.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_dma_set_data_order(struct _spi_m_dma_dev *dev, const enum spi_data_order dord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Register the SPI device callback
|
||||||
|
* \param[in] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] cb_type The callback type.
|
||||||
|
* \param[in] func The callback function to register. NULL to disable callback.
|
||||||
|
* \return Always 0.
|
||||||
|
*/
|
||||||
|
void _spi_m_dma_register_callback(struct _spi_m_dma_dev *dev, enum _spi_dma_dev_cb_type, _spi_dma_cb_t func);
|
||||||
|
|
||||||
|
/** \brief Do SPI data transfer (TX & RX) with DMA
|
||||||
|
* Log the TX & RX buffers and transfer them in background. It never blocks.
|
||||||
|
*
|
||||||
|
* \param[in] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] txbuf Pointer to the transfer information (\ref spi_transfer).
|
||||||
|
* \param[out] rxbuf Pointer to the receiver information (\ref spi_receive).
|
||||||
|
* \param[in] length spi transfer data length.
|
||||||
|
*
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_NONE Success.
|
||||||
|
* \retval ERR_BUSY Busy.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_dma_transfer(struct _spi_m_dma_dev *dev, uint8_t const *txbuf, uint8_t *const rxbuf,
|
||||||
|
const uint16_t length);
|
||||||
|
//@}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**@}*/
|
||||||
|
#endif /* ifndef _HPL_SPI_M_DMA_H_INCLUDED */
|
|
@ -0,0 +1,166 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief SPI related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_SPI_M_SYNC_H_INCLUDED
|
||||||
|
#define _HPL_SPI_M_SYNC_H_INCLUDED
|
||||||
|
|
||||||
|
#include <hpl_spi.h>
|
||||||
|
#include <hpl_spi_sync.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup hpl_spi HPL SPI
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** Uses common SPI sync device driver. */
|
||||||
|
#define _spi_m_sync_dev _spi_sync_dev
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \name HPL functions
|
||||||
|
*/
|
||||||
|
//@{
|
||||||
|
/**
|
||||||
|
* \brief Initialize SPI for access without interrupts
|
||||||
|
* It will load default hardware configuration and software struct.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] hw Pointer to the hardware base.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_INVALID_ARG Input parameter problem.
|
||||||
|
* \retval ERR_BUSY SPI hardware not ready (resetting).
|
||||||
|
* \retval ERR_DENIED SPI has been enabled.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_sync_init(struct _spi_m_sync_dev *dev, void *const hw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Deinitialize SPI
|
||||||
|
* Disable, reset the hardware and the software struct.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_sync_deinit(struct _spi_m_sync_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable SPI for access without interrupts
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_BUSY SPI hardware not ready (resetting).
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_sync_enable(struct _spi_m_sync_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Disable SPI for access without interrupts
|
||||||
|
* Disable SPI. Deactivate all CS pins if works as master.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_sync_disable(struct _spi_m_sync_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set SPI transfer mode
|
||||||
|
* Set SPI transfer mode (\ref spi_transfer_mode),
|
||||||
|
* which controls clock polarity and clock phase.
|
||||||
|
* Mode 0: leading edge is rising edge, data sample on leading edge.
|
||||||
|
* Mode 1: leading edge is rising edge, data sample on trailing edge.
|
||||||
|
* Mode 2: leading edge is falling edge, data sample on leading edge.
|
||||||
|
* Mode 3: leading edge is falling edge, data sample on trailing edge.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] mode The SPI transfer mode.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_BUSY SPI is not ready to accept new setting.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_sync_set_mode(struct _spi_m_sync_dev *dev, const enum spi_transfer_mode mode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set SPI baudrate
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] baud_val The SPI baudrate value, see \ref _spi_calc_baud_val() on
|
||||||
|
* how it's generated.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_BUSY SPI is not ready to accept new setting.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_sync_set_baudrate(struct _spi_m_sync_dev *dev, const uint32_t baud_val);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set SPI char size
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] char_size The character size, see \ref spi_char_size.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_INVALID_ARG The character size is not supported.
|
||||||
|
* \retval ERR_BUSY SPI is not ready to accept new setting.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_sync_set_char_size(struct _spi_m_sync_dev *dev, const enum spi_char_size char_size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set SPI data order
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] dord SPI data order (LSB/MSB first).
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_INVALID_ARG The character size is not supported.
|
||||||
|
* \retval ERR_BUSY SPI is not ready to accept new setting.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_sync_set_data_order(struct _spi_m_sync_dev *dev, const enum spi_data_order dord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Transfer the whole message without interrupt
|
||||||
|
* Transfer the message, it will keep waiting until the message finish or
|
||||||
|
* error.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] msg Pointer to the message instance to process.
|
||||||
|
* \return Error or number of characters transferred.
|
||||||
|
* \retval ERR_BUSY SPI hardware is not ready to start transfer (not
|
||||||
|
* enabled, busy applying settings, ...).
|
||||||
|
* \retval SPI_ERR_OVERFLOW Overflow error.
|
||||||
|
* \retval >=0 Number of characters transferred.
|
||||||
|
*/
|
||||||
|
int32_t _spi_m_sync_trans(struct _spi_m_sync_dev *dev, const struct spi_msg *msg);
|
||||||
|
//@}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**@}*/
|
||||||
|
#endif /* ifndef _HPL_SPI_M_SYNC_H_INCLUDED */
|
|
@ -0,0 +1,232 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief SPI Slave Async related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_SPI_S_ASYNC_H_INCLUDED
|
||||||
|
#define _HPL_SPI_S_ASYNC_H_INCLUDED
|
||||||
|
|
||||||
|
#include <hpl_spi_async.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup hpl_spi HPL SPI
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** Uses common SPI async device driver. */
|
||||||
|
#define _spi_s_async_dev _spi_async_dev
|
||||||
|
|
||||||
|
#define _spi_s_async_dev_cb_type _spi_async_dev_cb_type
|
||||||
|
|
||||||
|
/** Uses common SPI async device driver complete callback type. */
|
||||||
|
#define _spi_m_async_dev_cb_error_t _spi_async_dev_cb_error_t
|
||||||
|
|
||||||
|
/** Uses common SPI async device driver transfer callback type. */
|
||||||
|
#define _spi_s_async_dev_cb_xfer_t _spi_async_dev_cb_xfer_t
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \name HPL functions
|
||||||
|
*/
|
||||||
|
//@{
|
||||||
|
/**
|
||||||
|
* \brief Initialize SPI for access with interrupts
|
||||||
|
* It will load default hardware configuration and software struct.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] hw Pointer to the hardware base.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_INVALID_ARG Input parameter problem.
|
||||||
|
* \retval ERR_BUSY SPI hardware not ready (resetting).
|
||||||
|
* \retval ERR_DENIED SPI has been enabled.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_async_init(struct _spi_s_async_dev *dev, void *const hw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize SPI for access with interrupts
|
||||||
|
* Disable, reset the hardware and the software struct.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_async_deinit(struct _spi_s_async_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable SPI for access with interrupts
|
||||||
|
* Enable the SPI and enable callback generation of receive and error
|
||||||
|
* interrupts.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_INVALID_ARG Input parameter problem.
|
||||||
|
* \retval ERR_BUSY SPI hardware not ready (resetting).
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_async_enable(struct _spi_s_async_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Disable SPI for access without interrupts
|
||||||
|
* Disable SPI and interrupts. Deactivate all CS pins if works as master.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_async_disable(struct _spi_s_async_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set SPI transfer mode
|
||||||
|
* Set SPI transfer mode (\ref spi_transfer_mode),
|
||||||
|
* which controls clock polarity and clock phase.
|
||||||
|
* Mode 0: leading edge is rising edge, data sample on leading edge.
|
||||||
|
* Mode 1: leading edge is rising edge, data sample on trailing edge.
|
||||||
|
* Mode 2: leading edge is falling edge, data sample on leading edge.
|
||||||
|
* Mode 3: leading edge is falling edge, data sample on trailing edge.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] mode The SPI transfer mode.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_BUSY SPI is not ready to accept new setting.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_async_set_mode(struct _spi_s_async_dev *dev, const enum spi_transfer_mode mode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set SPI baudrate
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] char_size The character size, see \ref spi_char_size.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_INVALID_ARG The character size is not supported.
|
||||||
|
* \retval ERR_BUSY SPI is not ready to accept new setting.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_async_set_char_size(struct _spi_s_async_dev *dev, const enum spi_char_size char_size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set SPI data order
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] dord SPI data order (LSB/MSB first).
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_INVALID_ARG The character size is not supported.
|
||||||
|
* \retval ERR_BUSY SPI is not ready to accept new setting.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_async_set_data_order(struct _spi_s_async_dev *dev, const enum spi_data_order dord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable interrupt on character output
|
||||||
|
*
|
||||||
|
* Enable interrupt when a new character can be written
|
||||||
|
* to the SPI device.
|
||||||
|
*
|
||||||
|
* \param[in] dev Pointer to the SPI device instance
|
||||||
|
* \param[in] state true = enable output interrupt
|
||||||
|
* false = disable output interrupt
|
||||||
|
*
|
||||||
|
* \return Status code
|
||||||
|
* \retval 0 Ok status
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_async_enable_tx(struct _spi_s_async_dev *dev, bool state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable interrupt on character input
|
||||||
|
*
|
||||||
|
* Enable interrupt when a new character is ready to be
|
||||||
|
* read from the SPI device.
|
||||||
|
*
|
||||||
|
* \param[in] dev Pointer to the SPI device instance
|
||||||
|
* \param[in] state true = enable input interrupts
|
||||||
|
* false = disable input interrupt
|
||||||
|
*
|
||||||
|
* \return Status code
|
||||||
|
* \retvat 0 OK Status
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_async_enable_rx(struct _spi_s_async_dev *dev, bool state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable interrupt on Slave Select (SS) rising
|
||||||
|
*
|
||||||
|
* \param[in] dev Pointer to the SPI device instance
|
||||||
|
* \param[in] state true = enable input interrupts
|
||||||
|
* false = disable input interrupt
|
||||||
|
*
|
||||||
|
* \return Status code
|
||||||
|
* \retvat 0 OK Status
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_async_enable_ss_detect(struct _spi_s_async_dev *dev, bool state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Read one character to SPI device instance
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
*
|
||||||
|
* \return Character read from SPI module
|
||||||
|
*/
|
||||||
|
uint16_t _spi_s_async_read_one(struct _spi_s_async_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Write one character to assigned buffer
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] data
|
||||||
|
*
|
||||||
|
* \return Status code of write operation
|
||||||
|
* \retval 0 Write operation OK
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_async_write_one(struct _spi_s_async_dev *dev, uint16_t data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Register the SPI device callback
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] cb_type The callback type.
|
||||||
|
* \param[in] func The callback function to register. NULL to disable callback.
|
||||||
|
* \return Always 0.
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_async_register_callback(struct _spi_s_async_dev *dev, const enum _spi_s_async_dev_cb_type cb_type,
|
||||||
|
const FUNC_PTR func);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable/disable SPI slave interrupt
|
||||||
|
*
|
||||||
|
* param[in] device The pointer to SPI slave device instance
|
||||||
|
* param[in] type The type of interrupt to disable/enable if applicable
|
||||||
|
* param[in] state Enable or disable
|
||||||
|
*/
|
||||||
|
void _spi_s_async_set_irq_state(struct _spi_s_async_dev *const device, const enum _spi_async_dev_cb_type type,
|
||||||
|
const bool state);
|
||||||
|
//@}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**@}*/
|
||||||
|
#endif /* ifndef _HPL_SPI_S_ASYNC_H_INCLUDED */
|
|
@ -0,0 +1,232 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief SPI related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_SPI_S_SYNC_H_INCLUDED
|
||||||
|
#define _HPL_SPI_S_SYNC_H_INCLUDED
|
||||||
|
|
||||||
|
#include <hpl_spi_sync.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup hpl_spi HPL SPI
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** Uses common SPI sync device driver. */
|
||||||
|
#define _spi_s_sync_dev _spi_sync_dev
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \name HPL functions
|
||||||
|
*/
|
||||||
|
//@{
|
||||||
|
/**
|
||||||
|
* \brief Initialize SPI for access without interrupts
|
||||||
|
* It will load default hardware configuration and software struct.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] hw Pointer to the hardware base.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_INVALID_ARG Input parameter problem.
|
||||||
|
* \retval ERR_BUSY SPI hardware not ready (resetting).
|
||||||
|
* \retval ERR_DENIED SPI has been enabled.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_sync_init(struct _spi_s_sync_dev *dev, void *const hw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize SPI for access with interrupts
|
||||||
|
* Disable, reset the hardware and the software struct.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_sync_deinit(struct _spi_s_sync_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable SPI for access without interrupts
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_BUSY SPI hardware not ready (resetting).
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_sync_enable(struct _spi_s_sync_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Disable SPI for access without interrupts
|
||||||
|
* Disable SPI. Deactivate all CS pins if works as master.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_sync_disable(struct _spi_s_sync_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set SPI transfer mode
|
||||||
|
* Set SPI transfer mode (\ref spi_transfer_mode),
|
||||||
|
* which controls clock polarity and clock phase.
|
||||||
|
* Mode 0: leading edge is rising edge, data sample on leading edge.
|
||||||
|
* Mode 1: leading edge is rising edge, data sample on trailing edge.
|
||||||
|
* Mode 2: leading edge is falling edge, data sample on leading edge.
|
||||||
|
* Mode 3: leading edge is falling edge, data sample on trailing edge.
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] mode The SPI transfer mode.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_BUSY SPI is not ready to accept new setting.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_sync_set_mode(struct _spi_s_sync_dev *dev, const enum spi_transfer_mode mode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set SPI baudrate
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] char_size The character size, see \ref spi_char_size.
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_INVALID_ARG The character size is not supported.
|
||||||
|
* \retval ERR_BUSY SPI is not ready to accept new setting.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_sync_set_char_size(struct _spi_s_sync_dev *dev, const enum spi_char_size char_size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set SPI data order
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] dord SPI data order (LSB/MSB first).
|
||||||
|
* \return Operation status.
|
||||||
|
* \retval ERR_INVALID_ARG The character size is not supported.
|
||||||
|
* \retval ERR_BUSY SPI is not ready to accept new setting.
|
||||||
|
* \retval 0 Operation done successfully.
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_sync_set_data_order(struct _spi_s_sync_dev *dev, const enum spi_data_order dord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable interrupt on character output
|
||||||
|
*
|
||||||
|
* Enable interrupt when a new character can be written
|
||||||
|
* to the SPI device.
|
||||||
|
*
|
||||||
|
* \param[in] dev Pointer to the SPI device instance
|
||||||
|
* \param[in] state true = enable output interrupt
|
||||||
|
* false = disable output interrupt
|
||||||
|
*
|
||||||
|
* \return Status code
|
||||||
|
* \retval 0 Ok status
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_sync_enable_tx(struct _spi_s_sync_dev *dev, bool state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable interrupt on character input
|
||||||
|
*
|
||||||
|
* Enable interrupt when a new character is ready to be
|
||||||
|
* read from the SPI device.
|
||||||
|
*
|
||||||
|
* \param[in] dev Pointer to the SPI device instance
|
||||||
|
* \param[in] state true = enable input interrupts
|
||||||
|
* false = disable input interrupt
|
||||||
|
*
|
||||||
|
* \return Status code
|
||||||
|
* \retval 0 OK Status
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_sync_enable_rx(struct _spi_s_sync_dev *dev, bool state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Read one character to SPI device instance
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
*
|
||||||
|
* \return Character read from SPI module
|
||||||
|
*/
|
||||||
|
uint16_t _spi_s_sync_read_one(struct _spi_s_sync_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Write one character to assigned buffer
|
||||||
|
* \param[in, out] dev Pointer to the SPI device instance.
|
||||||
|
* \param[in] data
|
||||||
|
*
|
||||||
|
* \return Status code of write operation
|
||||||
|
* \retval 0 Write operation OK
|
||||||
|
*/
|
||||||
|
int32_t _spi_s_sync_write_one(struct _spi_s_sync_dev *dev, uint16_t data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Check if TX ready
|
||||||
|
*
|
||||||
|
* \param[in] dev Pointer to the SPI device instance
|
||||||
|
*
|
||||||
|
* \return TX ready state
|
||||||
|
* \retval true TX ready
|
||||||
|
* \retval false TX not ready
|
||||||
|
*/
|
||||||
|
bool _spi_s_sync_is_tx_ready(struct _spi_s_sync_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Check if RX character ready
|
||||||
|
*
|
||||||
|
* \param[in] dev Pointer to the SPI device instance
|
||||||
|
*
|
||||||
|
* \return RX character ready state
|
||||||
|
* \retval true RX character ready
|
||||||
|
* \retval false RX character not ready
|
||||||
|
*/
|
||||||
|
bool _spi_s_sync_is_rx_ready(struct _spi_s_sync_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Check if SS deactiviation detected
|
||||||
|
*
|
||||||
|
* \param[in] dev Pointer to the SPI device instance
|
||||||
|
*
|
||||||
|
* \return SS deactiviation state
|
||||||
|
* \retval true SS deactiviation detected
|
||||||
|
* \retval false SS deactiviation not detected
|
||||||
|
*/
|
||||||
|
bool _spi_s_sync_is_ss_deactivated(struct _spi_s_sync_dev *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Check if error is detected
|
||||||
|
*
|
||||||
|
* \param[in] dev Pointer to the SPI device instance
|
||||||
|
*
|
||||||
|
* \return Error detection state
|
||||||
|
* \retval true Error detected
|
||||||
|
* \retval false Error not detected
|
||||||
|
*/
|
||||||
|
bool _spi_s_sync_is_error(struct _spi_s_sync_dev *dev);
|
||||||
|
//@}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**@}*/
|
||||||
|
#endif /* ifndef _HPL_SPI_S_SYNC_H_INCLUDED */
|
|
@ -0,0 +1,70 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief Common SPI related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_SPI_SYNC_H_INCLUDED
|
||||||
|
#define _HPL_SPI_SYNC_H_INCLUDED
|
||||||
|
|
||||||
|
#include <compiler.h>
|
||||||
|
#include <utils.h>
|
||||||
|
|
||||||
|
#include <hpl_spi.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup hpl_spi HPL SPI
|
||||||
|
*
|
||||||
|
* \section hpl_spi_rev Revision History
|
||||||
|
* - v1.0.0 Initial Release
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** SPI driver to support sync HAL */
|
||||||
|
struct _spi_sync_dev {
|
||||||
|
/** Pointer to the hardware base or private data for special device. */
|
||||||
|
void *prvt;
|
||||||
|
/** Data size, number of bytes for each character */
|
||||||
|
uint8_t char_size;
|
||||||
|
/** Dummy byte used in master mode when reading the slave */
|
||||||
|
uint16_t dummy_byte;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**@}*/
|
||||||
|
#endif /* ifndef _HPL_SPI_SYNC_H_INCLUDED */
|
|
@ -0,0 +1,113 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief USART related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_USART_H_INCLUDED
|
||||||
|
#define _HPL_USART_H_INCLUDED
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup HPL USART SYNC
|
||||||
|
*
|
||||||
|
* \section hpl_usart_sync_rev Revision History
|
||||||
|
* - v1.0.0 Initial Release
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <compiler.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief USART flow control state
|
||||||
|
*/
|
||||||
|
union usart_flow_control_state {
|
||||||
|
struct {
|
||||||
|
uint8_t cts : 1;
|
||||||
|
uint8_t rts : 1;
|
||||||
|
uint8_t unavailable : 1;
|
||||||
|
uint8_t reserved : 5;
|
||||||
|
} bit;
|
||||||
|
uint8_t value;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief USART baud rate mode
|
||||||
|
*/
|
||||||
|
enum usart_baud_rate_mode { USART_BAUDRATE_ASYNCH_ARITHMETIC, USART_BAUDRATE_ASYNCH_FRACTIONAL, USART_BAUDRATE_SYNCH };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief USART data order
|
||||||
|
*/
|
||||||
|
enum usart_data_order { USART_DATA_ORDER_MSB = 0, USART_DATA_ORDER_LSB = 1 };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief USART mode
|
||||||
|
*/
|
||||||
|
enum usart_mode { USART_MODE_ASYNCHRONOUS = 0, USART_MODE_SYNCHRONOUS = 1 };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief USART parity
|
||||||
|
*/
|
||||||
|
enum usart_parity {
|
||||||
|
USART_PARITY_EVEN = 0,
|
||||||
|
USART_PARITY_ODD = 1,
|
||||||
|
USART_PARITY_NONE = 2,
|
||||||
|
USART_PARITY_SPACE = 3,
|
||||||
|
USART_PARITY_MARK = 4
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief USART stop bits mode
|
||||||
|
*/
|
||||||
|
enum usart_stop_bits { USART_STOP_BITS_ONE = 0, USART_STOP_BITS_TWO = 1, USART_STOP_BITS_ONE_P_FIVE = 2 };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief USART character size
|
||||||
|
*/
|
||||||
|
enum usart_character_size {
|
||||||
|
USART_CHARACTER_SIZE_8BITS = 0,
|
||||||
|
USART_CHARACTER_SIZE_9BITS = 1,
|
||||||
|
USART_CHARACTER_SIZE_5BITS = 5,
|
||||||
|
USART_CHARACTER_SIZE_6BITS = 6,
|
||||||
|
USART_CHARACTER_SIZE_7BITS = 7
|
||||||
|
};
|
||||||
|
|
||||||
|
//@}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/**@}*/
|
||||||
|
#endif /* _HPL_USART_H_INCLUDED */
|
|
@ -0,0 +1,270 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief USART related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_USART_ASYNC_H_INCLUDED
|
||||||
|
#define _HPL_USART_ASYNC_H_INCLUDED
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup HPL USART
|
||||||
|
*
|
||||||
|
* \section hpl_usart_rev Revision History
|
||||||
|
* - v1.0.0 Initial Release
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "hpl_usart.h"
|
||||||
|
#include "hpl_irq.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief USART callback types
|
||||||
|
*/
|
||||||
|
enum _usart_async_callback_type { USART_ASYNC_BYTE_SENT, USART_ASYNC_RX_DONE, USART_ASYNC_TX_DONE, USART_ASYNC_ERROR };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief USART device structure
|
||||||
|
*
|
||||||
|
* The USART device structure forward declaration.
|
||||||
|
*/
|
||||||
|
struct _usart_async_device;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief USART interrupt callbacks
|
||||||
|
*/
|
||||||
|
struct _usart_async_callbacks {
|
||||||
|
void (*tx_byte_sent)(struct _usart_async_device *device);
|
||||||
|
void (*rx_done_cb)(struct _usart_async_device *device, uint8_t data);
|
||||||
|
void (*tx_done_cb)(struct _usart_async_device *device);
|
||||||
|
void (*error_cb)(struct _usart_async_device *device);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief USART descriptor device structure
|
||||||
|
*/
|
||||||
|
struct _usart_async_device {
|
||||||
|
struct _usart_async_callbacks usart_cb;
|
||||||
|
struct _irq_descriptor irq;
|
||||||
|
void * hw;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* \name HPL functions
|
||||||
|
*/
|
||||||
|
//@{
|
||||||
|
/**
|
||||||
|
* \brief Initialize asynchronous USART
|
||||||
|
*
|
||||||
|
* This function does low level USART configuration.
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
* \param[in] hw The pointer to hardware instance
|
||||||
|
*
|
||||||
|
* \return Initialization status
|
||||||
|
*/
|
||||||
|
int32_t _usart_async_init(struct _usart_async_device *const device, void *const hw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Deinitialize USART
|
||||||
|
*
|
||||||
|
* This function closes the given USART by disabling its clock.
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
*/
|
||||||
|
void _usart_async_deinit(struct _usart_async_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable usart module
|
||||||
|
*
|
||||||
|
* This function will enable the usart module
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
*/
|
||||||
|
void _usart_async_enable(struct _usart_async_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Disable usart module
|
||||||
|
*
|
||||||
|
* This function will disable the usart module
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
*/
|
||||||
|
void _usart_async_disable(struct _usart_async_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Calculate baud rate register value
|
||||||
|
*
|
||||||
|
* \param[in] baud Required baud rate
|
||||||
|
* \param[in] clock_rate clock frequency
|
||||||
|
* \param[in] samples The number of samples
|
||||||
|
* \param[in] mode USART mode
|
||||||
|
* \param[in] fraction A fraction value
|
||||||
|
*
|
||||||
|
* \return Calculated baud rate register value
|
||||||
|
*/
|
||||||
|
uint16_t _usart_async_calculate_baud_rate(const uint32_t baud, const uint32_t clock_rate, const uint8_t samples,
|
||||||
|
const enum usart_baud_rate_mode mode, const uint8_t fraction);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set baud rate
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
* \param[in] baud_rate A baud rate to set
|
||||||
|
*/
|
||||||
|
void _usart_async_set_baud_rate(struct _usart_async_device *const device, const uint32_t baud_rate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set data order
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
* \param[in] order A data order to set
|
||||||
|
*/
|
||||||
|
void _usart_async_set_data_order(struct _usart_async_device *const device, const enum usart_data_order order);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set mode
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
* \param[in] mode A mode to set
|
||||||
|
*/
|
||||||
|
void _usart_async_set_mode(struct _usart_async_device *const device, const enum usart_mode mode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set parity
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
* \param[in] parity A parity to set
|
||||||
|
*/
|
||||||
|
void _usart_async_set_parity(struct _usart_async_device *const device, const enum usart_parity parity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set stop bits mode
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
* \param[in] stop_bits A stop bits mode to set
|
||||||
|
*/
|
||||||
|
void _usart_async_set_stop_bits(struct _usart_async_device *const device, const enum usart_stop_bits stop_bits);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set character size
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
* \param[in] size A character size to set
|
||||||
|
*/
|
||||||
|
void _usart_async_set_character_size(struct _usart_async_device *const device, const enum usart_character_size size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieve usart status
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
*/
|
||||||
|
uint32_t _usart_async_get_status(const struct _usart_async_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Write a byte to the given USART instance
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
* \param[in] data Data to write
|
||||||
|
*/
|
||||||
|
void _usart_async_write_byte(struct _usart_async_device *const device, uint8_t data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Check if USART is ready to send next byte
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
*
|
||||||
|
* \return Status of the ready check.
|
||||||
|
* \retval true if the USART is ready to send next byte
|
||||||
|
* \retval false if the USART is not ready to send next byte
|
||||||
|
*/
|
||||||
|
bool _usart_async_is_byte_sent(const struct _usart_async_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set the state of flow control pins
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
* \param[in] state - A state of flow control pins to set
|
||||||
|
*/
|
||||||
|
void _usart_async_set_flow_control_state(struct _usart_async_device *const device,
|
||||||
|
const union usart_flow_control_state state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieve the state of flow control pins
|
||||||
|
*
|
||||||
|
* This function retrieves the of flow control pins.
|
||||||
|
*
|
||||||
|
* \return USART_FLOW_CONTROL_STATE_UNAVAILABLE.
|
||||||
|
*/
|
||||||
|
union usart_flow_control_state _usart_async_get_flow_control_state(const struct _usart_async_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable data register empty interrupt
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
*/
|
||||||
|
void _usart_async_enable_byte_sent_irq(struct _usart_async_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable transmission complete interrupt
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
*/
|
||||||
|
void _usart_async_enable_tx_done_irq(struct _usart_async_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieve ordinal number of the given USART hardware instance
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
*
|
||||||
|
* \return The ordinal number of the given USART hardware instance
|
||||||
|
*/
|
||||||
|
uint8_t _usart_async_get_hardware_index(const struct _usart_async_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable/disable USART interrupt
|
||||||
|
*
|
||||||
|
* param[in] device The pointer to USART device instance
|
||||||
|
* param[in] type The type of interrupt to disable/enable if applicable
|
||||||
|
* param[in] state Enable or disable
|
||||||
|
*/
|
||||||
|
void _usart_async_set_irq_state(struct _usart_async_device *const device, const enum _usart_async_callback_type type,
|
||||||
|
const bool state);
|
||||||
|
//@}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/**@}*/
|
||||||
|
#endif /* _HPL_USART_ASYNC_H_INCLUDED */
|
|
@ -0,0 +1,254 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief USART related functionality declaration.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _HPL_SYNC_USART_H_INCLUDED
|
||||||
|
#define _HPL_SYNC_USART_H_INCLUDED
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \addtogroup HPL USART SYNC
|
||||||
|
*
|
||||||
|
* \section hpl_usart_sync_rev Revision History
|
||||||
|
* - v1.0.0 Initial Release
|
||||||
|
*
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <hpl_usart.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief USART descriptor device structure
|
||||||
|
*/
|
||||||
|
struct _usart_sync_device {
|
||||||
|
void *hw;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \name HPL functions
|
||||||
|
*/
|
||||||
|
//@{
|
||||||
|
/**
|
||||||
|
* \brief Initialize synchronous USART
|
||||||
|
*
|
||||||
|
* This function does low level USART configuration.
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
* \param[in] hw The pointer to hardware instance
|
||||||
|
*
|
||||||
|
* \return Initialization status
|
||||||
|
*/
|
||||||
|
int32_t _usart_sync_init(struct _usart_sync_device *const device, void *const hw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Deinitialize USART
|
||||||
|
*
|
||||||
|
* This function closes the given USART by disabling its clock.
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
*/
|
||||||
|
void _usart_sync_deinit(struct _usart_sync_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable usart module
|
||||||
|
*
|
||||||
|
* This function will enable the usart module
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
*/
|
||||||
|
void _usart_sync_enable(struct _usart_sync_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Disable usart module
|
||||||
|
*
|
||||||
|
* This function will disable the usart module
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
*/
|
||||||
|
void _usart_sync_disable(struct _usart_sync_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Calculate baud rate register value
|
||||||
|
*
|
||||||
|
* \param[in] baud Required baud rate
|
||||||
|
* \param[in] clock_rate clock frequency
|
||||||
|
* \param[in] samples The number of samples
|
||||||
|
* \param[in] mode USART mode
|
||||||
|
* \param[in] fraction A fraction value
|
||||||
|
*
|
||||||
|
* \return Calculated baud rate register value
|
||||||
|
*/
|
||||||
|
uint16_t _usart_sync_calculate_baud_rate(const uint32_t baud, const uint32_t clock_rate, const uint8_t samples,
|
||||||
|
const enum usart_baud_rate_mode mode, const uint8_t fraction);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set baud rate
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
* \param[in] baud_rate A baud rate to set
|
||||||
|
*/
|
||||||
|
void _usart_sync_set_baud_rate(struct _usart_sync_device *const device, const uint32_t baud_rate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set data order
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
* \param[in] order A data order to set
|
||||||
|
*/
|
||||||
|
void _usart_sync_set_data_order(struct _usart_sync_device *const device, const enum usart_data_order order);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set mode
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
* \param[in] mode A mode to set
|
||||||
|
*/
|
||||||
|
void _usart_sync_set_mode(struct _usart_sync_device *const device, const enum usart_mode mode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set parity
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
* \param[in] parity A parity to set
|
||||||
|
*/
|
||||||
|
void _usart_sync_set_parity(struct _usart_sync_device *const device, const enum usart_parity parity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set stop bits mode
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
* \param[in] stop_bits A stop bits mode to set
|
||||||
|
*/
|
||||||
|
void _usart_sync_set_stop_bits(struct _usart_sync_device *const device, const enum usart_stop_bits stop_bits);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set character size
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
* \param[in] size A character size to set
|
||||||
|
*/
|
||||||
|
void _usart_sync_set_character_size(struct _usart_sync_device *const device, const enum usart_character_size size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieve usart status
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
*/
|
||||||
|
uint32_t _usart_sync_get_status(const struct _usart_sync_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Write a byte to the given USART instance
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
* \param[in] data Data to write
|
||||||
|
*/
|
||||||
|
void _usart_sync_write_byte(struct _usart_sync_device *const device, uint8_t data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Read a byte from the given USART instance
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
* \param[in] data Data to write
|
||||||
|
*
|
||||||
|
* \return Data received via USART interface.
|
||||||
|
*/
|
||||||
|
uint8_t _usart_sync_read_byte(const struct _usart_sync_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Check if USART is ready to send next byte
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
*
|
||||||
|
* \return Status of the ready check.
|
||||||
|
* \retval true if the USART is ready to send next byte
|
||||||
|
* \retval false if the USART is not ready to send next byte
|
||||||
|
*/
|
||||||
|
bool _usart_sync_is_ready_to_send(const struct _usart_sync_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Check if USART transmitter has sent the byte
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
*
|
||||||
|
* \return Status of the ready check.
|
||||||
|
* \retval true if the USART transmitter has sent the byte
|
||||||
|
* \retval false if the USART transmitter has not send the byte
|
||||||
|
*/
|
||||||
|
bool _usart_sync_is_transmit_done(const struct _usart_sync_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Check if there is data received by USART
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
*
|
||||||
|
* \return Status of the data received check.
|
||||||
|
* \retval true if the USART has received a byte
|
||||||
|
* \retval false if the USART has not received a byte
|
||||||
|
*/
|
||||||
|
bool _usart_sync_is_byte_received(const struct _usart_sync_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set the state of flow control pins
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
* \param[in] state - A state of flow control pins to set
|
||||||
|
*/
|
||||||
|
void _usart_sync_set_flow_control_state(struct _usart_sync_device *const device,
|
||||||
|
const union usart_flow_control_state state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieve the state of flow control pins
|
||||||
|
*
|
||||||
|
* This function retrieves the of flow control pins.
|
||||||
|
*
|
||||||
|
* \return USART_FLOW_CONTROL_STATE_UNAVAILABLE.
|
||||||
|
*/
|
||||||
|
union usart_flow_control_state _usart_sync_get_flow_control_state(const struct _usart_sync_device *const device);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieve ordinal number of the given USART hardware instance
|
||||||
|
*
|
||||||
|
* \param[in] device The pointer to USART device instance
|
||||||
|
*
|
||||||
|
* \return The ordinal number of the given USART hardware instance
|
||||||
|
*/
|
||||||
|
uint8_t _usart_sync_get_hardware_index(const struct _usart_sync_device *const device);
|
||||||
|
//@}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/**@}*/
|
||||||
|
#endif /* _HPL_SYNC_USART_H_INCLUDED */
|
|
@ -0,0 +1,66 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief Critical sections related functionality implementation.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "hal_atomic.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Driver version
|
||||||
|
*/
|
||||||
|
#define DRIVER_VERSION 0x00000001u
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Disable interrupts, enter critical section
|
||||||
|
*/
|
||||||
|
void atomic_enter_critical(hal_atomic_t volatile *atomic)
|
||||||
|
{
|
||||||
|
*atomic = __get_PRIMASK();
|
||||||
|
__disable_irq();
|
||||||
|
__DMB();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Exit atomic section
|
||||||
|
*/
|
||||||
|
void atomic_leave_critical(hal_atomic_t volatile *atomic)
|
||||||
|
{
|
||||||
|
__DMB();
|
||||||
|
__set_PRIMASK(*atomic);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retrieve the current driver version
|
||||||
|
*/
|
||||||
|
uint32_t atomic_get_version(void)
|
||||||
|
{
|
||||||
|
return DRIVER_VERSION;
|
||||||
|
}
|
|
@ -0,0 +1,78 @@
|
||||||
|
/**
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief HAL cache functionality implementation.
|
||||||
|
*
|
||||||
|
* Copyright (c)2018 Microchip Technology Inc. and its subsidiaries.
|
||||||
|
*
|
||||||
|
* \asf_license_start
|
||||||
|
*
|
||||||
|
* \page License
|
||||||
|
*
|
||||||
|
* Subject to your compliance with these terms, you may use Microchip
|
||||||
|
* software and any derivatives exclusively with Microchip products.
|
||||||
|
* It is your responsibility to comply with third party license terms applicable
|
||||||
|
* to your use of third party software (including open source software) that
|
||||||
|
* may accompany Microchip software.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||||
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||||
|
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||||
|
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||||
|
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||||
|
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||||
|
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||||
|
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||||
|
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||||
|
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* \asf_license_stop
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <compiler.h>
|
||||||
|
#include <hpl_cmcc.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialize cache module
|
||||||
|
*/
|
||||||
|
int32_t cache_init(void)
|
||||||
|
{
|
||||||
|
return _cmcc_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Enable cache module
|
||||||
|
*/
|
||||||
|
int32_t cache_enable(const void *hw)
|
||||||
|
{
|
||||||
|
return _cmcc_enable(hw);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Disable cache module
|
||||||
|
*/
|
||||||
|
int32_t cache_disable(const void *hw)
|
||||||
|
{
|
||||||
|
return _cmcc_disable(hw);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Configure cache module
|
||||||
|
*/
|
||||||
|
int32_t cache_configure(const void *hw, struct _cache_cfg *cache)
|
||||||
|
{
|
||||||
|
return _cmcc_configure(hw, cache);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Invalidate entire cache entries
|
||||||
|
*/
|
||||||
|
int32_t cache_invalidate_all(const void *hw)
|
||||||
|
{
|
||||||
|
return _cmcc_invalidate_all(hw);
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue