CARME-M4 BSP
V1.5
|
CARME Core Module functions and defines. More...
Files | |
file | carme.h |
file | carme.c |
Data Structures | |
struct | _CARME_Port_Pin_t |
CARME port and pin association structure. More... | |
Macros | |
#define | FSMC_NOR_PSRAM_CS_ADDR(n) |
#define | FSMC_FLASH_BASE FSMC_NOR_PSRAM_CS_ADDR(1) |
#define | FSMC_PSRAM_BASE FSMC_NOR_PSRAM_CS_ADDR(2) |
#define | FSMC_LCD_SSD1963_BASE FSMC_NOR_PSRAM_CS_ADDR(3) |
#define | FSMC_IO_BASE FSMC_NOR_PSRAM_CS_ADDR(4) |
#define | FSMC_CARME_EXTENSION1_BASE (FSMC_IO_BASE + 0x0000000) |
#define | FSMC_CARME_EXTENSION2_BASE (FSMC_IO_BASE + 0x1000000) |
#define | FSMC_CAN_BASE (FSMC_IO_BASE + 0x2000000) |
#define | CARME_AGPIO_9 GPIOI, GPIO_Pin_5 |
#define | CARME_AGPIO_13 GPIOG, GPIO_Pin_15 |
#define | CARME_AGPIO_21 GPIOI, GPIO_Pin_4 |
#define | CARME_AGPIO_22 GPIOH, GPIO_Pin_2 |
#define | CARME_AGPIO_90 GPIOF, GPIO_Pin_11 |
#define | CARME_AGPIO_91 GPIOF, GPIO_Pin_10 |
#define | CARME_AGPIO_93 GPIOF, GPIO_Pin_9 |
#define | CARME_AGPIO_94 GPIOF, GPIO_Pin_8 |
#define | CARME_AGPIO_96 GPIOF, GPIO_Pin_7 |
#define | CARME_AGPIO_97 GPIOF, GPIO_Pin_6 |
#define | CARME_AGPIO_99 GPIOC, GPIO_Pin_7 |
#define | CARME_AGPIO_101 GPIOB, GPIO_Pin_15 |
#define | CARME_AGPIO_102 GPIOB, GPIO_Pin_14 |
#define | CARME_AGPIO_103 GPIOI, GPIO_Pin_0 |
#define | CARME_AGPIO_105 GPIOB, GPIO_Pin_8 |
#define | CARME_AGPIO_108 GPIOB, GPIO_Pin_6 |
#define | CARME_AGPIO_115 GPIOB, GPIO_Pin_2 |
#define | CARME_AGPIO_116 GPIOB, GPIO_Pin_1 |
#define | CARME_LED_GREEN GPIOI, GPIO_Pin_6 |
#define | CARME_LED_RED GPIOI, GPIO_Pin_7 |
#define | CARME_AGPIO_PIN_116 ((uint32_t)0x00001) |
#define | CARME_AGPIO_PIN_115 ((uint32_t)0x00002) |
#define | CARME_AGPIO_PIN_108 ((uint32_t)0x00004) |
#define | CARME_AGPIO_PIN_105 ((uint32_t)0x00008) |
#define | CARME_AGPIO_PIN_103 ((uint32_t)0x00010) |
#define | CARME_AGPIO_PIN_102 ((uint32_t)0x00020) |
#define | CARME_AGPIO_PIN_101 ((uint32_t)0x00040) |
#define | CARME_AGPIO_PIN_99 ((uint32_t)0x00080) |
#define | CARME_AGPIO_PIN_97 ((uint32_t)0x00100) |
#define | CARME_AGPIO_PIN_96 ((uint32_t)0x00200) |
#define | CARME_AGPIO_PIN_94 ((uint32_t)0x00400) |
#define | CARME_AGPIO_PIN_93 ((uint32_t)0x00800) |
#define | CARME_AGPIO_PIN_91 ((uint32_t)0x01000) |
#define | CARME_AGPIO_PIN_90 ((uint32_t)0x02000) |
#define | CARME_AGPIO_PIN_22 ((uint32_t)0x04000) |
#define | CARME_AGPIO_PIN_21 ((uint32_t)0x08000) |
#define | CARME_AGPIO_PIN_13 ((uint32_t)0x10000) |
#define | CARME_AGPIO_PIN_9 ((uint32_t)0x20000) |
#define | CARME_LED_PIN_GREEN ((uint32_t)0x40000) |
#define | CARME_LED_PIN_RED ((uint32_t)0x80000) |
#define | CARME_NO_ERROR 0x0 |
#define | CARME_ERROR_IO1_BASE 0x10 |
#define | CARME_ERROR_IO2_BASE 0x20 |
#define | CARME_ERROR_UART_BASE 0x30 |
#define | CARME_ERROR_CAN_BASE 0x40 |
#define | CARME_ERROR_I2C_BASE 0x60 |
#define | CARME_ERROR_AUDIO_BASE 0x80 |
#define | CARME_ERROR_ETH_BASE 0xA0 |
#define | CARME_ERROR_USB_BASE 0xC0 |
#define | CARME_ERROR_EEPROM_BASE 0xE0 |
#define | CARME_GPIO_PIN_TO_SOURCE(GPIO_PIN) |
Get GPIO_PinSourcex from GPIO_Pin_x. More... | |
#define | CARME_GPIO_TO_EXTIPORTSOURCE(GPIO_PORT) |
Get EXTI_PortSourceGPIOx from GPIOx. More... | |
#define | CARME_GPIO_TO_EXTIPINSOURCE(GPIO_PIN) |
Get EXTI_PinSourcex from GPIO_Pin_x. More... | |
#define | CARME_GPIO_TO_EXTILINE(GPIO_PIN) |
Get EXTI_Linex from GPIO_Pin_x. More... | |
#define | max(a, b) ( ((a) > (b)) ? (a) : (b) ) |
Get the maximum of two numbers. | |
#define | min(a, b) ( ((a) < (b)) ? (a) : (b) ) |
Get the minimum of two numbers. | |
#define | CARME_ACTIVATE_EXT_FLASH 0 |
#define | CARME_GPIO_PIN_TO_MODER(GPIO_PIN) |
Get the pin moder from the pin number. More... | |
Typedefs | |
typedef struct _CARME_Port_Pin_t | CARME_Port_Pin_t |
CARME port and pin association structure. | |
typedef uint8_t | ERROR_CODES |
Error variable. | |
Functions | |
void | CARME_Init (void) |
CARME-M4 module initialization. More... | |
void | CARME_GPIO_Init (CARME_Port_Pin_t *pPortPinAssociation, GPIO_InitTypeDef *pGPIO_InitStruct, uint8_t size) |
Initialize GPIO ports with a CARME_Port_Pin_t table. More... | |
void | CARME_AGPIO_Set (uint32_t write, uint32_t mask) |
Set the AGPIO state. More... | |
void | CARME_AGPIO_Get (uint32_t *pStatus) |
Get the AGPIO state. More... | |
void | CARME_LED_Green_Set (void) |
Set the green LED on the CARME Module. More... | |
void | CARME_LED_Green_Reset (void) |
Reset the green LED on the CARME Module. More... | |
void | CARME_LED_Red_Set (void) |
Set the red LED on the CARME Module. More... | |
void | CARME_LED_Red_Reset (void) |
Reset the red LED on the CARME Module. More... | |
static void | CARME_FSMC_Init (void) |
Initialization of the FSMC. This bus is used for the connection to the CarmeIO1 and CarmeIO2 module, the CAN driver (SJA1000) and the LCD driver. More... | |
static void | CARME_FSMC_GPIO_Init (void) |
Initialization of the FSMC GPIO pins. This bus is used for the connection to the extension modules, the CAN driver (SJA1000) and the LCD driver. More... | |
static void | CARME_AGPIO_Init (void) |
CARME AGPIO initialization. More... | |
static uint8_t | CARME_AGPIO_GetMode (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin) |
Get the AGPIO mode. More... | |
Variables | |
static CARME_Port_Pin_t | CARME_AGPIO_Port_Pin [] |
CARME AGPIO Port and Pin association. More... | |
CARME Core Module functions and defines.
#define CARME_AGPIO_101 GPIOB, GPIO_Pin_15 |
#define CARME_AGPIO_102 GPIOB, GPIO_Pin_14 |
#define CARME_AGPIO_103 GPIOI, GPIO_Pin_0 |
#define CARME_AGPIO_105 GPIOB, GPIO_Pin_8 |
#define CARME_AGPIO_108 GPIOB, GPIO_Pin_6 |
#define CARME_AGPIO_115 GPIOB, GPIO_Pin_2 |
#define CARME_AGPIO_116 GPIOB, GPIO_Pin_1 |
#define CARME_AGPIO_PIN_101 ((uint32_t)0x00040) |
#define CARME_AGPIO_PIN_102 ((uint32_t)0x00020) |
#define CARME_AGPIO_PIN_103 ((uint32_t)0x00010) |
#define CARME_AGPIO_PIN_105 ((uint32_t)0x00008) |
#define CARME_AGPIO_PIN_108 ((uint32_t)0x00004) |
#define CARME_AGPIO_PIN_115 ((uint32_t)0x00002) |
#define CARME_AGPIO_PIN_116 ((uint32_t)0x00001) |
#define CARME_AGPIO_PIN_13 ((uint32_t)0x10000) |
#define CARME_AGPIO_PIN_21 ((uint32_t)0x08000) |
#define CARME_AGPIO_PIN_22 ((uint32_t)0x04000) |
#define CARME_AGPIO_PIN_9 ((uint32_t)0x20000) |
#define CARME_AGPIO_PIN_90 ((uint32_t)0x02000) |
#define CARME_AGPIO_PIN_91 ((uint32_t)0x01000) |
#define CARME_AGPIO_PIN_93 ((uint32_t)0x00800) |
#define CARME_AGPIO_PIN_94 ((uint32_t)0x00400) |
#define CARME_AGPIO_PIN_96 ((uint32_t)0x00200) |
#define CARME_AGPIO_PIN_97 ((uint32_t)0x00100) |
#define CARME_AGPIO_PIN_99 ((uint32_t)0x00080) |
#define CARME_GPIO_PIN_TO_MODER | ( | GPIO_PIN | ) |
Get the pin moder from the pin number.
#define CARME_GPIO_PIN_TO_SOURCE | ( | GPIO_PIN | ) |
Get GPIO_PinSourcex from GPIO_Pin_x.
#define CARME_GPIO_TO_EXTILINE | ( | GPIO_PIN | ) |
Get EXTI_Linex from GPIO_Pin_x.
#define CARME_GPIO_TO_EXTIPINSOURCE | ( | GPIO_PIN | ) |
Get EXTI_PinSourcex from GPIO_Pin_x.
#define CARME_GPIO_TO_EXTIPORTSOURCE | ( | GPIO_PORT | ) |
Get EXTI_PortSourceGPIOx from GPIOx.
#define CARME_LED_GREEN GPIOI, GPIO_Pin_6 |
#define CARME_LED_PIN_GREEN ((uint32_t)0x40000) |
#define FSMC_CAN_BASE (FSMC_IO_BASE + 0x2000000) |
#define FSMC_CARME_EXTENSION1_BASE (FSMC_IO_BASE + 0x0000000) |
#define FSMC_CARME_EXTENSION2_BASE (FSMC_IO_BASE + 0x1000000) |
#define FSMC_FLASH_BASE FSMC_NOR_PSRAM_CS_ADDR(1) |
#define FSMC_IO_BASE FSMC_NOR_PSRAM_CS_ADDR(4) |
#define FSMC_LCD_SSD1963_BASE FSMC_NOR_PSRAM_CS_ADDR(3) |
#define FSMC_NOR_PSRAM_CS_ADDR | ( | n | ) |
#define FSMC_PSRAM_BASE FSMC_NOR_PSRAM_CS_ADDR(2) |
void CARME_AGPIO_Get | ( | uint32_t * | pStatus | ) |
|
static |
|
static |
void CARME_AGPIO_Set | ( | uint32_t | write, |
uint32_t | mask | ||
) |
|
static |
Initialization of the FSMC GPIO pins. This bus is used for the connection to the extension modules, the CAN driver (SJA1000) and the LCD driver.
CARME FSMC Port and Pin association
< FSMC_A0
< FSMC_A1
< FSMC_A2
< FSMC_A3
< FSMC_A4
< FSMC_A5
< FSMC_A6
< FSMC_A7
< FSMC_A8
< FSMC_A9
< FSMC_A10
< FSMC_A11
< FSMC_A12
< FSMC_A13
< FSMC_A14
< FSMC_A15
< FSMC_A16
< FSMC_A17
< FSMC_A18
< FSMC_A19
< FSMC_A20
< FSMC_A21
< FSMC_A22
< FSMC_A23
< FSMC_A24
< FSMC_A25
< FSMC_D0
< FSMC_D1
< FSMC_D2
< FSMC_D3
< FSMC_D4
< FSMC_D5
< FSMC_D6
< FSMC_D7
< FSMC_D8
< FSMC_D9
< FSMC_D10
< FSMC_D11
< FSMC_D12
< FSMC_D13
< FSMC_D14
< FSMC_D15
< FSMC_NE1
< FSMC_NE2
< FSMC_NE3
< FSMC_NE4
< FSMC_NL
< FSMC_CLK
< FSMC_NOE
< FSMC_NWE
< FSMC_NWAIT
< FSMC_NBL0
< FSMC_NBL1
Definition at line 194 of file carme.c.
|
static |
Initialization of the FSMC. This bus is used for the connection to the CarmeIO1 and CarmeIO2 module, the CAN driver (SJA1000) and the LCD driver.
Address and databus to RAM.
FSMC configuration:
FSMC Timing configuration:
Address and databus to display controller.
FSMC configuration:
FSMC Timing configuration:
Address and databus to CARME IO1 and IO2 and SJA1000 CAN controller.
FSMC configuration:
FSMC Timing configuration:
Definition at line 299 of file carme.c.
void CARME_GPIO_Init | ( | CARME_Port_Pin_t * | pPortPinAssociation, |
GPIO_InitTypeDef * | pGPIO_InitStruct, | ||
uint8_t | size | ||
) |
Initialize GPIO ports with a CARME_Port_Pin_t table.
[in] | pPortPinAssociation | CARME_Port_Pin_t Port and Pin association |
[in] | pGPIO_InitStruct | GPIO_InitTypeDef GPIO init type definition |
[in] | size | Size of the struct |
Definition at line 540 of file carme.c.
void CARME_Init | ( | void | ) |
void CARME_LED_Green_Reset | ( | void | ) |
void CARME_LED_Green_Set | ( | void | ) |
void CARME_LED_Red_Reset | ( | void | ) |
void CARME_LED_Red_Set | ( | void | ) |
|
static |
CARME AGPIO Port and Pin association.