Features: - VFO mode with direct frequency input - POCSAG decoder (512/1200 baud) with BCH(31,21) correction - Full-screen Spectrum analyzer - FM Radio receiver - RSSI signal indicator overlay - Custom boot splash (UA1ZBE / POCSAG pager / build date) Architecture: - app/mode.c — mode dispatcher (VFO/POCSAG/Spectrum/FM) - app/boot_splash.c — 2-second boot splash - app/pocsag/ — POCSAG decoder + BCH correction - app/display_rssi.c — RSSI indicator - main.c — entry point with custom init - syscalls.c — bare-metal _sbrk stub Build: arm-none-eabi-gcc -Os -flto -Wall -Werror -Wextra Size: 57.9KB Flash / 3.6KB RAM Controls: - 0-9: Direct frequency input (VFO) - SK2: POCSAG mode - SK1: Spectrum analyzer - 0: FM Radio - EXIT: Return to VFO - F/*: Toggle 512/1200 baud (in POCSAG)
170 lines
2.3 KiB
Modula-2
170 lines
2.3 KiB
Modula-2
# Copyright 2023 Dual Tachyon
|
|
# https://github.com/DualTachyon
|
|
#
|
|
# 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.
|
|
|
|
[DMA]
|
|
@ = 0x40001000, 0x100
|
|
|
|
CTR = 0x0000
|
|
> DMAEN, 0, 1
|
|
= DISABLE, 0
|
|
= ENABLE, 1
|
|
|
|
INTEN = 0x0004
|
|
> CH0_TC_INTEN, 0, 1
|
|
= DISABLE, 0
|
|
= ENABLE, 1
|
|
|
|
> CH1_TC_INTEN, 1, 1
|
|
= DISABLE, 0
|
|
= ENABLE, 1
|
|
|
|
> CH2_TC_INTEN, 2, 1
|
|
= DISABLE, 0
|
|
= ENABLE, 1
|
|
|
|
> CH3_TC_INTEN, 3, 1
|
|
= DISABLE, 0
|
|
= ENABLE, 1
|
|
|
|
> CH0_THC_INTEN, 8, 1
|
|
= DISABLE, 0
|
|
= ENABLE, 1
|
|
|
|
> CH1_THC_INTEN, 9, 1
|
|
= DISABLE, 0
|
|
= ENABLE, 1
|
|
|
|
> CH2_THC_INTEN, 10, 1
|
|
= DISABLE, 0
|
|
= ENABLE, 1
|
|
|
|
> CH3_THC_INTEN, 11, 1
|
|
= DISABLE, 0
|
|
= ENABLE, 1
|
|
|
|
INTST = 0x0008
|
|
> CH0_TC_INTST, 0, 1
|
|
= NOT_SET, 0
|
|
= SET, 1
|
|
|
|
> CH1_TC_INTST, 1, 1
|
|
= NOT_SET, 0
|
|
= SET, 1
|
|
|
|
> CH2_TC_INTST, 2, 1
|
|
= NOT_SET, 0
|
|
= SET, 1
|
|
|
|
> CH3_TC_INTST, 3, 1
|
|
= NOT_SET, 0
|
|
= SET, 1
|
|
|
|
> CH0_THC_INTST, 8, 1
|
|
= NOT_SET, 0
|
|
= SET, 1
|
|
|
|
> CH1_THC_INTST, 9, 1
|
|
= NOT_SET, 0
|
|
= SET, 1
|
|
|
|
> CH2_THC_INTST, 10, 1
|
|
= NOT_SET, 0
|
|
= SET, 1
|
|
|
|
> CH3_THC_INTST, 11, 1
|
|
= NOT_SET, 0
|
|
= SET, 1
|
|
|
|
[DMA_CH]
|
|
$ = DMA_Channel_t
|
|
|
|
CTR = 0x0000
|
|
> CH_EN, 0, 1
|
|
= DISABLE, 0
|
|
= ENABLE, 1
|
|
|
|
> LENGTH, 1, 12
|
|
|
|
> LOOP, 13, 1
|
|
= DISABLE, 0
|
|
= ENABLE, 1
|
|
|
|
> PRI, 14, 2
|
|
= LOW, 0
|
|
= MEDIUM, 1
|
|
= HIGH, 2
|
|
= HIGHEST, 3
|
|
|
|
> SWREQ, 16, 1
|
|
= SET, 1
|
|
|
|
MOD = 0x0004
|
|
> MS_ADDMOD, 0, 1
|
|
= NONE, 0
|
|
= INCREMENT, 1
|
|
|
|
> MS_SIZE, 1, 2
|
|
= 8BIT, 0
|
|
= 16BIT, 1
|
|
= 32BIT, 2
|
|
= KEEP, 3
|
|
|
|
> MS_SEL, 3, 3
|
|
= SRAM, 0
|
|
= HSREQ_MS0, 1
|
|
= HSREQ_MS1, 2
|
|
= HSREQ_MS2, 3
|
|
= HSREQ_MS3, 4
|
|
= HSREQ_MS4, 5
|
|
= HSREQ_MS5, 6
|
|
= HSREQ_MS6, 7
|
|
|
|
> MD_ADDMOD, 8, 1
|
|
= NONE, 0
|
|
= INCREMENT, 1
|
|
|
|
> MD_SIZE, 9, 2
|
|
= 8BIT, 0
|
|
= 16BIT, 1
|
|
= 32BIT, 2
|
|
= KEEP, 3
|
|
|
|
> MD_SEL, 11, 3
|
|
= SRAM, 0
|
|
= HSREQ_MS0, 1
|
|
= HSREQ_MS1, 2
|
|
= HSREQ_MS2, 3
|
|
= HSREQ_MS3, 4
|
|
= HSREQ_MS4, 5
|
|
= HSREQ_MS5, 6
|
|
= HSREQ_MS6, 7
|
|
|
|
MSADDR = 0x0008
|
|
MDADDR = 0x000C
|
|
ST = 0x0010
|
|
|
|
[DMA_CH0]
|
|
@ = 0x40001100, 0x20, $DMA_CH
|
|
|
|
[DMA_CH1]
|
|
@ = 0x40001120, 0x20, $DMA_CH
|
|
|
|
[DMA_CH2]
|
|
@ = 0x40001140, 0x20, $DMA_CH
|
|
|
|
[DMA_CH3]
|
|
@ = 0x40001160, 0x20, $DMA_CH
|
|
|