Commit Graph

1758 Commits

Author SHA1 Message Date
Dimitris Mantzouranis 644c80e9fd Revert "remove github workflow to be able to push to github"
This reverts commit aec1a6c2362338cd55bf2905051be535c192469f.
2022-02-12 13:54:43 +02:00
IsaacDynamo 0fb99f8a4b Align ISR vector table to 512bytes 2022-02-12 13:51:12 +02:00
Dimitris Mantzouranis c34385de6b sn32: allow mcuconf to override system 2022-02-12 13:51:12 +02:00
Dimitris Mantzouranis f4f08b1b9b SN32 port updates
* add preliminary support for the whole SN32F2XX series
* unify CMSIS support, no more ugly hacks
* rename the unified hal to SN32F2XX
* common header amongst the hal, points to device
* add board files for the series
* 240 gets to keep it's own hal for now
2022-02-12 13:51:12 +02:00
Dimitris Mantzouranis 42b1ebd07f 240b: make sure we are full speed 2022-02-12 13:51:12 +02:00
IsaacDynamo df8d9a59b1 Add SN32F260_defines.h (#37) 2022-02-12 13:51:12 +02:00
Dimitris Mantzouranis 7c62da9728 sn32 pwm: introduce non stop mode 2022-02-12 13:51:12 +02:00
IsaacDynamo 97c5ea166a Fix misconfiguration (#36)
* Fix misconfiguration, and cleanup board.h

* Update 240B as well
2022-02-12 13:51:12 +02:00
IsaacDynamo 45c32fcb56 Remove flag (#32)
* Remove flag. The flag is not used/checked when the 260 used with a jump-loader

* Futher clean-up. Removed commented-out code
2022-02-12 13:51:12 +02:00
dexter93 19faddfeb8 [sn32] ct16: further chibios integration (#30)
* [sn32] ct16: further chibios integration

general purpose and pwm driver
also introduce a reset function

* build ct16 driver

* [sn32] have some isr handling

* 240: config the board for pwm

* Revert "240: config the board for pwm"
probably best to do in pwm driver
This reverts commit c09059a8ba60ea1832ea14f4d557bd8e22df3fd7.

* ct: logic fix. remove unecessary include

* ct: typos + use notifications

* ct: the periodic notification should not stop the timer

* ct: pfpa assignment

* ct: pwm:  enable channel only if configured as active

* ct: pwm: periodic tic should track the timer

* derp

* ct: our chip supports IRQ priority level [0-3]

* isr: use the appropriate priority for each device

* ct: pwm: actually handle the channels

* ct: we define the # of channels already so..

* isr: we handle this on the specific drivers
disable for now

* ct: pwm: don't override TC. Call a counter reset

* ct: pwm: Set the prescaler properly

PRE is the max value of PC. PC increments on every tick.
When PC reaches PRE, TC increments and the timer overflows
Periodic timer is software controlled

* ct: gpt: PRE is the interval. Call a counter reset

* ct: Rename reset funtion to be more precise

* ct: pwm: Invert the channel disable logic

* ct: pwm: autoreload on period match

* ct: pwm: we only care for the last 25bits of IC

* ct: gpt: we only care for the last 25bits of IC

* ct: pwm: init config as hw defaults

* ct: pwm: mr24 is the driver callback

* Revert "isr: we handle this on the specific drivers"

This reverts commit 9ca061f170d9523d0e4e42011881f3d0b8dd1599.

* Revert "[sn32] have some isr handling"

This reverts commit cf45020072ea828522f2de2f6d5d2521398a61cd.

* ct: pwm: update the periodic notification

* ct: gpt: use MR0

* ct: priority bump

* Revert "ct: priority bump"
3 is probably fine
This reverts commit d2a861097a43f367ffbd15f6fc5d6747d9f14426.

* sn32: pwm: introduce oneshot mode

enable it with by defining SN32_PWM_USE_ONESHOT TRUE

* pwm: reset: we have a function for that

* explicitly enable pwm channels

* bugfix for bad PWM_OUTPUT_MASK

if it is DISABLED, bad things occur
Only ever identify and use PWM_OUTPUT_ACTIVE_HIGH and PWM_OUTPUT_ACTIVE_LOW

* periodic notification: clear and disable it

* we definitely need this to only run at first init

* ct: pwm: support 23 channel chips

* ct: support 240b and 260 chips

* make the macro check build

* pwm: correctly set the logic level

* pwm: speed improvements
in our shared matrix driver, we only care about the last callback.
having a shortcut to that if no other flag is raised will improve speed

+ident and comment

* Revert "pwm: speed improvements"

This reverts commit e143544b807dd860d26548c803503521450822b8.
2022-02-12 13:51:12 +02:00
dexter93 68a138c41d sn32: platform definition updates (#35)
* sn32: fix platform names

* sn32: Introduce board specific name definition

* sn32: update mcu family naming
2022-02-12 13:51:12 +02:00
Jack cda95f33c7 Fix compilation error 2022-02-12 13:51:12 +02:00
IsaacDynamo 36a295e0d1 Replaced symlink with regular file. Documented the workaround (#27) 2022-02-12 13:51:12 +02:00
IsaacDynamo e72cf89dfa Fixed bug in sys clock init, also reported by glory (#22)
* Fixed bug in sys clock init, also reported by glory

* Removed modification of SN_FLASH->LPCTRL from SystemCoreClockUpdate(). SystemCoreClockUpdate() should only update the SystemCoreClock variable.
2022-02-12 13:51:12 +02:00
Dimitris Mantzouranis 82b25f3972 sn32: slight flash cleanup
guard the jumploader on any flash operation
thanks to @gloryhzw
2022-02-12 13:51:12 +02:00
Dimitris Mantzouranis 77e28ce0f0 [sn32] 240b: decouple Core clock and Flash clock update
introduce a controller for Slow mode
2022-02-12 13:51:12 +02:00
Dimitris Mantzouranis 9dad1e98ed [sn32] 240b: usb hal: use the ISR 2022-02-12 13:51:12 +02:00
stdvar ac26bc170f Override restart_usb_driver for SN32 to avoid kb crash on remote wakeup
for history see:
https://github.com/SonixQMK/qmk_firmware/pull/28
https://github.com/qmk/qmk_firmware/pull/12870
2022-02-12 13:51:12 +02:00
Dimitris Mantzouranis 737997830b [SN32 decouple SysTick from CT16 and board headers 2022-02-12 13:51:12 +02:00
IsaacDynamo 73a79f9083 Added sn32_registry.h for 260. This is needed to be able to use the SN32_CT16B1_HANDLER ISR. 2022-02-12 13:51:12 +02:00
Dimitris Mantzouranis c839ae7580 sn32: 260: inherit mcuconf.h and build the system 2022-02-12 13:51:12 +02:00
Dimitris Mantzouranis 283eb6f658 sn32: 260: add missing system_SN32F260.c 2022-02-12 13:51:12 +02:00
Dimitris Mantzouranis 9eb6c8e884 sn32: we have UART 2022-02-12 13:51:12 +02:00
Dimitris Mantzouranis 11db8a941b sn32: further cleanup the LLD
SysTick driver is now seperate from CT
stale 240 non B code removed
CMSIS version is now on 1.8R
2022-02-12 13:51:11 +02:00
Dimitris Mantzouranis de5d4799da sn32: flash: comply with the hardware
The flash controller only accepts 4bytes
2022-02-12 13:51:11 +02:00
Dimitris Mantzouranis 777f1fcbb1 sn32: cleanup CT
24xB doesn't have CT32
Remove CMSIS leftover SysTick code
2022-02-12 13:51:11 +02:00
Glory d596a79ae4 SN26x: shave 40 bytes of RAM 2022-02-12 13:51:11 +02:00
Glory 14fec20512 Fix OpenRGB packet drops 2022-02-12 13:51:11 +02:00
Glory d898dafe19 Fix openrgb RAW set led drop issue
should handle nak if the device can't keep up PC writing speed (3~5 64-byte packet sequentially)
2022-02-12 13:51:11 +02:00
stdvar 181e4b3ed7 [240] Clear USB interrupt status after it is fully handled 2022-02-12 13:51:11 +02:00
stdvar d81bd9ccdf [240B] Clear USB interrupt status after it is fully handled 2022-02-12 13:51:11 +02:00
Adam Honse e2076e56b8 Add board files for SN32F260 2022-02-12 13:51:11 +02:00
dexter93 36d503985f SN32: update flash driver for 240b (#8)
* sn32 hal: update flash from latest CMSIS

* sn32: build flash

* sn32: fix compilation

* sn32 flash: add half word flashing

* sn32 flash: adaptation time
2022-02-12 13:51:11 +02:00
janjan 34f2c22327 Fixes for 268
This is inspired/copy-pasted from:

be7396a79f
2022-02-12 13:51:11 +02:00
janjan ac2695f8a2 Update SN32F260.h to latest version
This is taken from the latest pack file called:

"SONiX.SN32F2_DFP.1.2.11.pack"

This pack file is found in an archive named:

"SN32F260_Startkit_Package_V1.6R.zip"

download from here:

http://www.sonix.com.tw/article-en-998-24753 or
http://www.sonix.com.tw/files/1/9BB279642CFC9359E050007F01007A12

(extract that zip file and look in the "Pack" folder)

if you rename "SONiX.SN32F2_DFP.1.2.11.pack" to "SONiX.SN32F2_DFP.1.2.11.zip" you can extract it with a normal zip program

You find the file "SN32F260.h" in the folder "Device/Include"
2022-02-12 13:51:11 +02:00
Dimitris Mantzouranis ffba320d0a sn32: add sn32f240b board on chibios 2022-02-12 13:51:11 +02:00
HorrorTroll 2ea54e6d17 Replace to the file was fixed 2022-02-12 13:51:11 +02:00
HorrorTroll f7b8a68338 Added alternate ACK/NAK based 240B 2022-02-12 13:51:11 +02:00
stdvar d32df9caa9 SN32F24xB: Implement alternative handling of ACK/NAK and fix CONSOLE support 2022-02-12 13:51:11 +02:00
stdvar 52acdb5527 SN32F24xB: Add remote wakeup and examples of suspend handling 2022-02-12 13:51:11 +02:00
HorrorTroll 8f693258a3 fix some speed issue for 240 chip 2022-02-12 13:51:11 +02:00
HorrorTroll 7f2ba3dbfa fixed a bit for 240B, should work now 2022-02-12 13:51:11 +02:00
HorrorTroll a5c63c35fc Split 240B and 240, and clean up new USB code 2022-02-12 13:51:11 +02:00
stdvar 90174b9810 SN32: Update USB IRQ priority 2022-02-12 13:51:11 +02:00
stdvar 737bf13059 SN32: Cleanup USB LLD code 2022-02-12 13:51:11 +02:00
stdvar 4d74459654 SN32: Remove unused code and cleanup USB LLD 2022-02-12 13:51:11 +02:00
stdvar 05d3a4f4d1 SN32: Fix SET_REPORT at init and start troublshooting the handling of multple EPs 2022-02-12 13:51:11 +02:00
Dimitris Mantzouranis 3f6d9c2118 sn32f240: inherit clocks from mcuconf.h 2022-02-12 13:51:11 +02:00
Dimitris Mantzouranis 67a3f41cf8 sn32: ct: advertise the isr handler 2022-02-12 13:51:11 +02:00
Dimitris Mantzouranis 868fb3a968 sn32: we use the ct16b1 2022-02-12 13:51:11 +02:00