Skip to content

Commit

Permalink
Merge pull request #377 from 1Conan/sn32_fix_registry
Browse files Browse the repository at this point in the history
SN32: update registry
  • Loading branch information
fpoussin committed Aug 6, 2023
2 parents 5b4836c + e72939e commit fb67e50
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
22 changes: 22 additions & 0 deletions os/hal/ports/SN32/SN32F240/sn32_registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
*/
#define SN32_USB_HANDLER Vector44
#define SN32_USB_NUMBER USB_IRQn
#define SN32_HAS_USB TRUE

#define USBD_INTSTS_EPEVT_Pos USBD_INTSTS_EPEVT0_Pos
#define USBD_INTSTS_EPEVT_Msk (0xFFul << USBD_INTSTS_EPEVT_Pos)
Expand All @@ -70,12 +71,14 @@
*/
#define SN32_SPI0_HANDLER Vector58
#define SN32_SPI0_NUMBER SPI0_IRQn
#define SN32_HAS_SPI0 TRUE

/*
* I2C unit.
*/
#define SN32_I2C0_GLOBAL_HANDLER Vector68
#define SN32_I2C0_GLOBAL_NUMBER I2C0_IRQn
#define SN32_HAS_I2C0 TRUE

/*
* USART units.
Expand All @@ -88,6 +91,10 @@
#define SN32_USART1_NUMBER UART1_IRQn
#define SN32_USART2_NUMBER UART2_IRQn

#define SN32_HAS_USART0 TRUE
#define SN32_HAS_USART1 TRUE
#define SN32_HAS_USART2 TRUE

/*
* CT16 units.
*/
Expand All @@ -99,6 +106,10 @@
#define SN32_CT16B1_NUMBER CT16B1_IRQn
#define SN32_CT16B2_NUMBER CT16B2_IRQn

#define SN32_HAS_CT16B0 TRUE
#define SN32_HAS_CT16B1 TRUE
#define SN32_HAS_CT16B2 TRUE

/*
* CT32 units.
*/
Expand All @@ -110,11 +121,16 @@
#define SN32_CT32B1_NUMBER CT32B1_IRQn
#define SN32_CT32B2_NUMBER CT32B2_IRQn

#define SN32_HAS_CT32B0 TRUE
#define SN32_HAS_CT32B1 TRUE
#define SN32_HAS_CT32B2 TRUE

/*
* ADC unit.
*/
#define SN32_ADC_HANDLER VectorA0
#define SN32_ADC_NUMBER ADC_IRQn
#define SN32_HAS_ADC TRUE

/*
* WDT unit.
Expand All @@ -140,6 +156,12 @@
#define SN32_GPIOC_NUMBER P2_IRQn
#define SN32_GPIOB_NUMBER P1_IRQn
#define SN32_GPIOA_NUMBER P0_IRQn

#define SN32_HAS_GPIOD TRUE
#define SN32_HAS_GPIOC TRUE
#define SN32_HAS_GPIOB TRUE
#define SN32_HAS_GPIOA TRUE

/*===========================================================================*/
/* Common. */
/*===========================================================================*/
Expand Down
17 changes: 17 additions & 0 deletions os/hal/ports/SN32/SN32F240B/sn32_registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
*/
#define SN32_USB_HANDLER Vector44
#define SN32_USB_NUMBER USB_IRQn
#define SN32_HAS_USB TRUE

#define USBD_INTSTS_EPEVT_Pos USBD_INTSTS_EPEVT0_Pos
#define USBD_INTSTS_EPEVT_Msk (0xFFul << USBD_INTSTS_EPEVT_Pos)
Expand All @@ -70,12 +71,14 @@
*/
#define SN32_SPI0_HANDLER Vector58
#define SN32_SPI0_NUMBER SPI0_IRQn
#define SN32_HAS_SPI0 TRUE

/*
* I2C unit.
*/
#define SN32_I2C0_GLOBAL_HANDLER Vector68
#define SN32_I2C0_GLOBAL_NUMBER I2C0_IRQn
#define SN32_HAS_I2C0 TRUE

/*
* UART units.
Expand All @@ -88,6 +91,10 @@
#define SN32_UART1_NUMBER UART1_IRQn
#define SN32_UART2_NUMBER UART2_IRQn

#define SN32_HAS_UART0 TRUE
#define SN32_HAS_UART1 TRUE
#define SN32_HAS_UART2 TRUE

/*
* CT16 units.
*/
Expand All @@ -97,11 +104,15 @@
#define SN32_CT16B0_NUMBER CT16B0_IRQn
#define SN32_CT16B1_NUMBER CT16B1_IRQn

#define SN32_HAS_CT16B0 TRUE
#define SN32_HAS_CT16B1 TRUE

/*
* ADC unit.
*/
#define SN32_ADC_HANDLER VectorA0
#define SN32_ADC_NUMBER ADC_IRQn
#define SN32_HAS_ADC TRUE

/*
* WDT unit.
Expand All @@ -127,6 +138,12 @@
#define SN32_GPIOC_NUMBER P2_IRQn
#define SN32_GPIOB_NUMBER P1_IRQn
#define SN32_GPIOA_NUMBER P0_IRQn

#define SN32_HAS_GPIOD TRUE
#define SN32_HAS_GPIOC TRUE
#define SN32_HAS_GPIOB TRUE
#define SN32_HAS_GPIOA TRUE

/*===========================================================================*/
/* Common. */
/*===========================================================================*/
Expand Down
12 changes: 12 additions & 0 deletions os/hal/ports/SN32/SN32F260/sn32_registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,21 @@
*/
#define SN32_USB_HANDLER Vector44
#define SN32_USB_NUMBER USB_IRQn
#define SN32_HAS_USB TRUE

/*
* SPI unit.
*/
#define SN32_SPI0_HANDLER Vector74
#define SN32_SPI0_NUMBER SPI0_IRQn
#define SN32_HAS_SPI0 TRUE

/*
* I2C unit.
*/
#define SN32_I2C0_GLOBAL_HANDLER Vector7C
#define SN32_I2C0_GLOBAL_NUMBER I2C0_IRQn
#define SN32_HAS_I2C0 TRUE

/*
* CT16 units.
Expand All @@ -83,11 +86,15 @@
#define SN32_CT16B0_NUMBER CT16B0_IRQn
#define SN32_CT16B1_NUMBER CT16B1_IRQn

#define SN32_HAS_CT16B0 TRUE
#define SN32_HAS_CT16B1 TRUE

/*
* WDT unit.
*/
#define SN32_WDT_HANDLER VectorA4
#define SN32_WDT_NUMBER WDT_IRQn
#define SN32_HAS_WDT TRUE

/*
* LVD unit.
Expand All @@ -108,6 +115,11 @@
#define SN32_GPIOB_NUMBER P1_IRQn
#define SN32_GPIOA_NUMBER P0_IRQn

#define SN32_HAS_GPIOD TRUE
#define SN32_HAS_GPIOC TRUE
#define SN32_HAS_GPIOB TRUE
#define SN32_HAS_GPIOA TRUE

/** @} */

#endif /* SN32_REGISTRY_H */
Expand Down

0 comments on commit fb67e50

Please sign in to comment.