-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added configurable amplifier sequencing
(TX delay, TX hold off, AMP on/off)
- Loading branch information
Showing
11 changed files
with
419 additions
and
27 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include "`$INSTANCE_NAME`_api.h" | ||
#include <device.h> | ||
|
||
void `$INSTANCE_NAME`_Start(void) | ||
{ | ||
// Reset the counter. | ||
CY_SET_REG8(`$INSTANCE_NAME`_Datapath_1_u0__16BIT_A0_REG, 0); | ||
CY_SET_REG8(`$INSTANCE_NAME`_Datapath_1_u2__16BIT_A0_REG, 0); | ||
// Reset the delay to a single tick. | ||
CY_SET_REG8(`$INSTANCE_NAME`_Datapath_1_u0__16BIT_D1_REG, 1); | ||
CY_SET_REG8(`$INSTANCE_NAME`_Datapath_1_u2__16BIT_D1_REG, 0); | ||
CY_SET_REG8(`$INSTANCE_NAME`_Datapath_1_u0__16BIT_D0_REG, 1); | ||
CY_SET_REG8(`$INSTANCE_NAME`_Datapath_1_u2__16BIT_D0_REG, 0); | ||
} | ||
|
||
void `$INSTANCE_NAME`_SetDelay(int8 delay) | ||
{ | ||
uint32 high = 1 << delay; | ||
uint32 mask = high - 1; | ||
// Reset the counter. | ||
CY_SET_REG16(`$INSTANCE_NAME`_Datapath_1_u0__16BIT_A0_REG, 0); | ||
CY_SET_REG16(`$INSTANCE_NAME`_Datapath_1_u2__16BIT_A0_REG, 0); | ||
#if 1 | ||
// Set the length of a shift register by a mask. | ||
CY_SET_REG16(`$INSTANCE_NAME`_Datapath_1_u0__16BIT_D1_REG, mask & 0x0ffff); | ||
CY_SET_REG16(`$INSTANCE_NAME`_Datapath_1_u1__16BIT_D1_REG, mask >> 16); | ||
// Set the highest bit of the shift register. This is the output of the shift register. | ||
CY_SET_REG16(`$INSTANCE_NAME`_Datapath_1_u0__16BIT_D0_REG, high & 0x0ffff); | ||
CY_SET_REG16(`$INSTANCE_NAME`_Datapath_1_u1__16BIT_D0_REG, high >> 16); | ||
#else | ||
// Set the length of a shift register by a mask. | ||
CY_SET_REG16(`$INSTANCE_NAME`_Datapath_1_u2__16BIT_D1_REG, mask & 0x0ffff); | ||
CY_SET_REG16(`$INSTANCE_NAME`_Datapath_1_u0__16BIT_D1_REG, mask >> 16); | ||
// Set the highest bit of the shift register. This is the output of the shift register. | ||
CY_SET_REG16(`$INSTANCE_NAME`_Datapath_1_u2__16BIT_D0_REG, high & 0x0ffff); | ||
CY_SET_REG16(`$INSTANCE_NAME`_Datapath_1_u0__16BIT_D0_REG, high >> 16); | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// ======================================== | ||
// Copyright 2013 David Turnbull AE9RB | ||
// | ||
// 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 License 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. | ||
// ======================================== | ||
|
||
#include "cytypes.h" | ||
#include "cyfitter.h" | ||
|
||
void `$INSTANCE_NAME`_Start(); | ||
void `$INSTANCE_NAME`_SetDelay(int8 delay); |
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters