CARME-M4 BSP
V1.5
|
CARME IO1 high level functions. More...
Files | |
file | carme_io1.h |
CARME IO1 extension module board support package. | |
file | carme_io1.c |
CARME IO1 extension module board support package. | |
Typedefs | |
typedef enum _CARME_IO1_PIO_PORT | CARME_IO1_PIO_PORT |
This enum contains all available Ports of the PIO device. | |
typedef enum _CARME_IO1_PIO_CONTROL | CARME_IO1_PIO_CONTROL |
This contains all possible commands for the PIO device. | |
Enumerations | |
enum | _CARME_IO1_PIO_PORT { CARME_IO1_PORT_A, CARME_IO1_PORT_C, CARME_IO1_PORT_C_L, CARME_IO1_PORT_C_H } |
This enum contains all available Ports of the PIO device. More... | |
enum | _CARME_IO1_PIO_CONTROL { CARME_IO1_PORT_A_IN = 0x01, CARME_IO1_PORT_A_OUT = 0x02, CARME_IO1_PORT_C_IN = 0x04, CARME_IO1_PORT_C_OUT = 0x08, CARME_IO1_PORT_C_L_IN = 0x10, CARME_IO1_PORT_C_L_OUT = 0x20, CARME_IO1_PORT_C_H_IN = 0x40, CARME_IO1_PORT_C_H_OUT = 0x80 } |
This contains all possible commands for the PIO device. More... | |
Functions | |
void | CARME_IO1_Init (void) |
CARME IO1 initialization. More... | |
void | CARME_IO1_LED_Set (uint8_t write, uint8_t mask) |
Set a byte to the CARME IO1 LEDs. More... | |
void | CARME_IO1_LED_Get (uint8_t *pStatus) |
Get the CARME IO1 LED status. More... | |
void | CARME_IO1_SWITCH_Get (uint8_t *pStatus) |
Get the CARME IO1 switch status. More... | |
void | CARME_IO1_BUTTON_Get (uint8_t *pStatus) |
Get the CARME IO1 button status. More... | |
void | CARME_IO1_BUTTON_Interrupt (FunctionalState state) |
Set the CARME IO1 interrupt enable/disable. More... | |
void | CARME_IO1_PIO_Write (CARME_IO1_PIO_PORT port, uint8_t data) |
Sets the PIOs in order with the input-value. More... | |
void | CARME_IO1_PIO_Read (CARME_IO1_PIO_PORT port, uint8_t *data) |
Read the PIO value. More... | |
void | CARME_IO1_PIO_Set (CARME_IO1_PIO_PORT port, uint8_t pio) |
Sets the PIO on the position of the input value. For example the input value 0x4 sets the pin number 4. The other pins are not affected. More... | |
void | CARME_IO1_PIO_Clear (CARME_IO1_PIO_PORT port, uint8_t pio) |
Clears the PIO on the position of the input value. For example the input value 0x4 clears the pin number 4. The other pins are not affected. More... | |
void | CARME_IO1_PIO_Control (CARME_IO1_PIO_CONTROL cmd) |
Sets the PIO Control Register. This function must be called to change the Port direction. More... | |
Variables | |
static __IO uint8_t * | LED_Port = (__IO uint8_t *) (FSMC_CARME_EXTENSION1_BASE + 0x200) |
Pointer to the register which controls the CARME IO1 LEDs. | |
static __IO uint8_t * | Switch_Port = (__IO uint8_t *) (FSMC_CARME_EXTENSION1_BASE + 0x400) |
Pointer to the register which controls the CARME IO1 Switchs. | |
static __IO uint8_t * | PIO_PortA = (__IO uint8_t *) (FSMC_CARME_EXTENSION1_BASE + 0x800) |
Pointer to the register which controls the CARME IO1 PIO PortA Value. | |
static __IO uint8_t * | PIO_PortC = (__IO uint8_t *) (FSMC_CARME_EXTENSION1_BASE + 0x810) |
Pointer to the register which controls the CARME IO1 PIO PortB Value. More... | |
static __IO uint8_t * | PIO_Control = (__IO uint8_t *) (FSMC_CARME_EXTENSION1_BASE + 0x818) |
Pointer to the register which controls the CARME IO1 PIO Control Value. | |
static CARME_Port_Pin_t | CARME_IO1_Port_Pin [] |
CARME IO1 Port and Pin association. More... | |
static __IO uint8_t | LED_Value = 0x00 |
CARME IO1 current led value. | |
static __IO uint8_t | PortA_Value = 0x00 |
CARME IO1 current PortA value. | |
static __IO uint8_t | PortC_Value = 0x00 |
CARME IO1 current PortC value. | |
CARME IO1 high level functions.
This contains all possible commands for the PIO device.
Definition at line 104 of file carme_io1.h.
enum _CARME_IO1_PIO_PORT |
This enum contains all available Ports of the PIO device.
Enumerator | |
---|---|
CARME_IO1_PORT_A |
Port A [PA0 ... PA7] |
CARME_IO1_PORT_C |
Port C [PC0 ... PC7] |
CARME_IO1_PORT_C_L |
Port C [PC0 ... PC3] |
CARME_IO1_PORT_C_H |
Port C [PC4 ... PC7] |
Definition at line 93 of file carme_io1.h.
void CARME_IO1_BUTTON_Get | ( | uint8_t * | pStatus | ) |
Get the CARME IO1 button status.
[out] | pStatus | The current button status. |
Definition at line 235 of file carme_io1.c.
void CARME_IO1_BUTTON_Interrupt | ( | FunctionalState | state | ) |
Set the CARME IO1 interrupt enable/disable.
[in] | state | The new state. |
Definition at line 256 of file carme_io1.c.
void CARME_IO1_Init | ( | void | ) |
CARME IO1 initialization.
Definition at line 163 of file carme_io1.c.
void CARME_IO1_LED_Get | ( | uint8_t * | pStatus | ) |
Get the CARME IO1 LED status.
[out] | pStatus | The current LED status. |
Definition at line 209 of file carme_io1.c.
void CARME_IO1_LED_Set | ( | uint8_t | write, |
uint8_t | mask | ||
) |
Set a byte to the CARME IO1 LEDs.
[in] | write | Byte with the new LED status. |
[in] | mask | Mask which LED should be written. |
Definition at line 182 of file carme_io1.c.
void CARME_IO1_PIO_Clear | ( | CARME_IO1_PIO_PORT | port, |
uint8_t | pio | ||
) |
Clears the PIO on the position of the input value.
For example the input value 0x4 clears the pin number 4. The other pins are not affected.
[in] | port | Port (A or C) |
[out] | pio | PIO to clear [0..7] |
Definition at line 412 of file carme_io1.c.
void CARME_IO1_PIO_Control | ( | CARME_IO1_PIO_CONTROL | cmd | ) |
Sets the PIO Control Register. This function must be called to change the Port direction.
[in] | cmd | See CARME_IO1_PIO_CONTROL for allowed values. |
Definition at line 439 of file carme_io1.c.
void CARME_IO1_PIO_Read | ( | CARME_IO1_PIO_PORT | port, |
uint8_t * | data | ||
) |
Read the PIO value.
[in] | port | Port (A or C) |
[out] | data | Pointer to the user pio variable |
Definition at line 354 of file carme_io1.c.
void CARME_IO1_PIO_Set | ( | CARME_IO1_PIO_PORT | port, |
uint8_t | pio | ||
) |
Sets the PIO on the position of the input value.
For example the input value 0x4 sets the pin number 4. The other pins are not affected.
[in] | port | Port (A or C) |
[out] | pio | PIO to set [0..7] |
Definition at line 385 of file carme_io1.c.
void CARME_IO1_PIO_Write | ( | CARME_IO1_PIO_PORT | port, |
uint8_t | data | ||
) |
Sets the PIOs in order with the input-value.
[in] | port | Port (A or C) |
[in] | data | input value to set |
Definition at line 323 of file carme_io1.c.
void CARME_IO1_SWITCH_Get | ( | uint8_t * | pStatus | ) |
Get the CARME IO1 switch status.
[out] | pStatus | The current switch status. |
Definition at line 222 of file carme_io1.c.
|
static |
CARME IO1 Port and Pin association.
Definition at line 133 of file carme_io1.c.
|
static |
Pointer to the register which controls the CARME IO1 PIO PortB Value.
Pointer to the register which controls the CARME IO1 PIO PortC Value.
Definition at line 123 of file carme_io1.c.