Skip to content

Commit

Permalink
Merge pull request #4 from Rjgawuie/main
Browse files Browse the repository at this point in the history
Add duos pwm support
  • Loading branch information
carbonfix authored Sep 24, 2024
2 parents 8658ad4 + 3612a6f commit 6524745
Show file tree
Hide file tree
Showing 7 changed files with 813 additions and 114 deletions.
2 changes: 1 addition & 1 deletion src/platform/milkv/duo256m.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static int milkv_duo256mSetup(void) {
void milkv_duo256mInit(void) {
platform_register(&milkv_duo256m, "milkv_duo256m");

milkv_duo256m->soc = soc_get("Sophgo", "SG200X");
milkv_duo256m->soc = soc_get("Sophgo", "SG2002");
milkv_duo256m->soc->setMap(map, _sizeof(map));

milkvInit(milkv_duo256m);
Expand Down
7 changes: 6 additions & 1 deletion src/platform/milkv/duos.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,16 @@ static int milkv_duosSetup(void) {
void milkv_duosInit(void) {
platform_register(&milkv_duos, "milkv_duos");

milkv_duos->soc = soc_get("Sophgo", "SG200X");
milkv_duos->soc = soc_get("Sophgo", "SG2000");
milkv_duos->soc->setMap(map, _sizeof(map));

milkvInit(milkv_duos);

milkv_duos->setup = &milkv_duosSetup;
milkv_duos->validGPIO = &milkv_duosValidGPIO;

milkv_duos->pwmSetPeriod = milkv_duos->soc->socSetPWMPeriod;
milkv_duos->pwmSetDuty = milkv_duos->soc->socSetPWMDuty;
milkv_duos->pwmSetPolarity = milkv_duos->soc->socSetPWMPolarity;
milkv_duos->pwmEnable = milkv_duos->soc->socEnablePWM;
}
667 changes: 667 additions & 0 deletions src/soc/sophgo/sg2000.c

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/soc/sophgo/sg200x.h → src/soc/sophgo/sg2000.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

#include "common.h"

extern struct soc_t *sg200x;
extern struct soc_t *sg2000;

void sg200xInit(void);
void sg2000Init(void);

#endif
Loading

0 comments on commit 6524745

Please sign in to comment.