Fujitsu SK-AMAPOLLO-BASE-V11 Manual do utilizador - Página 26

Procurar online ou descarregar pdf Manual do utilizador para Placa-mãe Fujitsu SK-AMAPOLLO-BASE-V11. Fujitsu SK-AMAPOLLO-BASE-V11 46 páginas. Ambiq micro apollo 1 / 2 evaluation board

Fujitsu SK-AMAPOLLO-BASE-V11 Manual do utilizador
Add apolloiom.c to your project and include apolloiom.h and skamapollobase.h in you C-file.
Following code gives an example how to use the IOM:
#incude "mcu.h"
#include "skamapollobase.h"
#include "apolloiom.h"
#include "apollogpio.h"
const stc_apolloiom_config_t stcIomConfig = {
IomInterfaceModeI2C, //use SPI mode
400000UL,
FALSE,
FALSE,
0,
60
};
int main(void)
{
uint8_t b = 0xAA;
ApolloIOM_Configure(IOMSTR1,&stcIomConfig);
ApolloIOM_Enable(IOMSTR1);
ApolloGpio_GpioPullupEnable(BOARD_I2C_SCL_PIN,TRUE);
ApolloGpio_GpioPullupEnable(ARDUINO_SDA,TRUE);
ApolloGpio_GpioSelectPullup(ARDUINO_SCL,PullUp6K);
ApolloGpio_GpioSelectPullup(ARDUINO_SDA,PullUp6K);
ApolloGpio_GpioInputEnable(ARDUINO_SCL,TRUE);
ApolloGpio_GpioInputEnable(ARDUINO_SDA,TRUE);
ApolloGpio_GpioSelectFunction(ARDUINO_SCL _PIN,
ApolloGpio_GpioSelectFunction(ARDUINO_SDA,
// Writing 1 byte data for address 5, register 0x11
ApolloIom_I2CWriteRegister(IOMSTR1,0x05,0x11,&b,1);
// Reading 1 byte data for address 5, register 0x11
ApolloIom_I2CReadRegister(IOMSTR1,0x05,0x11,&b,1);
while(1)
{
__NOP();
}
}
EEU-UG-2017120001-10
FEEU Ultra-Low-Power Apollo Evaluation Kit Platform
Chapter 2 Using the Hardware
//frequency
//SPHA setting
//SPOL setting
//WriteThreshold
//ReadThreshold
ARDUINO_SCL_FUNC);
ARDUINO_SDA_FUNC);
- 26 -
© Fujitsu Electronics Europe GmbH